4 Replies Latest reply on Aug 18, 2002 3:39 PM by Dain Sundstrom

    3.0.1 problem without DOCTYPE / with DOCTYPE in xml descript

    brian Newbie

      I successfully made PostgreSQL 7.1.3 as a datasource available to jboss 3.0.1. I then deployed my app jar which has been working happliy and fine on jboss 3.0.0 alpha since last year (I tried to update to RC1, RC2. All failed.). JBoss 3.0.1 successfully created tables although the following problem incurred:

      Bean: company
      Section: 9.2.2
      Warning: The entity bean class must not be defined as abstract.

      Bean: company
      Section: 9.4.7.1
      Warning: The primkey-field element must name a public field in the bean implementation class.

      The above two warnings showed up for every entity beans. Interestingly, this problem only occurred if I commented out DOCTYPE on the ejb-jar.xml and jbosscmp-jdbc.xml.
      When I connected from client, I couldn't look up my session bean via jndi. The error message was:

      javax.naming.CommunicationException: org.jnp.interfaces.MarshalException:error unmarshalling return; nested exception is:
      java.lang.ClassNotFoundException: org.jnp.interfaces.MarshalledValuePair (no security manager: RMI class loader disabled)

      I found the class is in the jnpserver.jar file. when I use jndiContext.lookup("....") I should get a proxy object not the MarshalledValuePair object, shouldn't I?
      I then imported the class to force jndi lookup and I did get a MarshalledValuePair without the above problem. However, The PortableRemoteObject.narrow(...) cause a case cast problem.


      Here comes another problem when I included DOCTYPE which is PUBLIC and point to Sun and JBoss. The previous problem was gone but the following one showed up:

      Problem starting serive jboss.j2ee:service=EJB.jndiName=company
      java.lang.NumberFormatException:
      at java.lang....
      ...
      at or.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.(JDBCEntityMetaData.java:412)
      ....

      This problem occurred for every entity beans. At this time, the jar file wasn't deployed anymore.

      Why will the DOCTYPE cause different problems? I do have a public field in the bean implementation class (Is this the EntityBean implementaion class? )
      Please help.

      Brian

        • 1. Re: 3.0.1 problem without DOCTYPE / with DOCTYPE in xml desc
          brian Newbie

          Hi, Sorry. I solved part of the problem. The MarshalledValuePair problem was gone by parse all jar file in the ${JBOSS_HOME}/client directory on Netbeans. That is, in my classpath. However, DOCTYPE problem still exists.

          Pleas help.

          Brian

          • 2. Re: 3.0.1 problem without DOCTYPE / with DOCTYPE in xml desc
            Dain Sundstrom Master

            The DOCTYPE is required to be present by the EJB specification. If JBoss is actually going to the server to get the dtd, it is a bug. Can you file a bug report?

            • 3. Re: 3.0.1 problem without DOCTYPE / with DOCTYPE in xml desc
              brian Newbie

              Thanks.

              I found cause of NumberFormatException. In my jbosscmp-jdbc.xml, I had an entry: <read-time-out/>, which causes that exception. In the file, org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData , the following codes actually invoke the exception:


              // read-time-out
              String readTimeOutStr =
              MetaData.getOptionalChildContent(element, "read-time-out");
              if(readTimeOutStr != null) {
              readTimeOut = Integer.parseInt(readTimeOutStr);
              } else {
              readTimeOut = defaultValues.getReadTimeOut();
              }

              The Integer.parseInt(readTimeOutStr) causes NumberFormatException if <read-time-out/> is used. Is this a bug since <read-time-out/> is not illegal? I know I shouldn't have done that. However, should a try { catch(){} be used?

              // read-time-out
              String readTimeOutStr =
              MetaData.getOptionalChildContent(element, "read-time-out");
              if(readTimeOutStr != null) {
              try {
              readTimeOut = Integer.parseInt(readTimeOutStr);
              } catch (java.lang.NumberFormatException numberformatException){
              readTimeOut = defaultValues.getReadTimeOut();
              }
              } else {
              readTimeOut = defaultValues.getReadTimeOut();
              }



              • 4. Re: 3.0.1 problem without DOCTYPE / with DOCTYPE in xml desc
                Dain Sundstrom Master

                You right. Can you post a bug report or a pactch? Thanks.