What am I doing wrong? EJB Deployment Errors

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

What am I doing wrong? EJB Deployment Errors

Nicholas Irving

Hi I have a very simple EJB I am trying to deploy. http://www.darkedges.com/geronimo/ZooBeansProject.jar using the following command and configuration (from http://wiki.apache.org/geronimo/Deployment#head-66e0f62c5c7aeef154d29861661821d612d56945)

 

java -jar bin/deployer.jar deploy ZooBeansProject.jar

 

I am getting the following error back

  Server reports: Remote interface class not found: com.zoo.Tiger

org.apache.geronimo.deployment.DeploymentException: Remote interface class not f

ound: com.zoo.Tiger

        at org.apache.geronimo.naming.deployment.ENCConfigBuilder.assureInterfac

e(ENCConfigBuilder.java:365)

        at org.apache.geronimo.naming.deployment.ENCConfigBuilder.assureEJBObjec

tInterface(ENCConfigBuilder.java:345)

        at org.openejb.deployment.SessionBuilder.initContext(SessionBuilder.java

:238)

        at org.openejb.deployment.OpenEJBModuleBuilder.initContext(OpenEJBModule

Builder.java:300)

        at org.openejb.deployment.OpenEJBModuleBuilder$$FastClassByCGLIB$$11bd7b

20.invoke(<generated>)

        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:87)

        at org.apache.geronimo.gbean.jmx.FastMethodInvoker.invoke(FastMethodInvo

ker.java:38)

        at org.apache.geronimo.gbean.jmx.GBeanMBeanOperation.invoke(GBeanMBeanOp

eration.java:142)

        at org.apache.geronimo.gbean.jmx.GBeanMBean.invoke(GBeanMBean.java:823)

        at org.apache.geronimo.gbean.jmx.RawInvoker.invoke(RawInvoker.java:89)

        at org.apache.geronimo.gbean.jmx.RawOperationInvoker.invoke(RawOperation

Invoker.java:34)

        at org.apache.geronimo.gbean.jmx.CGLibMethodInterceptor.intercept(CGLibM

ethodInterceptor.java:112)

        at org.apache.geronimo.j2ee.deployment.ModuleBuilder$$EnhancerByCGLIB$$9

e45a280.initContext(<generated>)

        at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfigurati

on(EARConfigBuilder.java:323)

        at org.apache.geronimo.j2ee.deployment.EARConfigBuilder$$FastClassByCGLI

B$$38e56ec6.invoke(<generated>)

        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:87)

        at org.apache.geronimo.gbean.jmx.FastMethodInvoker.invoke(FastMethodInvo

ker.java:38)

        at org.apache.geronimo.gbean.jmx.GBeanMBeanOperation.invoke(GBeanMBeanOp

eration.java:142)

        at org.apache.geronimo.gbean.jmx.GBeanMBean.invoke(GBeanMBean.java:823)

        at org.apache.geronimo.gbean.jmx.RawInvoker.invoke(RawInvoker.java:89)

        at org.apache.geronimo.gbean.jmx.RawOperationInvoker.invoke(RawOperation

Invoker.java:34)

        at org.apache.geronimo.gbean.jmx.CGLibMethodInterceptor.intercept(CGLibM

ethodInterceptor.java:112)

        at org.apache.geronimo.deployment.ConfigurationBuilder$$EnhancerByCGLIB$

$7a1ca0ae.buildConfiguration(<generated>)

        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:174)

        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:60)

        at org.apache.geronimo.deployment.Deployer$$FastClassByCGLIB$$734a235d.i

nvoke(<generated>)

        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:87)

        at org.apache.geronimo.gbean.jmx.FastMethodInvoker.invoke(FastMethodInvo

ker.java:38)

        at org.apache.geronimo.gbean.jmx.GBeanMBeanOperation.invoke(GBeanMBeanOp

eration.java:142)

        at org.apache.geronimo.gbean.jmx.GBeanMBean.invoke(GBeanMBean.java:844)

        at mx4j.server.interceptor.InvokerMBeanServerInterceptor.invoke(InvokerM

BeanServerInterceptor.java:218)

        at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM

BeanServerInterceptor.java:121)

        at mx4j.server.interceptor.SecurityMBeanServerInterceptor.invoke(Securit

yMBeanServerInterceptor.java:86)

        at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM

