2 Replies Latest reply on Oct 13, 2010 9:24 AM by jyotsana

    java.lang.ClassCastException:

    jyotsana Newbie

      I am using JBoss5 as ejb Container. I created classes and here is my
      Code of ejb-jar.xml
      <?xml version="1.0"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems,Inc.//DTD Enterprise JavaBeans 2.0//EN""http://java.sun.com/dtd/ejb-jar_2_0.dtd">
      <ejb-jar>
      <enterprise-beans>
      <session>
      <ejb-name>greetBean</ejb-name>
      <home>greetHome</home>
      <remote>greetRemote</remote>
      <ejb-class>greetBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container </transaction-type>
      </session>
      </enterprise-beans>
      </ejb-jar>
      Code of jboss.xml
      <?xml version='1.0' ?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN"
      <jboss>
      <enterprise-beans>
      <entity>
      <ejb-name>greetBean</ejb-name>
      <jndi-name>greetJndi</jndi-name>
      </entity>
      </enterprise-beans>
      </jboss>
      and along with the class files I created the jar file and deployed in the JBoss.
      I am getting the following Error in the JBoss Server Screen.
      vfszip:/D:/jboss-5.0.0.CR2-jdk6/jboss-5.0.0.CR2/server/default/deploy/greet.jar
      -> java.lang.ClassCastException: org.jboss.metadata.ejb.jboss.JBossSessionBeanMe
      taData cannot be cast to org.jboss.metadata.ejb.jboss.JBossEntityBeanMetaData

      I am using JBoss5 as ejb Container. I created 3 classes. and here is

      Code of ejb-jar.xml

      <?xml version="1.0"?>

      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems,Inc.//DTD Enterprise JavaBeans 2.0//EN""http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar>

      <enterprise-beans>

      <session>

      <ejb-name>greetBean</ejb-name>

      <home>greetHome</home>

      <remote>greetRemote</remote>

      <ejb-class>greetBean</ejb-class>

      <session-type>Stateless</session-type>

      <transaction-type>Container </transaction-type>

      </session>

      </enterprise-beans>

      </ejb-jar>

       

       

      Code of jboss.xml

       

      <?xml version='1.0' ?>

      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN"

      "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">

      <jboss>

      <enterprise-beans>

      <entity>

      <ejb-name>greetBean</ejb-name>

      <jndi-name>greetJndi</jndi-name>

      </entity>

      </enterprise-beans>

      </jboss>

       

      and along with the class files I created the jar file and deployed in the JBoss.

      I am getting the following Error in the JBoss Server Screen.

      vfszip:/D:/jboss-5.0.0.CR2-jdk6/jboss-5.0.0.CR2/server/default/deploy/greet.jar

      -> java.lang.ClassCastException: org.jboss.metadata.ejb.jboss.JBossSessionBeanMe

      taData cannot be cast to org.jboss.metadata.ejb.jboss.JBossEntityBeanMetaData