1 Reply Latest reply on Mar 6, 2002 3:27 PM by Rakesh

    ClassCastException while using Local interfaces

    Rakesh Newbie

      Hi,
      Iam using Local Interfaces with JBoss3.0 alpha.

      Iam getting the following error during deployment:

      java.lang.ClassCastException: $Proxy1
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.getEJBLocalHome(BaseLocalContainerInvoker.java:199)
      at org.jboss.ejb.Container.init(Container.java:391)
      at org.jboss.ejb.EntityContainer.init(EntityContainer.java:294)
      at org.jboss.ejb.Application.start(Application.java:201)
      at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:382)
      at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:308)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:467)
      at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:444)
      at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:215)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:654)
      at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:327)
      at java.lang.Thread.run(Unknown Source)
      [2002-02-26 15:32:45,765,J2eeDeployer#Default,ERROR] Starting core_ejb.jar failed!
      javax.management.RuntimeMBeanException: RuntimeException thrown in operation deploy
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1640)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:467)
      at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:444)
      at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:215)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:654)
      at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:327)
      at java.lang.Thread.run(Unknown Source)
      [2002-02-26 15:32:45,906,J2eeDeployer#Default,INFO] Module core_ejb.jar is not running
      [2002-02-26 15:32:45,906,J2eeDeployer#Default,INFO] Destroying application core_ejb.jar
      [2002-02-26 15:32:45,921,J2eeDeployer#Default,INFO] Destroyed
      [2002-02-26 15:32:45,921,AutoDeployer,ERROR] Deployment failed:file:/D:/Servers/jboss-3.0.0alpha/deploy/core_ejb.jar
      org.jboss.deployment.J2eeDeploymentException: Error while starting core_ejb.jar: null, Cause: java.lang.NullPointerException
      at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:529)
      at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:444)
      at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:215)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:654)
      at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:327)
      at java.lang.Thread.run(Unknown Source)

      I have used the <local-home> and tags in ejb-jar,
      also specified tags in <ejb-local-ref> and also changed to <local-jndi-name> in jboss.xml. Is there something more i should do to use local interfaces?!!


      EJB-JAR.xml

      ...

      <ejb-name>UserCMPEJB</ejb-name>
      <local-home>com.core.persistence.user.UserHome</local-home>
      com.core.persistence.user.User
      <ejb-class>com.core.persistence.user.UserCMPBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>UserCMPEJB</abstract-schema-name>
      <cmp-field>
      <field-name>userId</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>password</field-name>
      </cmp-field>
      <ejb-local-ref>
      <ejb-ref-name>UserCMPEJB</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>com.core.persistence.user.UserHome</local-home>
      com.core.persistence.user.User
      <ejb-link>com.core.persistence.UserCMPBean</ejb-link>
      </ejb-local-ref>


      ....

      JBOSS.xml

      <ejb-name>UserCMPEJB</ejb-name>
      <local-jndi-name>UserCMPEJB</local-jndi-name>
      <configuration-name></configuration-name>


      Do i have to specify <ejb-ref> if iam specifying <local-jndi-name> in jboss.xml? Am i missing something? Do let me know.
      Thanks in advance!