BeanServerInterceptor.java:121)

        at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM

BeanServerInterceptor.java:121)

        at mx4j.server.interceptor.ContextClassLoaderMBeanServerInterceptor.invo

ke(ContextClassLoaderMBeanServerInterceptor.java:205)

        at mx4j.server.MX4JMBeanServer.invoke(MX4JMBeanServer.java:1079)

        at org.apache.geronimo.kernel.Kernel.invoke(Kernel.java:288)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:324)

        at mx4j.server.ReflectionMBeanInvoker.invokeImpl(ReflectionMBeanInvoker.

java:152)

        at mx4j.server.ReflectionMBeanInvoker.doInvoke(ReflectionMBeanInvoker.ja

va:119)

        at mx4j.server.ReflectionMBeanInvoker.invoke(ReflectionMBeanInvoker.java

:54)

        at mx4j.server.interceptor.InvokerMBeanServerInterceptor.invoke(InvokerM

BeanServerInterceptor.java:235)

        at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM

BeanServerInterceptor.java:121)

        at mx4j.server.interceptor.SecurityMBeanServerInterceptor.invoke(Securit

yMBeanServerInterceptor.java:86)

        at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM

BeanServerInterceptor.java:121)

        at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM

BeanServerInterceptor.java:121)

        at mx4j.server.interceptor.ContextClassLoaderMBeanServerInterceptor.invo

ke(ContextClassLoaderMBeanServerInterceptor.java:205)

        at mx4j.server.MX4JMBeanServer.invoke(MX4JMBeanServer.java:1079)

        at mx4j.remote.rmi.RMIConnectionInvoker.invoke(RMIConnectionInvoker.java

:222)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:324)

        at mx4j.remote.rmi.RMIConnectionProxy.invoke(RMIConnectionProxy.java:36)

 

        at mx4j.remote.rmi.RMIConnectionSubjectInvoker.chain(RMIConnectionSubjec

tInvoker.java:98)

        at mx4j.remote.rmi.RMIConnectionSubjectInvoker.access$000(RMIConnectionS

ubjectInvoker.java:32)

        at mx4j.remote.rmi.RMIConnectionSubjectInvoker$1.run(RMIConnectionSubjec

tInvoker.java:89)

        at java.security.AccessController.doPrivileged(Native Method)

        at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)

        at mx4j.remote.MX4JRemoteUtils.subjectInvoke(MX4JRemoteUtils.java:151)

        at mx4j.remote.rmi.RMIConnectionSubjectInvoker.subjectInvoke(RMIConnecti

onSubjectInvoker.java:85)

        at mx4j.remote.rmi.RMIConnectionSubjectInvoker.invoke(RMIConnectionSubje

ctInvoker.java:79)

        at $Proxy0.invoke(Unknown Source)

        at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImp

l.java:224)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:324)

        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)

        at sun.rmi.transport.Transport$1.run(Transport.java:148)

        at java.security.AccessController.doPrivileged(Native Method)

        at sun.rmi.transport.Transport.serviceCall(Transport.java:144)

        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4

60)

        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport

.java:701)

        at java.lang.Thread.run(Thread.java:534)

Reply | Threaded
Open this post in threaded view
|

Re: What am I doing wrong? EJB Deployment Errors

Jacek Laskowski-5
Nicholas Irving wrote:

> I am getting the following error back
>
>   Server reports: Remote interface class not found: com.zoo.Tiger
>
> org.apache.geronimo.deployment.DeploymentException: Remote interface
> class not found: com.zoo.Tiger

Let's take a look at the relevant piece of the standard deployment
descriptor (META-INF/ejb-jar.xml):

       <session >
          <description><![CDATA[A session bean named Tiger]]></description>
          <display-name>Tiger</display-name>

          <ejb-name>Tiger</ejb-name>

          <home>com.zoo.TigerHome</home>
          <remote>com.zoo.Tiger</remote>
          <local-home>com.zoo.TigerLocalHome</local-home>
          <local>com.zoo.TigerLocal</local>
          <ejb-class>com.zoo.TigerSession</ejb-class>
          <session-type>Stateless</session-type>
          <transaction-type>Container</transaction-type>

       </session>

