I've set up a session bean which refers to an entity bean. In the
session bean's ejb-jar.xml I have:

                  <ejb-ref>
                    <description>The Person EJB models a person.</description>
                    <ejb-ref-name>ejb/Person</ejb-ref-name>
                    <ejb-ref-type>Entity</ejb-ref-type>
                    <home>com.lisasoft.telstra.webfoot.ejb.person.PersonHome</home>
                    <remote>com.lisasoft.telstra.webfoot.ejb.person.Person</remote>
                  </ejb-ref>

and in jboss.xml I have:

         <ejb-ref>
           <ejb-ref-name>ejb/Person</ejb-ref-name>
           <jndi-name>Person</jndi-name>
         </ejb-ref>

and it deploys OK.  But when I try to get a reference using this code
(as recommended in the manual):

                ProjectHome _projectHome;
    Object lookupObj;

    lookupObj = ctx.lookup(projectJndi);
                System.out.println( "Casting from " + lookupObj.getClass().getName() + 
" to " + ProjectHome.class.getName() );
    _projectHome = (ProjectHome)lookupObj;

I get this:

[statefulWebfoot] Casting from $Proxy7 to 
com.lisasoft.telstra.webfoot.ejb.project.ProjectHome
[statefulWebfoot] java.lang.ClassCastException: $Proxy7
        at com.lisasoft.telstra.webfoot.command2.Resources.<init>(Resources.java:60)
        at 
com.lisasoft.telstra.webfoot.ejb.webfoot.WebFootBean.grabResources(WebFootBean.java:959)
        at 
com.lisasoft.telstra.webfoot.ejb.webfoot.WebFootBean.ejbCreate(WebFootBean.java:237)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.createSession(StatefulSessionFilePersistenceManager.java:146)
        at 
org.jboss.ejb.StatefulSessionContainer.createHome(StatefulSessionContainer.java:369)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invokeHome(StatefulSessionContainer.java:508)
        at 
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:122)
        at 
org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(StatefulSessionInstanceInterceptor.java:79)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:263)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86)
        at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106)
        at 
org.jboss.ejb.StatefulSessionContainer.invokeHome(StatefulSessionContainer.java:305)
        at 
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContainerInvoker.java:207)
        at 
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContainerInvoker.java:153)
        at java.lang.reflect.Method.invoke(Native Method)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
        at sun.rmi.transport.Transport$1.run(Transport.java:142)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:139)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:443)
        at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:643)
        at java.lang.Thread.run(Thread.java:484)

Also when deploying my beans I often get stuff like:

[Auto deploy] Auto deploy of file:/usr/local/tcook/jboss/deploy/output.jar
[Container factory] Deploying:file:/usr/local/tcook/jboss/deploy/output.jar
[Container factory] Loading ejb-jar.xml : 
jar:file:/usr/local/tcook/jboss/tmp/deploy/tmpejbjar46621.jar!/META-INF/ejb-jar.xml
[Container factory] Loading standardjboss.xml : 
jar:file:/usr/local/tcook/jboss/lib/ext/jboss.jar!/org/jboss/metadata/standardjboss.xml
[Verifier] Verifying file:/usr/local/tcook/jboss/tmp/deploy/tmpejbjar46621.jar
[Verifier] Output: Verified.
[Container factory] Deploying Output
[Container factory] Container Invoker Optimize='false'
[Container factory] java.lang.ClassNotFoundException: $Proxy2
[Container factory] java.lang.ClassNotFoundException: $Proxy1
[Container factory] java.lang.ClassNotFoundException: class 
org.jboss.security.EJBSecurityManagerDefaultImpl
[Container factory] java.lang.ClassNotFoundException: class 
org.jboss.security.SimpleRealmMapping
[Container factory] java.lang.ClassNotFoundException: $Proxy3
[Container factory] java.lang.ClassNotFoundException: $Proxy0
[Container factory] java.lang.ClassNotFoundException: $Proxy4
[Container factory] java.lang.ClassNotFoundException: class org.jboss.tm.TxManager
[Container factory] No resource manager found for jdbc/WebFootDB
[Container factory] Bound Output to Output
[Container factory] Deployed application: file:/usr/local/tcook/jboss/deploy/output.jar

Why the ClassNotFoundExceptions on the $Proxyx classes?

Tom


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to