Home

  

Product

  

Buy

  

Support

 First Line 
 FAQs 
 Tutorials 
 Registered Users 
 User Guide 
 Knowledge Base 

News

  

Press

  

Downloads

  

Contact

  

Company

  

Partners

  

Resources

 
 
Technical FAQ

    Application Server
  • I cannot access the local interface of my EJB using the following JNDI name: java:comp/env/ejb/mybean_L. What should I do?
  • Why do I get this error in JOnAS when I try and deploy my application: Impossible to instanciate the entity factory: jorm.rdb.oracle.SomeClassMapping java.lang.ClassNotFoundException: jorm.rdb.oracle.SomeClassMapping?
  • I'm using a queue MDB in JOnAS. GenIc complains about the subscription-durability element in the message-driven-destination element of my EJB deployment descriptor. How can I get around this?
  • When I try and access my CMP EJB in JOnAS I get the following error: Impossible to load java.sql.SQLException: Invalid column type. The problem seems to be caused by the java.sql.Timestamp JCodeBox assigned to the date field in my bean. What can I do?
  • What JNDI name do I use to access the local interface of an EJB in JOnAS?
  • Deployment
  • Why do I occasionally get java.lang.NullPointerException errors in my application deployed on Tomcat?
  • I deployed an application which had an error in it. I corrected the application but the same error is displayed. Why?
  • Why does my CMP not work correctly when one or more of the fields has a java datatype of Object?
  • When I deploy and run my application, I get an error thrown by the servlet container (i.e. apache tomcat) saying my JSP has the wrong name! What is causing this and how do I fix it?
  • When I run my deployed application that connects to an Oracle database I get the following error java.sql.SQLException: ORA-00932: inconsistent datatypes. Why
  • What does the error javax.management.InstanceAlreadyExistsException: Management:jnidName=xxx/yyyy?
  • I've suddenly started getting errors when I deploy my application (i.e. CMP definition errors). Previously it deployed ok. What do I do?
  • I've deployed an application but the selected browser hasn't loaded the application correctly. Why?
  • I get an ejb not bound error when I run my application. Why?
  • What causes this error deploying to OC4J?

    CUSTLocalHome_EntityHomeWrapper4.java:519: unreported exception java.rmi.RemoteException; must be caught or declared to be thrown collection.add(getWrapperByPK(transaction, key));

  • I've suddenly started getting errors when I make method calls in my application (i.e. findByPrimaryKey). Previously all of these method calls worked ok. What do I do?
  • Why do I get Error (2) deploying path/app.war:http://url etc when trying to deploy to Tomcat?
  • I've re-built and re-deployed my running J2EE application in JOnAS but I can't see the changes I've made. What should I do?
  • When I try and access my CMP EJB in JOnAS I get the following error: Error:null
    java.lang.IllegalArgumentException
    at java.util.Date.parse(Date.java:582)
    at java.util.Date.(Date.java:264). What is causing this?
  • EJB 2 Relationships
  • I've created a 1:M CMR relationship in JOnAS. I can navigate from the Many to the One bean but not the other way. Why is this?
  • General
  • What is the format for entering Time data?
  • What is the format for entering Date data?
  • What is the format for entering Timestamp data?
  • Why don't my generated applications seem to work using a Netscape browser? They work OK using Microsoft Internet Explorer.
  • I get an SQLException (Wrong data type in statement) when using dates in my CMP beans in JBoss. How can I correct this?
  • IDE
  • I've imported a JCodeBox application into Jbuilder. The required libraries created during the import are red indicating some kind of problem. What can I do to correct this?
  •   I cannot access the local interface of my EJB using the following JNDI name: java:comp/env/ejb/mybean_L. What should I do?To top of page

    Try dropping the java:comp/env/ part of the name i.e. access it through ejb/mybean_L

      Why do I get this error in JOnAS when I try and deploy my application: Impossible to instanciate the entity factory: jorm.rdb.oracle.SomeClassMapping java.lang.ClassNotFoundException: jorm.rdb.oracle.SomeClassMapping?To top of page

    This error can be caused if no mapper names are provided for GenIC to use. In the JOnAS server setup in JCodeBox make sure to enter at least one mapper name i.e. rdb.oracle8

      I'm using a queue MDB in JOnAS. GenIc complains about the subscription-durability element in the message-driven-destination element of my EJB deployment descriptor. How can I get around this?To top of page

    Try the following:

    • Edit ejb-jar.xml
    • Remove the subscription-durability element
    • Update your ejb jar with the new deployment descriptor
    • Run GenIc on the new updated ejb jar
    • Update your EAR application with the new ejb jar

      When I try and access my CMP EJB in JOnAS I get the following error: Impossible to load java.sql.SQLException: Invalid column type. The problem seems to be caused by the java.sql.Timestamp JCodeBox assigned to the date field in my bean. What can I do?To top of page

    At the time of writing Jorm did not support the java.sql.Timestamp type so try the following:

    • Switch the Include sql-type element option off in the JOnAS server setup
    • In the fields tab on the Define CMP EJB dialog: change any date field data types from java.sql.Timestamp to java.util.Date

    Example date formats include: Sat, 12 Aug 1995 13:30:00 GMT

      What JNDI name do I use to access the local interface of an EJB in JOnAS?To top of page

    Append _L to the remote JNDI name i.e. if the jndi name specified in the JOnAS deployment descriptor is 'beanjndi' then use 'beanjndi_L' to access the local interface.

      Why do I occasionally get java.lang.NullPointerException errors in my application deployed on Tomcat?To top of page

    We are not sure why this error happens or why it happens only occassionally. If the error occurs try one of the following to resolve it:

    • Press the refresh button in your browser
    • Stop and re-start Tomcat
    • We have also had reports that changing the verbosity level to 4 (in server.xml) can stop this problem from occurring

    We will post further information on this problem as soon as we know more.

      I deployed an application which had an error in it. I corrected the application but the same error is displayed. Why?To top of page

    Some application servers that support auto/hot-deployment for development purposes place restrictions on what part of your application can be changed and successfully re-deployed.
    If this problem occurs, re-start your application server.
    If the problem persists, manually remove (un-deploy) your application and then re-deploy it.

      Why does my CMP not work correctly when one or more of the fields has a java datatype of Object?To top of page

    Some application servers do not allow you to have fields with a datatype of java.lang.Object in CMP EJBs. The application deploys but when you try and retrieve the Object field errors occur e.g.

    javax.ejb.EJBException: Internal error getting results for field member productPriceObject; CausedByException is: Unable to load to deserialize result: java.io.StreamCorruptedException: Caught EOFException while reading the stream header or

    Caught EOFException while reading the stream header java.io.StreamCorruptedException: Caught EOFException while reading the stream header at java.io.ObjectInputStream.readStreamHeader A couple of possible alternatives are:

  • i Use a BMP EJB instead
  • ii Change the java datatype in JCodeBox on the Fields tab in the Define XXX EJB dialog.

  •   When I deploy and run my application, I get an error thrown by the servlet container (i.e. apache tomcat) saying my JSP has the wrong name! What is causing this and how do I fix it?To top of page

    Background

    A common cause of the 'wrong name' error for JSP is case sensitivity on win32 platforms when you are using the RequestDispatcher to forward to your JSP by name.

    If you create a JSP with the name abcDef.jsp (note the capital 'D')and deploy it, the servlet container will create a servlet with a name derived from your JSP name (e.g. abcDef_jsp.java).

    It will then compile the servlet and store the resulting class in its working area.

    If you then change the case of the name of your JSP (e.g. to abcdef.jsp) and re-deploy it, the servlet engine will again try to create a servlet with a name derived from your JSP name and compile it.

    On Unix platforms (which are case sensitive), the above scenario will result in another servlet being created called abcdef_jsp.java because abcDef is different to abcdef.

    However, on win32 platforms, the file name abcDef.jsp is the same as the file name abcdef.jsp so the old servlet will be over-written and the old name (abcDef_jsp.java) will be preserved.

    So originally using RequestDispatcher.forward("abcDef.jsp") to forward to the page was working ok. However now, your code is changed to forward to RequestDispatcher.forward("abcdef.jsp") but the servlet generated from your JSP is *still* called abcDef_jsp.java so the servlet complains about the JSP having a 'wrong name'.

    Cause in JCodeBox

    The following is an example of how this problem could occur in applications generated by JCodeBox:

    You have 2 BMP entity beans (and associated views sets) defined called customer and address. You define a 1:1 relationship between the 2 beans and call it custAdd (this results in a JSP being automatically created named customercustAdd.jsp).

  • You generate and deploy the application. You then change the name of the relationship to custadd - now with a lower case 'A' - and redeploy the application.
  • Now when you click on the link to retrieve the customer address information you get the 'wrong name' error being thrown by the servlet container.

    Solution

  • Delete all the generated files in you JCodeBox target output directory before re-generating and re-deploying the application.
  • Delete the .java and .class generated servlet files in your servlet containers work area. The servlet container will re-generate these files the next time the JSP is requested.

    Additional Info

    This problem can be spotted by an exception similar to the following one being thrown when you try and forward to your JSP using RequestDispatcher

    22:40:37,086 ERROR [Engine] ApplicationDispatcher[/TestAppOracle] Servlet.servic e() for servlet jsp threw exception javax.servlet.ServletException: org/apache/jsp/CUSTOMEREJBcustAdd_jsp (wrong nam e: org/apache/jsp/CUSTOMEREJBcustadd_jsp) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp atcher.java:684)

    Further down in the exception stack a root cause error similar to the following can also be found:

    22:40:37,236 ERROR [Engine] ----- Root Cause ----- java.lang.NoClassDefFoundError: org/apache/jsp/CUSTOMEREJBcustAdd_jsp (wrong nam e: org/apache/jsp/CUSTOMEREJBcustadd_jsp) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:486) at java.lang.ClassLoader.defineClass(ClassLoader.java:426) at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:21 5)

  •   When I run my deployed application that connects to an Oracle database I get the following error java.sql.SQLException: ORA-00932: inconsistent datatypes. WhyTo top of page

    This can be caused because some JDBC drivers map the Oracle FLOAT datatype to the JDBC type Other. Because of this JCodeBox has to map the datatype in the corresponding Entity Bean to type java.lang.Object. When you then deploy and run the application this error occurs when you try and read/write data to the Entity Bean.

    One solution is to change the datatype on the Fields tab in the Define XXX EJB dialog from java.lang.Object to another java datatype I.e. double.

      What does the error javax.management.InstanceAlreadyExistsException: Management:jnidName=xxx/yyyy?To top of page

    This error indicates that you are trying to assign the JNDI name xxx/yyyy to an item but this name is already in use. Try a different JNDI name.

    This error can also be recognised by the following error: javax.naming.NameAlreadyBoundException e.g.
    Error deploying application ejb: Unable to deploy EJB: CUSTOMEREJB from ejb.jar: Unable to bind EJB Home Interface to the JNDI name: ejb/CUSTOMER. The error was: javax.naming.NameAlreadyBoundException: Failed to bind remote object
    (ClusterableRemoteRef(10.0.0.3 null)/280) to replica aware stub at CUSTOMER
    (ClusterableRemoteRef(10.0.0.3 [10.0.0.3])/278) because it does not implement the same
    remote interfaces; remaining name 'ejb'

      I've suddenly started getting errors when I deploy my application (i.e. CMP definition errors). Previously it deployed ok. What do I do?To top of page

    Try stopping your application server and completely removing (manually) the previous installation (including web tier components). Then re-start your application server and re-deploy your application.

      I've deployed an application but the selected browser hasn't loaded the application correctly. Why?To top of page

    Some of the reasons for this can be:

  • The application failed to deploy correctly

    Check your application server logs to see if this was the cause of the problem. Also check that you have write permission to the deployment directory

  • Browser caching.
  • The application server hadn't completed deploying your application (when the request from the browser was received).

    The solution is the same for the last two cases - wait a few seconds and then press the refresh button on your browser (you might need to press it a couple of times depending on how long the application server takes to deploy your application).

  •   I get an ejb not bound error when I run my application. Why?To top of page

    This error can be caused if you reference an EJB but haven't added a bean reference for that EJB i.e. if you reference EJBB from EJBA, you need to add a bean reference for EJBB to EJBA. To do this in JCodeBox simply open the definition for EJBA, select the resources tab, and click the Add Bean References button. Then select EJBB from the list.

      What causes this error deploying to OC4J?

    CUSTLocalHome_EntityHomeWrapper4.java:519: unreported exception java.rmi.RemoteException; must be caught or declared to be thrown collection.add(getWrapperByPK(transaction, key));

    To top of page

    This unreported java.rmi.RemoteException can be caused when entity beans have additional finders declared. We are not completely sure why this causes a problem in the code OC4J generates but try removing all the additional finders and then adding them one by one to see which one is causing the problem. We will post further information on this problem as soon as we know more.

      I've suddenly started getting errors when I make method calls in my application (i.e. findByPrimaryKey). Previously all of these method calls worked ok. What do I do?To top of page

    Try stopping your application server and completely removing (manually) the previous installation (including web tier components). Then re-start your application server and re-deploy your application.

      Why do I get Error (2) deploying path/app.war:http://url etc when trying to deploy to Tomcat?To top of page

    JCodeBox is unable to deploy your web application. Please check that you have entered a valid user id and password for the Tomcat manager application in JCodeBox options.

      I've re-built and re-deployed my running J2EE application in JOnAS but I can't see the changes I've made. What should I do?To top of page

    Stop and re-start your JOnAS application server

      When I try and access my CMP EJB in JOnAS I get the following error: Error:null
    java.lang.IllegalArgumentException
    at java.util.Date.parse(Date.java:582)
    at java.util.Date.(Date.java:264). What is causing this?
    To top of page

    The java.util.Date object parse method is not able to parse the string you are supplying into a valid date. Try using a format like Sat, 12 Aug 1995 13:30:00 GMT.

      I've created a 1:M CMR relationship in JOnAS. I can navigate from the Many to the One bean but not the other way. Why is this?To top of page

    This is a known problem. Two possible workarounds are:

    • Upgrade to JOnAS 3.3.1
    • Manually edit the generated files so that beans participating in CMRs use Java wrapper classes as primary keys (i.e. java.lang.String) instead of using a user defined primary key class
    • e.g.
      instead of:

      <prim-key-class>MyPKClass</prim-key-class>
      use
      <prim-key-class>java.lang.String</prim-key-class>


      <primkey-field>MyPKField</primkey-field>

      What is the format for entering Time data?To top of page

    The format for entering java.sql.Time data is hh:mm:ss

      What is the format for entering Date data?To top of page

    The format for entering java.sql.Date data is yyyy-mm-dd

      What is the format for entering Timestamp data?To top of page

    The format for entering java.sql.Timestamp data is yyyy-mm-dd hh:mm:ss

      Why don't my generated applications seem to work using a Netscape browser? They work OK using Microsoft Internet Explorer.To top of page

    Some early versions of Netscape browsers did not correctly pass query string variables containing spaces to the web server. Try upgrading to a Netscape browser with a version number of 6 or higher.

      I get an SQLException (Wrong data type in statement) when using dates in my CMP beans in JBoss. How can I correct this?To top of page

    Try adding a mapping for java.sql.Date to the file standardjbosscmp-jdbc.xml i.e.

    <mapping>
    <java-type>java.sql.Date</java-type>
    <jdbc-type>DATE</jdbc-type>
    <sql-type>DATE</sql-type>
    </mapping>

      I've imported a JCodeBox application into Jbuilder. The required libraries created during the import are red indicating some kind of problem. What can I do to correct this?To top of page

    Try doing the following:

    • Save your JCodeBox application
    • Close JCodeBox
    • Close Jbuilder
    • Re-start Jbuilder

    The required library should now be OK

    [an error occurred while processing this directive]