And let's take a look at the content of the com\zoo directory where
these classes are supposed to be found:

TigerBean.class
TigerSession.class

Do you see the issue? Where are the other bean classes? The class in
question - the remote interface, com.zoo.Tiger - is not in any place
where Geronimo could find it, either in the jar itself or in the EJB
(GBean) dependencies.

I'm almost 100% sure that when you pack the whole bean correctly, the
Geronimo Deployer will do its job and deploy the bean.

Jacek

Reply | Threaded
Open this post in threaded view
|

RE: What am I doing wrong? EJB Deployment Errors

Nicholas Irving
Thanks for the rely,
Now I am confused. I have the following in (META-INF/ejb-jar.xml)

<ejb-client-jar>ZooBeansClient.jar</ejb-client-jar>

Which is included in the EJB JAR file, which contains the Remote Interface
etc. I take it somehow I need to get this reference into my
(META-INF/openejb-jar.xml) file as well? The documents regarding this are a
little vague.

NIrving

-----Original Message-----
From: Jacek Laskowski [mailto:[hidden email]]
Sent: 10 July 2005 21:12
To: [hidden email]
Subject: Re: What am I doing wrong? EJB Deployment Errors

Nicholas Irving wrote:

> I am getting the following error back
>
>   Server reports: Remote interface class not found: com.zoo.Tiger
>
> org.apache.geronimo.deployment.DeploymentException: Remote interface
> class not found: com.zoo.Tiger

Let's take a look at the relevant piece of the standard deployment
descriptor (META-INF/ejb-jar.xml):

       <session >
          <description><![CDATA[A session bean named Tiger]]></description>
          <display-name>Tiger</display-name>

          <ejb-name>Tiger</ejb-name>

          <home>com.zoo.TigerHome</home>
          <remote>com.zoo.Tiger</remote>
          <local-home>com.zoo.TigerLocalHome</local-home>
          <local>com.zoo.TigerLocal</local>
          <ejb-class>com.zoo.TigerSession</ejb-class>
          <session-type>Stateless</session-type>
          <transaction-type>Container</transaction-type>

       </session>

And let's take a look at the content of the com\zoo directory where
these classes are supposed to be found:

TigerBean.class
TigerSession.class

Do you see the issue? Where are the other bean classes? The class in
question - the remote interface, com.zoo.Tiger - is not in any place
where Geronimo could find it, either in the jar itself or in the EJB
(GBean) dependencies.

I'm almost 100% sure that when you pack the whole bean correctly, the
Geronimo Deployer will do its job and deploy the bean.

Jacek

Reply | Threaded
Open this post in threaded view
|

RE: What am I doing wrong? EJB Deployment Errors

Nicholas Irving
In reply to this post by Jacek Laskowski-5
Just added


-----Original Message-----
From: Jacek Laskowski [mailto:[hidden email]]
Sent: 10 July 2005 21:12
To: [hidden email]
Subject: Re: What am I doing wrong? EJB Deployment Errors

Nicholas Irving wrote:

> I am getting the following error back
>
>   Server reports: Remote interface class not found: com.zoo.Tiger
>
> org.apache.geronimo.deployment.DeploymentException: Remote interface
> class not found: com.zoo.Tiger

Let's take a look at the relevant piece of the standard deployment
descriptor (META-INF/ejb-jar.xml):

       <session >
          <description><![CDATA[A session bean named Tiger]]></description>
          <display-name>Tiger</display-name>

          <ejb-name>Tiger</ejb-name>

          <home>com.zoo.TigerHome</home>
          <remote>com.zoo.Tiger</remote>
          <local-home>com.zoo.TigerLocalHome</local-home>
          <local>com.zoo.TigerLocal</local>
          <ejb-class>com.zoo.TigerSession</ejb-class>
          <session-type>Stateless</session-type>
          <transaction-type>Container</transaction-type>

       </session>

And let's take a look at the content of the com\zoo directory where
these classes are supposed to be found:

TigerBean.class
TigerSession.class

Do you see the issue? Where are the other bean classes? The class in
question - the remote interface, com.zoo.Tiger - is not in any place
where Geronimo could find it, either in the jar itself or in the EJB
(GBean) dependencies.

