How to slove follwoing error "Unreported exception java.io.IOException;"
Currently I'm using following:
XP Professional
J2sdk1.4.2_01
Xerces-2_5_0
Xalan-j_2_5_1
Jakarta-tomcat-4.1.27
Jdom-b9
Current Classpath setting
User variables
PATH = c:\bmrt2.5\bin; c:\j2sdk\bin;%PATH%;%JAVA_HOME%\bin;
CLASSPATH=.;c:\xerces\xmlParserAPIs.jar;c:\xerces\xercesImpl.jar;
c:\xerces\xercesSamples.jar;c:\xalan\xercesImpl.jar;c:\xalan\xmlapis.jar;c:\xalan\xalan.jar;c:\tomcat\lib\webserver.jar;c:\tomcat\lib\jasper.jar;c:\tomcat\lib\xml.jar;c:\tomcat\common\lib\serlet.jar;c:\tomcat\lib\tools.jar; c:\tomcat\lib\tools.jar;c:\jdom\build\jdom.jar;
CATALINA_HOME= c:\tomcat
JAVA_HOME= c:\j2sdk
System variables
PATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;
c:\j2sdk\bin;%Path%;%JAVA_HOME%\bin;
CLASSPATH=.;c:\xerces\xmlParserAPIs.jar;c:\xerces\xercesImpl.jar;
c:\xerces\xercesSamples.jar;c:\xalan\xercesImpl.jar;c:\xalan\xmlapis.jar;c:\xalan\xalan.jar;c:\tomcat\lib\webserver.jar;c:\tomcat\lib\jasper.jar;c:\tomcat\lib\xml.jar;c:\tomcat\common\lib\serlet.jar;c:\tomcat\lib\tools.jar; c:\tomcat\lib\tools.jar;
CATALINA_HOME= c:\tomcat
JAVA_HOME= c:\j2sdk
Program
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.jdom.*;
import org.jdom.Element;
import org.jdom.Document;
import org.jdom.output.XMLOutputter;
import org.jdom.input.SAXBuilder;
import org.jdom.Attribute;
import java.util.List;
public class AddToList extends HttpServlet
public Document getDocument(File sourceFile, PrintWriter errorsOut)
try
SAXBuilder builder = new SAXBuilder();
Document document = builder.build(sourceFile);
return document;
catch(JDOMException e)
errorsOut.print("there was a problem building the document: " e. getMessage()"<br/>"+ "Returning blank document.");
return new Document(new Element("blank"));
public void saveDocument(Document saveDoc, File saveFile, PrintWriter errorsOut)
try
FileOutputStream outStream= new FileOutputStream(saveFile);
XMLOutputter outToFile= new XMLOutputter(" ",true);
outToFile.output(saveDoc, outStream);
outStream.flush();
outStream.close();
catch (IOException e)
errorsOut.print("Can't save order.xml: " + e.getMessage()+"<br />");
public void addItem(Element orderElement, String product_id, String quant)
Element newItem =new Element("item");
newItem.setAttribute("product_id", product_id);
Element quantity =new Element("quantity");
quantity.addContent(quant);
newItem.addContent(quantity);
orderElement.addContent(newItem);
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
String thisProduct_id=request.getParameter("addProduct_id");
String thisQuantity=request.getParameter("addQuantity");
response.setContentType("text/html");
PrintWriter out= response.getWriter();
out.print("Adding "+ thisQuantity + "of item to chart "+ thisProduct_id +" ... ");
File orderFile = new File ("file:///c:/jdk1.3/orders.xml");
if(!orderFile.exists())
out.print("Creating ordersrocks....<br />");
Element root= new Element("orders");
root.addContent(" ");
Document document = new Document(root);
saveDocument (document, orderFile, out);
else
out.print("Orders File Exists.");
Document document =getDocument(orderFile, out);
HttpSession session =request.getSession(true);
String session_id= session.getId();
Element root =document.getRootElement();
List orders =root.getChildren();
int num_orders =orders.size();
boolean orderExists =false;
int orderIndex =0;
for(int i=0; i<num_orders; i++)
Element iOrder=(Element)orders.get(i);
String iOrder_id=iOrder.getAttributeValue("order_id");
if (iOrder_id.equals(session_id))
orderExists=true;
orderIndex=i;
break;
if(!orderExists)
Element order =new Element("order");
order.setAttribute("order_id", session_id);
Element status =new Element("order_status");
status.setText("open");
order.addContent(status);
addItem(order, thisProduct_id, thisQuantity);
root.addContent(order);
else
Element thisOrder=(Element)orders.get(orderIndex);
boolean itemExists=false;
int itemIndex =0;
List items =thisOrder.getChildren("item");
int num_items =items.size();
for(int i=0; i<num_items; i++)
Element iItem=(Element)items.get(i);
String iProduct_id =iItem.getAttribute("product_id").getValue();
if(iProduct_id.equals(thisProduct_id))
itemExists =true;
itemIndex =i;
break;
if(itemExists)
Element thisItem=(Element)items.get(itemIndex);
String currentQuantity= thisItem.getChildText("quantity");
int newQuantity = Integer.parseInt(currentQuantity)+ Integer.parseInt(thisQuantity);
String strQuantity= new String().valueOf(newQuantity)+1;
thisItem.getChild("quantity").setText(strQuantity);
else
addItem(thisOrder, thisProduct_id, thisQuantity);
saveDocument (document, orderFile, out);
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
doGet(request, response);
When I compile above program, it gives me following error.
Error
C:\tomcat\webapps\book\WEB-INF\classes>javac AddToList.java
AddToList.java:19: unreported exception java.io.IOException; must be caught
or declared to be thrown
Document document = builder.build(sourceFile);
^
1 error
Any help regarding this will be appreciated
Thank you
Rocks
Obadare
Thank for your help, my program compile successfully. But now I�m facing different kind of error on Tomcat; why it gives me following error and how do I solve it
http://localhost:8080/rock/servlet/AddToList
Following Error generate by Tomcat:
Http Status 500-
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Cannot allocate servlet instance for path /rock/servlet/AddToList
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:435)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:247)
root cause
java.lang.NoClassDefFoundError: org/jdom/JDOMException
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:903)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:416)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:247)
The following is my configuration
Classpath= .;c:\xalan\bin\xalan.jar;c:\xalan\bin\xml-apis.jar;c:\xerces\xmlParserAPIs.jar;c:\xerces\xercesImpl.jar;c:\tomcat\common\lib\servlet.jar;c:\jdom\build\jdom.jar;
Java_Home=c:\jdk1.3
Catalina_Home=c:\tomcat
Server.xml
<Engine name="Standalone" defaultHost="localhost" debug="0">
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="/rock" docBase="rock" debug="0"
reloadable="true" crossContext="true">
P.S When I try to build javadoc it give me following error:
C:\jdom>build javadoc
JDOM Build System
Building with classpath c:\jdk1.3\lib\tools.jar;.\lib\ant.jar;.\lib\xml-apis.jar
;.\lib\xerces.jar;
Starting Ant...
Buildfile: build.xml
[javadoc] Constructing Javadoc information...
[javadoc] Building tree for all the packages and classes...
[javadoc] Building index for all the packages and classes...
[javadoc] javadoc: warning - Tag @link: Class or Package not found: javax.xml.
transform.TransformerFactory#getFeature
[javadoc] javadoc: warning - Tag @link: Class or Package not found: javax.xml.
transform.TransformerFactory#getFeature
[javadoc] Building index for all classes...
[javadoc] javadoc: warning - Tag @link: Class or Package not found: javax.xml.
transform.TransformerFactory#getFeature
[javadoc] javadoc: warning - Tag @link: Class or Package not found: javax.xml.
transform.TransformerFactory#getFeature
[javadoc] javadoc: warning - Tag @link: Class or Package not found: javax.xml.
transform.Transformer
[javadoc] javadoc: warning - Tag @link: Class or Package not found: javax.xml.
transform.Transformer
[javadoc] javadoc: warning - Tag @link: Class or Package not found: javax.xml.
transform.Transformer JAXP TrAX Transformer
[javadoc] javadoc: warning - Tag @link: Class or Package not found: javax.xml.
transform.TransformerFactory#getFeature
[javadoc] javadoc: warning - Tag @link: Class or Package not found: javax.xml.
transform.TransformerFactory#getFeature
[javadoc] javadoc: warning - Tag @link: Class or Package not found: java.lang.
Double#NaN
[javadoc] Generating C:\jdom\build\apidocs\stylesheet.css...
[javadoc] 10 warnings
BUILD SUCCESSFUL
Total time: 12 seconds
Similar Messages
-
ERROR:Unreportted Exception java.io.IOEcxeption
import java.io.*;
public class MyFileWriter{
BufferedReader br;
InputStreamReader isr;
PrintWriter pw;
FileWriter fw;
File f;
String data;
public MyFileWriter(){
isr=new InputStreamReader(System.in);
br=new BufferedReader(isr);
f=new File("one.txt");
fw=new FileWriter(f);
pw=new PrintWriter(fw);
readData();
public void readData(){
try{
while(true){
System.out.println("enter the data except #");
data=br.readLine();
if(data.equals("#"))
break;
writeData();
catch(IOException ie){
System.out.println(ie);
public void writeData(){
try{
pw.println(data);
*}catch(IOException ie){*
System.out.println(ie);
public static void main(String []args){
MyFileWriter mfw=new MyFileWriter();fw=new FileWriter(f);This might throw an IOException so better you write this in to try catch block or report the method that it might throw exception
This can be done as
public MyFileWriter() throws IOException
isr=new InputStreamReader(System.in);
br=new BufferedReader(isr);
f=new File("one.txt");
fw=new FileWriter(f);
pw=new PrintWriter(fw);
readData();
}or by
public MyFileWriter()
try
isr=new InputStreamReader(System.in);
br=new BufferedReader(isr);
f=new File("one.txt");
fw=new FileWriter(f);
pw=new PrintWriter(fw);
readData();
} catch(IOException ioe)
System.out.println("Any thing here");
}And go according to your requirement
Now for this code
public void writeData()
try
pw.println(data);
} catch(IOException ie)
System.out.println(ie);
}here pw.println() method doesnot throws any type of exception particularly IOException
So thats why you are getting this error
exception java.io.IOException is never thrown in body of corresponding try statement
} catch(IOException ie)so either remove "IOException ie" from there or use only "Exception e"
Hope this might help you
Better you refer java docs while coding. -
Unreported exception java.lang.Exception; must be caught or declared
I've got a piece of code that's causing an error during compilation.
W:\Java\Covenant\src\covenant\Login.java:174: unreported exception java.lang.Exception; must be caught or declared to be thrownThe line of code it is refering to is:
new Overview().setVisible(true);And it is part of a try/catch statement:
private void logincheck(java.awt.event.ActionEvent evt) {
try {
char[] PasswordInput = Password.getPassword();
String PasswordRaw = new String(PasswordInput);
String Passwordmd5 = md5(PasswordRaw);
String UsernameInput = Username.getText();
URL theUrl = new URL("http://www.phoenixrising.at/iris/validate.php?login=1&u=" + UsernameInput + "&p=" + Passwordmd5 +"");
BufferedReader in = new BufferedReader(
new InputStreamReader(
theUrl.openStream()));
String inputLine = in.readLine();
if (inputLine.equals("valid")) {
new Overview().setVisible(true);
this.setVisible(false);
System.out.println( "You have entered the correct password" );
} else {
System.out.println(theUrl);
in.close();
} catch (MalformedURLException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
} Can anyone see what might be causing this error?Can anyone see what might be causing this error? That line of code declares that it throws exception java.lang.Exception, so you must either catch it ("must be caught" - like you do the more specific Exceptions) or declare your logincheck method to throw it ("or declared to be thrown").
-
Unreported exception java.rmi.RemoteException; must be caught or declared t
I am receiving an:
unreported exception java.rmi.RemoteException; must be caught or declared to be thrown
error when I attempt to compile the Client.java file.
The Client.java file implements the ATMListener.java interface.
As you will see below, I've stripped them down by taking out all of the code, yet I still receive this error.
Any ideas...
ATMListener.java
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
* @author Eddie Brodie
* @version %I%, %G%
public interface ATMListener extends java.rmi.Remote
Client.java
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.UnknownHostException;
public class Client extends java.rmi.server.UnicastRemoteObject implements ATMListenerWell first off unless I am missing something in the API java.rmi.Remote is an interface not a class so implements not inherits, but I do not really know these classes so I cannot be sure I am not missing something.
As for the unreported exception. What could be causing something like this would be an exception thrown by the constructor of the parent class. Even if you have no constructor written for your class it still has a default constructor which will by default call the super constrcutpor meaning an exception could be thrown from the super constrcutor down to your default constructor where you would not know what to do with it. -
Unreported exception; java.sql.SQLException; must be caught or declared to
Hi everyone,
For my Java course assignment we need to make a small application that uses a MS Access database. But de code below gives me a "Unreported exception; java.sql.SQLException; must be caught or declared to be thrown at line xx" error.
public class ConnectieBeheer
private static Connection con;
private static Statement stmt;
private static ResultSet res;
private static ResultSetMetaData md;
private ConnectieBeheer(){}
public static void openDB() {
Driver driver = new JdbcOdbcDriver();
Properties info = new Properties();
String url = "jdbc:odbc:theater";
con = driver.connect(url, info); <--- Error here
if (con != null)
stmt = con.createStatement(); <--- Error here
DatabaseMetaData dma = con.getMetaData(); <--- Error here
}So I tried this :
public static void openDB() throws SQLException {Now I do not get an error.
The OpenDB method is called from a different class like this :
public static void test1(){
ConnectieBeheer.openDB();
System.out.println("DB opened");
}But now it gives the same "Unreported exception; java.sql.SQLException; must be caught or declared to be thrown at line xx" error but now at the line ConnectieBeheer.openDB();
Why is this? And what can I do to correct this?
Thanks!
Steven.you should read the sun tutoriel about exceptions handling ;
there are two ways to handle an exception : either you redirects it (using "throws" statement, what you did for the openDB method), or you catch it using a try { ... } catch (Exception exc) {}
if you want to get rid of the error what you can do is :
public static void test1(){
try {
ConnectieBeheer.openDB();
} catch (java.sql.SQLException sqle) {
sqle.printStackTrace();
System.out.println("DB opened");
} -
Unreported Exception java.lang.InstantiationException
Dear Friends,
I am developing javabean connectivty for inserting records to mysql database from jsp. when i try to compile java bean program. It gives an error like unreported Exception java.lang.InstantiationException: Must be caught or declared to be thrown*. This is my mode. Please anyone help to solve this error. if you find any error in my code, please suggest me. Thanks in advance.
package com.webdeveloper.servlets;
import java.sql.*;
import java.io.*;
public class InsertBean {
private String dbURL = "jdbc:mysql://localhost:3306/test";
private Connection dbCon;
private Statement st;
String dbuser = "root";
String dbpass = "admin";
String Name = null;
String Address = null;
String Zip = null;
public InsertBean() {
super();
public String getName() {
return this.Name;
public String getAddress() {
return this.Address;
public String getZip() {
return this.Zip;
public void setName(String pname) {
this.Name = pname;
public void setAddress(String paddress) {
this.Address = paddress;
public void setZip(String pzip) {
this.Zip = pzip;
public void doInsert() throws ClassNotFoundException, SQLException {
Class.forName("com.mysql.jdbc.Driver").newInstance();//it gives error in this line
dbCon = DriverManager.getConnection(dbURL,dbuser,dbpass);
Statement s = dbCon.createStatement();
String sql = "Insert into Person values ('" + this.Name;
sql = sql + "', '" + this.Address + "', " + this.Zip;
sql = sql + ")";
int insertResult = s.executeUpdate(sql);
dbCon.close();
}Dear BalusC,
Thanks for your suggestion. I used try catch block also. But it still gives same error. I have modified my following code. Is there any thing wrong in my code? Please give me your suggestion. Thankyou.
// Java Document
package com.webdeveloper.servlets;
import java.sql.*;
import java.io.*;
public class InsertBean {
private String dbURL = "jdbc:mysql://localhost:3306/test";
private Connection dbCon;
private Statement st;
String dbuser = "root";
String dbpass = "admin";
String Name = null;
String Address = null;
String Zip = null;
public InsertBean() {
super();
public String getName() {
return this.Name;
public String getAddress() {
return this.Address;
public String getZip() {
return this.Zip;
public void setName(String pname) {
this.Name = pname;
public void setAddress(String paddress) {
this.Address = paddress;
public void setZip(String pzip) {
this.Zip = pzip;
public void doInsert() throws ClassNotFoundException, SQLException {
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
dbCon = DriverManager.getConnection(dbURL,dbuser,dbpass);
Statement s = dbCon.createStatement();
String sql = "Insert into Person values ('" + this.Name;
sql = sql + "', '" + this.Address + "', " + this.Zip;
sql = sql + ")";
int insertResult = s.executeUpdate(sql);
catch(Exception e){
System.out.println("error occured :" + e);
dbCon.close();
} -
On one PC but not another I am getting an error message: Exception: java.la
There is an applet on my site which is not loading for some users and not others.
On one PC but not another I am getting an error message: Exception: java.lang.ClassNotFound.Exception:CheckboxApp.class
The name of the applet is CheckboxApp
some other user of my site are also getting similar messages
Is there something from sun that can be downloaded by the users or is there some problem at the server level?
ThanksIt's probably because of the way the html that's calling the applet is coded, in conjunction with the vendor (Sun or MS) and version of the Plugin/JRE. This will help you ger started with diagnosis:
http://java.sun.com/products/plugin/ -
Hi,
After upgrading to AppWorld 3.1.0.56 error message "Exception: java.lang.NoClassDefFoundError" occurs, is there a way to downgrade back to the old version at this point.
Thank you.RIM is aware of this issue and has yet to resolve it.
One solution is to downgrade your AppWorld.
First, delete what you have at Options > Device > Applications
(or on OS5, Options > Advanced > Applications).
Then, using your BlackBerry browser, navigate to this link for your OS level:
BlackBerry App World v3.0.1.29 [OS7]
BlackBerry App World v3.0.1.29 [OS6]
BlackBerry App World v3.0.1.29 [OS5]
1. If any post helps you please click the below the post(s) that helped you.
2. Please resolve your thread by marking the post "Solution?" which solved it for you!
3. Install free BlackBerry Protect today for backups of contacts and data.
4. Guide to Unlocking your BlackBerry & Unlock Codes
Join our BBM Channels (Beta)
BlackBerry Support Forums Channel
PIN: C0001B7B4 Display/Scan Bar Code
Knowledge Base Updates
PIN: C0005A9AA Display/Scan Bar Code -
What's matter?
I checked URL in jnlp file several times. but I coudn't know how to do.
Error mesagge shows below,
Exception: java.io.IOException: HTTP response 404 : LaunchDesc: null ]
at com.sun.javaws.cache.DownloadProtocol.doDownload(Unknown Source)
...etc
Anybody help, plz?Hi,
this might be a proxy config issue. Check Sun's Web Start FAQ for more details.
- Gerald -
BLOBDestination Caught exception: java.io.IOException: ORA-01031
Having problems getting the blobdestination feature to work. Everything looks good in the server trace, up to the distribution of the output. Any idea what the ORA-01031 complaint is about?
[2006/12/4 4:14:20:484] Exception 50125 (): Caught exception: java.io.IOException: ORA-01031: insufficient privileges
oracle.reports.RWException: IDL:oracle/reports/RWException:1.0
at oracle.reports.utility.Utility.newRWException(Utility.java:756)
at oracle.reports.utility.Utility.newRWException(Utility.java:769)
at oracle.reports.plugin.destination.blob.BLOBDestination.sendFile(BLOBDestination.java:229)
at oracle.reports.server.Destination.send(Destination.java:484)
at oracle.reports.server.JobObject.distribute(JobObject.java:1582)
at oracle.reports.server.JobManager.updateJobStatus(JobManager.java:2231)
at oracle.reports.server.EngineCommImpl.updateEngineJobStatus(EngineCommImpl.java:134)
at oracle.reports.server._EngineCommImplBase._invoke(_EngineCommImplBase.java:94)
at com.sun.corba.se.internal.corba.ServerDelegate.dispatch(ServerDelegate.java:353)
at com.sun.corba.se.internal.iiop.ORB.process(ORB.java:280)
at com.sun.corba.se.internal.iiop.RequestProcessor.process(RequestProcessor.java:81)
at com.sun.corba.se.internal.orbutil.ThreadPool$PooledThread.run(ThreadPool.java:106)
[2006/12/4 4:14:20:484] State 56016 (JobManager:updateJobStatus): Job 28 status is: Executed successfully but there were some errors when
distribute the output
REP-50159: Executed successfully but there were some errors when distribute the outputIt's Sounds the Privilege issue..
check these
- What user is the user connected as ?
- What is the SQL statement being issued ?
- Who owns the objects referenced in the statement ?
Various operations required SELECT as WELL AS INSERT privilege to work -
Cmsxdb Error sending request : java.io.IOException: Premature EOF
Having installed a new 10g database and then installed the cmsxdb onto it, I followed the instructions for deploying the application. This completed, and the application was started using the web browser.
Upon attempting to login the following error is displayed :
Stack Trace :
oracle.otnsamples.cmsxdb.exception.CMSAccessException: Error sending request : java.io.IOException: Premature EOF
at oracle.otnsamples.cmsxdb.useraction.ServletUtils.sendRequest(ServletUtils.java:165)
at oracle.otnsamples.cmsxdb.useraction.DataUtils.serveRequest(DataUtils.java:330)
at Contents2e_jsp._jspService(_Contents_2e_jsp.java:121)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:365)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:519)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:423)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:771)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:298)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:829)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:291)
at java.lang.Thread.run(Thread.java:534)
Can anyone shed any light please ??Hi,
is there a solution for this problem? I'm getting the same error.
TIA,
Lars Geldner -
Hi all:
I use ADF 11g tp3/ejb to develop my application.(To open a dialog by clicking a button), when I run my application developed by 11g tp2, it is right. But when I change to TP3, the error message is as below:
08/02/29 16:50:05 SEVERE: HttpRequestHandler.run Exception: java.io.IOException: ????????????????????
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:33)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
at sun.nio.ch.IOUtil.write(IOUtil.java:75)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:302)
at java.nio.channels.Channels.write(Channels.java:60)
at java.nio.channels.Channels.access$000(Channels.java:47)
at java.nio.channels.Channels$1.write(Channels.java:134)
at com.evermind.io.ChunkedOutputStream.close(ChunkedOutputStream.java:105)
at com.evermind.server.http.EvermindServletOutputStream.closeFinally(EvermindServletOutputStream.java:338)
at com.evermind.server.http.EvermindHttpServletResponse.close(EvermindHttpServletResponse.java:394)
at com.evermind.server.http.HttpRequestHandler.doFinishProcessingRequest(HttpRequestHandler.java:854)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:848)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:646)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:614)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:405)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:168)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:149)
at oracle.oc4j.network.ServerSocketReadHandler$ClientRunnable.run(ServerSocketReadHandler.java:275)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)Anyone knows what's the problem?
Thanks
HartHi,
does this reproduce in a TP3 testcase that doesn't use EJB but only the code to open the dialog ? If no, then add EJB back to the equation.
Frank -
Hi,
after connecting the 8800 via bluetooth with the new RNS310 radio in my car the 8800 shows the error message "uncaught exception: java.lang.ClassCastException" when the RNS310 tries to access the phone book and to download it to the radio-internal phone book. The option for the bluetooth connection in the 8800 is set to
- not "visible",
- address book transfer "all entries",
The event log shows the folllowing entries:
guid:0x9C3CD62E3320B498 timeUTC) Wed Aug 10 17:28:53 2011 severity:1 type:3 app:Java Exception data:
ClassCastException
No detail message
net_rim_bluetooth
BluetoothDeviceManagerImpl
getAddressCards
0x1C68
net_rim_bluetooth
PBAPServer
<private>
0xA270
net_rim_bluetooth
PBAPServer
<private>
0xA650
net_rim_bluetooth
PBAPServer
onGet
0x9EAA
net_rim_bluetooth-1
OBEXServerSession
handleNextRequest
0x29E1
net_rim_bluetooth-1
OBEXServerSession
run
0x2769
net_rim_cldc-1
Thread
run
0xB767
Is there any possibility to update the 8800 software / firmware to get rid of the error? I always have to disconnect the battery and restart.There is a loader.exe tool located in C:\Program Files\Common Files\Research In Motion\AppLoader (or if you are using a 64 bit C:\Program Files (X86)\Common Files\Research In Motion\AppLoader
Remove the battery from your BlackBerry and launch the Loader tool. You will see either USB PIN: Unknown or your actual device PIN.
As the loading process starts, there will be a list of steps to be completed in the loading process. One of those steps listed will say "Wait for Device Initialization". When you see the arrow get to this steps, reinsert your battery.
If you still get the same error, let me know and we will investigate further from there.
Good luck!
-HMthePirate
Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)! -
Few days back I received some App world updates through wireless network. After installing those updates and restarting mobile when I clicked on App world icon following error is being displayed "Uncaught exception: java.lang.NoClassDefFound Error". In fact I can't enter into appworld.
Please suggest remedy
Regards,
Hitendra SInghHello hitmech07,
Go to www.blackberry.com/appworld on your BlackBerry smartphone browser and attempt to reinstall the appliction.
Cheers,
-FB
Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
Be sure to click Kudos! for those who have helped you.
Click "Accept as a Solution" for posts that have solved your issue(s)! -
I am getting the following error when the following application code runs:
public void testPOF() {
Token T1 = new Token(1,1,"Toronto",3,5);
NamedCache aceCache = CacheFactory.getCache("ACE");
aceCache.put("TokenTest1", T1);
Token T2 = (Token) aceCache.get("AnkitAsthana");
if (T1.getNeID().equals(T1.getNeID())) {
System.out.println(" Works and equal ");
System.out.println("===============\n");
As you might already guess Token is a POF object , its artifacts are attached below. Coherence-cache-server seemed to startup fine.
<Oct 13, 2011 7:56:47 PM PDT> <Warning> <EJB> <BEA-010065> <MessageDrivenBean threw an Exception in onMessage(). The exception was:
(Wrapped) java.io.IOException: previous property index=4, requested property index=1 while writing user type 1001.
(Wrapped) java.io.IOException: previous property index=4, requested property index=1 while writing user type 1001
at com.tangosol.util.ExternalizableHelper.toBinary(ExternalizableHelper.java:215)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ConverterValueToBinary.convert(PartitionedCache.CDB:3)
at com.tangosol.util.ConverterCollections$ConverterMap.put(ConverterCollections.java:1578)
Plz help I have no idea what the issue is?
======================================================================================================================
tokens-pof-config.xml
======================================================================================================================
<?xml version="1.0"?>
<pof-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.oracle.com/coherence/coherence-pof-config"
xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-pof-config coherence-pof-config.xsd">
<user-type-list>
<!-- coherence POF user types -->
<include>coherence-pof-config.xml</include>
<!-- com.tangosol.examples package -->
<user-type>
<type-id>1001</type-id>
<class-name>Token</class-name>
</user-type>
</user-type-list>
<allow-interfaces>true</allow-interfaces>
<allow-subclasses>true</allow-subclasses>
</pof-config>
======================================================================================================================
Token.java
======================================================================================================================
import java.io.IOException;
import java.io.Serializable;
import com.tangosol.io.pof.PortableObject;
import com.tangosol.io.pof.PofReader;
import com.tangosol.io.pof.PofWriter;
import java.sql.*;
import java.util.Enumeration;
public class Token implements PortableObject {
* 1 - Unassigned
* 2 - Available
* 3 - Reserved
* 4 - defunct
private int state;
* NE-ID(s)
private String neID;
* Number of tokens currently Active
private int tokensCurrentlyActive;
* Max - Number of tokens available
private int maxTokensAvailable;
* unqiue Token ID, used to identify Tokens
private int tokenID;
* POF index for data members
public static final int TOKENID = 0;
public static final int STATE = 1;
public static final int NEID = 2;
public static final int CURTOKEN = 3;
public static final int MAXTOKEN = 4;
* @param state
public void setState(int state) {
this.state = state;
* @return
public int getState() {
return state;
* @param neID
public void setNeID(String neID) {
this.neID = neID;
* @return
public String getNeID() {
return neID;
* @param tokensCurrentlyActive
public void setTokensCurrentlyActive(int tokensCurrentlyActive) {
this.tokensCurrentlyActive = tokensCurrentlyActive;
* @return
public int getTokensCurrentlyActive() {
return tokensCurrentlyActive;
* @param maxTokensAvailable
public void setMaxTokensAvailable(int maxTokensAvailable) {
this.maxTokensAvailable = maxTokensAvailable;
* @return
public int getMaxTokensAvailable() {
return maxTokensAvailable;
* @param tokenID
public void setTokenID(int tokenID) {
this.tokenID = tokenID;
* @return
public int getTokenID() {
return tokenID;
public Token(int state, int tokenID, String neID, int maxTokensAvailable, int tokensCurrentlyActive){
this.state = state;
this.tokenID = tokenID;
this.neID = "Toronto";
this.maxTokensAvailable = maxTokensAvailable;
this.tokensCurrentlyActive = tokensCurrentlyActive;
// ----- PortableObject interface ---------------------------------------
* {@inheritDoc}
public void readExternal(PofReader reader)
throws IOException
tokenID = Integer.parseInt(reader.readString(TOKENID));
neID = reader.readString(NEID);
tokensCurrentlyActive = Integer.parseInt(reader.readString(CURTOKEN));
maxTokensAvailable = Integer.parseInt(reader.readString(MAXTOKEN));
state = Integer.parseInt(reader.readString(STATE));
* {@inheritDoc}
public void writeExternal(PofWriter writer)
throws IOException
writer.writeString(TOKENID,Integer.toString(tokenID));
writer.writeString(NEID,neID);
writer.writeString(CURTOKEN,Integer.toString(CURTOKEN));
writer.writeString(MAXTOKEN,Integer.toString(MAXTOKEN));
writer.writeString(STATE,Integer.toString(STATE));
======================================================================================================================
coherence-cache-config.xml
======================================================================================================================
<distributed-scheme>
<scheme-name>example-distributed</scheme-name>
<service-name>DistributedCache</service-name>
<serializer>
<class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
<init-params>
<init-param>
<param-type>string</param-type>
<param-value>tokens-pof-config.xml</param-value>
</init-param>
</init-params>
</serializer>
<backing-map-scheme>
<local-scheme>
<scheme-ref>example-binary-backing-map</scheme-ref>
</local-scheme>
</backing-map-scheme>
<autostart>true</autostart>
</distributed-scheme>Your read and write methods are wrong.
your constants are:
public static final int TOKENID = 0;
public static final int STATE = 1;
public static final int NEID = 2;
public static final int CURTOKEN = 3;
public static final int MAXTOKEN = 4;your readExternal and writeExternal methods are...
public void readExternal(PofReader reader)
throws IOException
tokenID = Integer.parseInt(reader.readString(TOKENID));
neID = reader.readString(NEID);
tokensCurrentlyActive = Integer.parseInt(reader.readString(CURTOKEN));
maxTokensAvailable = Integer.parseInt(reader.readString(MAXTOKEN));
state = Integer.parseInt(reader.readString(STATE));
public void writeExternal(PofWriter writer)
throws IOException
writer.writeString(TOKENID,Integer.toString(tokenID));
writer.writeString(NEID,neID);
writer.writeString(CURTOKEN,Integer.toString(CURTOKEN));
writer.writeString(MAXTOKEN,Integer.toString(MAXTOKEN));
writer.writeString(STATE,Integer.toString(STATE));
}so the order you are writing the fields is 0, 2, 3, 4, 1 which you cannot do as with POF you must always write the fields in numerical oeder of the POF ID.
Like this...
public void readExternal(PofReader reader)
throws IOException
tokenID = Integer.parseInt(reader.readString(TOKENID));
state = Integer.parseInt(reader.readString(STATE));
neID = reader.readString(NEID);
tokensCurrentlyActive = Integer.parseInt(reader.readString(CURTOKEN));
maxTokensAvailable = Integer.parseInt(reader.readString(MAXTOKEN));
public void writeExternal(PofWriter writer)
throws IOException
writer.writeString(TOKENID,Integer.toString(tokenID));
writer.writeString(STATE,Integer.toString(STATE));
writer.writeString(NEID,neID);
writer.writeString(CURTOKEN,Integer.toString(CURTOKEN));
writer.writeString(MAXTOKEN,Integer.toString(MAXTOKEN));
}For Pof ID values you can use any int you like and you can have gaps (so you could use 100, 200, 300 etc...) but they must always be written and read in order.
JK
Maybe you are looking for
-
File size bloat still evident in CC 2014.1 (or just stabilization?)
In the last couple of nights, the project I am working on (originally imported from 2014.0) has gone from 3MB to 16MB to 61MB without any new importing or explicit rendering. It's a small project. A single 10-minute sequence with perhaps 16 master cl
-
[SOLVED] An another Broadcom thread
Hey there, I could use a bit help over here. I'm trying to get my wireless working and so far it's going like hell. Here's some info: 02:00.0 Network controller: Broadcom Corporation BCM4321 802.11a/b/g/n (rev 03) Subsystem: Apple Inc. AirPort Extrem
-
Did not installl Core DLL with Reader XI
I am unable to open any pdf documents; I have Windows7 and have uninstalled and re-installed ReaderXI today (4/6/2013) and continue to get the message, "Adobe failed to install CORE DLL" how can this be corrected?
-
Mass creation material master classification
Hi, I've created my new materials, now I need to create the classification. In particular, follow an example of classification. How can I use the RCCLBI03? In particular, in relation to the example, I need to change for each material/object only the
-
Lighdm login dialog maximized issue
The login dialog on my lightdm is maximised to whole screen ( I am using lightdm-gtk-greeter ). It's happening since I updated XFCE to 4.12.. I don't really know if it's related, but prior to that udpate, lightdm login dialog had normal size, I could