1 Reply Latest reply on May 23, 2002 3:00 PM by Julio

    Client giving error

    amitesh chandra Newbie

      Hi
      I am able to deploy a Simple CMP bean.But when i am running client it gives the error
      javax.ejb.CreateException: Could not create entity:java.lang.NullPointerException

      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)

      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)

      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)

      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invokeHome(Unknown Source)

      at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invokeHome(HomeProxy.java:258)

      at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:182)

      at $Proxy0.create(Unknown Source)

      at ejbtest.Client.main(Client.java:43)

      Can any one help me?
      //jaws.xml is

      OracleDS
      <type-mapping>Oracle8</type-mapping>

      <enterprise-beans>

      <ejb-name>StudentBean</ejb-name>
      <table-name>Student</table-name>
      <create-table>true</create-table>
      <remove-table>false</remove-table>
      <cmp-field>
      <field-name>id</field-name>
      <column-name>ID</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>Name</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(100)</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>title</field-name>
      <column-name>Title</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(100)</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>marks</field-name>
      <column-name>Marks</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>div</field-name>
      <column-name>Div</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(10)</sql-type>
      </cmp-field>



      </enterprise-beans>


      //ejb-jar.xml is

      <ejb-jar>
      <display-name>Student Bean</display-name>
      <enterprise-beans>


      Models a student result
      <ejb-name>StudentBean</ejb-name>
      ejbtest.StudentHome
      ejbtest.Student
      <ejb-class>ejbtest.StudentBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <cmp-field><field-name>id</field-name></cmp-field>
      <cmp-field><field-name>title</field-name></cmp-field>
      <cmp-field><field-name>name</field-name></cmp-field>
      <cmp-field><field-name>marks</field-name></cmp-field>
      <cmp-field><field-name>div</field-name></cmp-field>
      <primkey-field>id</primkey-field>




      </enterprise-beans>

      <assembly-descriptor>
      <container-transaction>

      <ejb-name>StudentBean</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>

      Please reply soon

      Thanks
      amitesh

        • 1. Re: Client giving error
          Julio Newbie

          I'm not sure if this maybe the case, but I've discovered that you get a NullPointerException if you don't specify the value for a property of a simple type (i.e., boolean, int, long, etc.). You should make sure that if you're storing simple type values, to use the appropriate wrapper object (i.e. Integer, Long, Boolean, etc.).

          Hope this helps