I'm almost 100% sure that when you pack the whole bean correctly, the
Geronimo Deployer will do its job and deploy the bean.

Jacek

Reply | Threaded
Open this post in threaded view
|

RE: What am I doing wrong? EJB Deployment Errors

Nicholas Irving
In reply to this post by Jacek Laskowski-5
Sorry about the last mail, was sent incorrectly.
Just added

    </enterprise-beans>
    <ejb-client-jar>ZooBeansClient.jar</ejb-client-jar>
</openejb-jar>

To (META-INF/openejb-jar.xml) and get the following error. So obviously you
cannot reference the client jar that way.......

D:\java\appserver\geronimo>java -jar bin/deployer.jar distribute
ZooBeansProject
.jar
    Error: Unable to connect to local deployer service

org.apache.geronimo.deployment.DeploymentException:
org.apache.xmlbeans.XmlExcep
tion: Invalid deployment descriptor:
[jar:file:/D:/java/appserver/geronimo/ZooBe
ansProject.jar!/META-INF/openejb-jar.xml:0: error: Element not allowed:
ejb-clie
nt-jar@http://www.openejb.org/xml/ns/openejb-jar in element
openejb-jar@http://w
ww.openejb.org/xml/ns/openejb-jar]
Descriptor: <xml-fragment configId="localhost/ZooBeansEJB"
parentId="org/apache/
geronimo/Server" xmlns:open="http://www.openejb.org/xml/ns/openejb-jar">
  <open:enterprise-beans>
    <open:session>
      <open:ejb-name>Tiger</open:ejb-name>
      <open:jndi-name>Tiger</open:jndi-name>
    </open:session>
  </open:enterprise-beans>
  <open:ejb-client-jar>ZooBeansClient.jar</open:ejb-client-jar>
</xml-fragment>
        at
org.openejb.deployment.OpenEJBModuleBuilder.getOpenejbJar(OpenEJBModu
leBuilder.java:245)
        at
org.openejb.deployment.OpenEJBModuleBuilder.createModule(OpenEJBModul
eBuilder.java:181)
        at
org.openejb.deployment.OpenEJBModuleBuilder.createModule(OpenEJBModul
eBuilder.java:151)
        at
org.openejb.deployment.OpenEJBModuleBuilder$$FastClassByCGLIB$$11bd7b
20.invoke(<generated>)
        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:87)
        at
org.apache.geronimo.gbean.jmx.FastMethodInvoker.invoke(FastMethodInvo
ker.java:38)
        at
org.apache.geronimo.gbean.jmx.GBeanMBeanOperation.invoke(GBeanMBeanOp
eration.java:142)
        at
org.apache.geronimo.gbean.jmx.GBeanMBean.invoke(GBeanMBean.java:823)
        at
org.apache.geronimo.gbean.jmx.RawInvoker.invoke(RawInvoker.java:89)
        at
org.apache.geronimo.gbean.jmx.RawOperationInvoker.invoke(RawOperation
Invoker.java:34)
        at
org.apache.geronimo.gbean.jmx.CGLibMethodInterceptor.intercept(CGLibM
ethodInterceptor.java:112)
        at
org.apache.geronimo.j2ee.deployment.ModuleBuilder$$EnhancerByCGLIB$$9
e45a280.createModule(<generated>)
        at
org.apache.geronimo.j2ee.deployment.EARConfigBuilder.getDeploymentPla
n(EARConfigBuilder.java:126)
        at
org.apache.geronimo.j2ee.deployment.EARConfigBuilder$$FastClassByCGLI
B$$38e56ec6.invoke(<generated>)
        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:87)
        at
org.apache.geronimo.gbean.jmx.FastMethodInvoker.invoke(FastMethodInvo
ker.java:38)
        at
org.apache.geronimo.gbean.jmx.GBeanMBeanOperation.invoke(GBeanMBeanOp
eration.java:142)
        at
org.apache.geronimo.gbean.jmx.GBeanMBean.invoke(GBeanMBean.java:823)
        at
org.apache.geronimo.gbean.jmx.RawInvoker.invoke(RawInvoker.java:89)
        at
org.apache.geronimo.gbean.jmx.RawOperationInvoker.invoke(RawOperation
Invoker.java:34)
        at
org.apache.geronimo.gbean.jmx.CGLibMethodInterceptor.intercept(CGLibM
ethodInterceptor.java:112)
        at
org.apache.geronimo.deployment.ConfigurationBuilder$$EnhancerByCGLIB$
$7a1ca0ae.getDeploymentPlan(<generated>)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:60)
        at
org.apache.geronimo.deployment.Deployer$$FastClassByCGLIB$$734a235d.i
nvoke(<generated>)
        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:87)
        at
org.apache.geronimo.gbean.jmx.FastMethodInvoker.invoke(FastMethodInvo
ker.java:38)
        at
org.apache.geronimo.gbean.jmx.GBeanMBeanOperation.invoke(GBeanMBeanOp
eration.java:142)
        at
org.apache.geronimo.gbean.jmx.GBeanMBean.invoke(GBeanMBean.java:844)
        at
mx4j.server.interceptor.InvokerMBeanServerInterceptor.invoke(InvokerM
BeanServerInterceptor.java:218)
        at
mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM
BeanServerInterceptor.java:121)
        at
mx4j.server.interceptor.SecurityMBeanServerInterceptor.invoke(Securit
yMBeanServerInterceptor.java:86)
        at
mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM
BeanServerInterceptor.java:121)
        at
mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM
BeanServerInterceptor.java:121)
        at
mx4j.server.interceptor.ContextClassLoaderMBeanServerInterceptor.invo
ke(ContextClassLoaderMBeanServerInterceptor.java:205)
        at mx4j.server.MX4JMBeanServer.invoke(MX4JMBeanServer.java:1079)
        at org.apache.geronimo.kernel.Kernel.invoke(Kernel.java:288)
        at
org.apache.geronimo.deployment.cli.ServerConnection$KernelWrapper.inv
oke(ServerConnection.java:231)
        at
org.apache.geronimo.deployment.cli.ServerConnection.invokeOfflineDepl
oyer(ServerConnection.java:214)
        at
org.apache.geronimo.deployment.cli.CommandDistribute.executeOffline(C
ommandDistribute.java:120)
        at
org.apache.geronimo.deployment.cli.CommandDistribute.execute(CommandD
istribute.java:115)
        at
org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java
:111)
        at
org.apache.geronimo.deployment.cli.DeployTool.main(DeployTool.java:25
2)
Caused by: org.apache.xmlbeans.XmlException: Invalid deployment descriptor:
[jar
:file:/D:/java/appserver/geronimo/ZooBeansProject.jar!/META-INF/openejb-jar.
xml:
0: error: Element not allowed:
ejb-client-jar@http://www.openejb.org/xml/ns/open
ejb-jar in element openejb-jar@http://www.openejb.org/xml/ns/openejb-jar]
Descriptor: <xml-fragment configId="localhost/ZooBeansEJB"
parentId="org/apache/
geronimo/Server" xmlns:open="http://www.openejb.org/xml/ns/openejb-jar">
  <open:enterprise-beans>
    <open:session>
      <open:ejb-name>Tiger</open:ejb-name>
      <open:jndi-name>Tiger</open:jndi-name>
    </open:session>
  </open:enterprise-beans>
  <open:ejb-client-jar>ZooBeansClient.jar</open:ejb-client-jar>
</xml-fragment>
        at
org.apache.geronimo.schema.SchemaConversionUtils.validateDD(SchemaCon
versionUtils.java:469)
        at
org.openejb.deployment.OpenEJBModuleBuilder.getOpenejbJar(OpenEJBModu
leBuilder.java:232)
        ... 42 more

D:\java\appserver\geronimo>
-----Original Message-----
From: Jacek Laskowski [mailto:[hidden email]]
Sent: 10 July 2005 21:12
To: [hidden email]
Subject: Re: What am I doing wrong? EJB Deployment Errors

Nicholas Irving wrote:

> I am getting the following error back
>
>   Server reports: Remote interface class not found: com.zoo.Tiger
>
> org.apache.geronimo.deployment.DeploymentException: Remote interface
> class not found: com.zoo.Tiger

Let's take a look at the relevant piece of the standard deployment
descriptor (META-INF/ejb-jar.xml):

       <session >
          <description><![CDATA[A session bean named Tiger]]></description>
          <display-name>Tiger</display-name>

          <ejb-name>Tiger</ejb-name>

          <home>com.zoo.TigerHome</home>
          <remote>com.zoo.Tiger</remote>
          <local-home>com.zoo.TigerLocalHome</local-home>
          <local>com.zoo.TigerLocal</local>
          <ejb-class>com.zoo.TigerSession</ejb-class>
          <session-type>Stateless</session-type>
          <transaction-type>Container</transaction-type>

       </session>

And let's take a look at the content of the com\zoo directory where
these classes are supposed to be found:

TigerBean.class
TigerSession.class

Do you see the issue? Where are the other bean classes? The class in
question - the remote interface, com.zoo.Tiger - is not in any place
where Geronimo could find it, either in the jar itself or in the EJB
(GBean) dependencies.

I'm almost 100% sure that when you pack the whole bean correctly, the
Geronimo Deployer will do its job and deploy the bean.

Jacek

Reply | Threaded
Open this post in threaded view
|

Re: What am I doing wrong? EJB Deployment Errors

David Jencks
In reply to this post by Nicholas Irving
you need to include all the interfaces for the bean in the ejb jar, not
just the optional ejb client jar.  We actually ignore the client jar if
you specify it.

thanks
david jencks

On Jul 10, 2005, at 1:59 PM, Nicholas Irving wrote:

> Thanks for the rely,
> Now I am confused. I have the following in (META-INF/ejb-jar.xml)
>
> <ejb-client-jar>ZooBeansClient.jar</ejb-client-jar>
>
> Which is included in the EJB JAR file, which contains the Remote
> Interface
> etc. I take it somehow I need to get this reference into my
> (META-INF/openejb-jar.xml) file as well? The documents regarding this
> are a
> little vague.
>
> NIrving
>
> -----Original Message-----
> From: Jacek Laskowski [mailto:[hidden email]]
> Sent: 10 July 2005 21:12
> To: [hidden email]
> Subject: Re: What am I doing wrong? EJB Deployment Errors
>
> Nicholas Irving wrote:
>
>> I am getting the following error back
>>
>>   Server reports: Remote interface class not found: com.zoo.Tiger
>>
>> org.apache.geronimo.deployment.DeploymentException: Remote interface
>> class not found: com.zoo.Tiger
>
> Let's take a look at the relevant piece of the standard deployment
> descriptor (META-INF/ejb-jar.xml):
>
>        <session >
>           <description><![CDATA[A session bean named
> Tiger]]></description>
>           <display-name>Tiger</display-name>
>
>           <ejb-name>Tiger</ejb-name>
>
>           <home>com.zoo.TigerHome</home>
>           <remote>com.zoo.Tiger</remote>
>           <local-home>com.zoo.TigerLocalHome</local-home>
>           <local>com.zoo.TigerLocal</local>
>           <ejb-class>com.zoo.TigerSession</ejb-class>
>           <session-type>Stateless</session-type>
>           <transaction-type>Container</transaction-type>
>
>        </session>
>
> And let's take a look at the content of the com\zoo directory where
> these classes are supposed to be found:
>
> TigerBean.class
> TigerSession.class
>
> Do you see the issue? Where are the other bean classes? The class in
> question - the remote interface, com.zoo.Tiger - is not in any place
> where Geronimo could find it, either in the jar itself or in the EJB
> (GBean) dependencies.
>
> I'm almost 100% sure that when you pack the whole bean correctly, the
> Geronimo Deployer will do its job and deploy the bean.
>
> Jacek
>

Reply | Threaded
Open this post in threaded view
|

Re: What am I doing wrong? EJB Deployment Errors

Jacek Laskowski-5
David Jencks wrote:
> you need to include all the interfaces for the bean in the ejb jar, not
> just the optional ejb client jar.  We actually ignore the client jar if
> you specify it.

By the way, how should we treat the information? Should it influence the
bean's classpath? I see I'll have to read about it in the EJB spec.

> david jencks

Jacek

Reply | Threaded
Open this post in threaded view
|

Re: What am I doing wrong? EJB Deployment Errors

Nicholas Irving
Okay, it seems that there are two trains of thought on how to generate an EJB
jar file. The spec says this (Page 557 of EJB 2.1 Final Release)

"The EJB specification does not specify whether an ejb-jar file should include
by copy or by reference the classes that are in an ejb-client JAR file, but
they must be included either one way or the other. If the by-copy approach is
used, the producer simply includes all the class files in the ejb-client JAR
file also in the ejb-jar file. If the by-reference approach is used, the
ejb-jar file producer does not duplicate the content of the ejb-client JAR file
in the ejb-jar file, but instead uses a Manifest Class-Path entry in the
ejb-jar file to specify that the ejb-jar file depends on the ejb-client JAR at
runtime. The use of the Class-Path entries in the JAR files is explained in the
Java 2 Platform, Enterprise Edition specification"


It appears that Eclipse WTP (this generated the EJB Jar for me) is using the
by-reference approach and Geronimo is reliant on the by-copy approach. So who
is right? Either way it seems that both are correct, so surely Geronimo needs
to be able to support both methods?

Perhaps I will raise this with Eclipse WTP, as I believe this should be an
option there to generate code correct for the platform you are building
against, or perhaps the option is there and I am misunderstanding. There
appears to be a number of problems with their tutorials that has lead to this
problem arising.

Should I sending these problems to the developler list in future?


Quoting Jacek Laskowski <[hidden email]>:

> David Jencks wrote:
> > you need to include all the interfaces for the bean in the ejb jar, not
> > just the optional ejb client jar.  We actually ignore the client jar if
> > you specify it.
>
> By the way, how should we treat the information? Should it influence the
> bean's classpath? I see I'll have to read about it in the EJB spec.
>
> > david jencks
>
> Jacek
>
>




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Reply | Threaded
Open this post in threaded view
|

Re: What am I doing wrong? EJB Deployment Errors

David Jencks
Geronimo (at least theoretically) includes anything you have in the
manifest classpath... but IIUC this requires you to be deploying an ear
rather than a standalone ejb module.  Are you deploying an ear and does
the ejb jar include the correct manifest classpath entry for your
ejb-client jar?  If so, we probably have a bug.  Showing the ear
structure and the ejb jar manifest classpath would be helpful.

thanks
david jencks

On Jul 10, 2005, at 5:04 PM, [hidden email] wrote:

> Okay, it seems that there are two trains of thought on how to generate
> an EJB
> jar file. The spec says this (Page 557 of EJB 2.1 Final Release)
>
> "The EJB specification does not specify whether an ejb-jar file should
> include
> by copy or by reference the classes that are in an ejb-client JAR
> file, but
> they must be included either one way or the other. If the by-copy
> approach is
> used, the producer simply includes all the class files in the
> ejb-client JAR
> file also in the ejb-jar file. If the by-reference approach is used,
> the
> ejb-jar file producer does not duplicate the content of the ejb-client
> JAR file
> in the ejb-jar file, but instead uses a Manifest Class-Path entry in
> the
> ejb-jar file to specify that the ejb-jar file depends on the
> ejb-client JAR at
> runtime. The use of the Class-Path entries in the JAR files is
> explained in the
> Java 2 Platform, Enterprise Edition specification"
>
>
> It appears that Eclipse WTP (this generated the EJB Jar for me) is
> using the
> by-reference approach and Geronimo is reliant on the by-copy approach.
> So who
> is right? Either way it seems that both are correct, so surely
> Geronimo needs
> to be able to support both methods?

IIUC we think we do :-)
>
> Perhaps I will raise this with Eclipse WTP, as I believe this should
> be an
> option there to generate code correct for the platform you are building
> against, or perhaps the option is there and I am misunderstanding.
> There
> appears to be a number of problems with their tutorials that has lead
> to this
> problem arising.

I would think they would want to support both.
>
> Should I sending these problems to the developler list in future?
I think the user list is fine until we are sure we have a problem.

thanks!
david jencks

>
> Quoting Jacek Laskowski <[hidden email]>:
>
>> David Jencks wrote:
>>> you need to include all the interfaces for the bean in the ejb jar,
>>> not
>>> just the optional ejb client jar.  We actually ignore the client jar
>>> if
>>> you specify it.
>>
>> By the way, how should we treat the information? Should it influence
>> the
>> bean's classpath? I see I'll have to read about it in the EJB spec.
>>
>>> david jencks
>>
>> Jacek
>>
>>
>
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>