You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Monty King <mo...@gmail.com> on 2008/02/28 19:10:30 UTC
problem with deploying a mdb (within ear)
Hi,
I'm new to JEE world so please forgive all the rookie mistakes en route to
enlightenment. Firstly I completed the 5-minute tutorial. Now I'm trying to
create a MDB (EJB 3 style). I'm following the 5-min-example deployment style
(create EAR project and include EJB project in it).
Now I'm stuck with an exception that I can't understand. Here's what I have
done so far (within EJB project):
* From EJB project, I deleted the openejb-jar.xml (as per 5-min-example).
* Created a MDB called ChatRoomMDB, here's the contents:
package sample;
import javax.annotation.Resource;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.ejb.MessageDrivenContext;
import javax.jms.Message;
import javax.jms.MessageListener;
@MessageDriven (activationConfig =
{
@ActivationConfigProperty(propertyName="destinationType", propertyValue="
javax.jms.Queue"),
@ActivationConfigProperty(propertyName="destination",
propertyValue="SendReceiveQueue")
})
public class ChatRoomMDB implements MessageListener {
private static final long serialVersionUID = 1L;
@Resource
private MessageDrivenContext mdc;
@Override
public void onMessage(Message msg) {
System.out.println("Rcv: " + msg);
}
}
When I try to deploy it in app server (Geronimo 2.1 server integrated into
Eclipse with Geronimo v2.0 Server Adapter 2.0.0) I get the following:
19:01:34,703 ERROR [GBeanInstanceState] Error while starting; GBean is now
in the *FAILED* state:
abstractName="JMSSample/JMSSample-EAR/1.0/ear?J2EEApplication=JMSSample/JMSSample-EAR/1.0/ear,j2eeType=EJBModule,name=
JMSSampleEJB.jar"
*******
org.apache.openejb.OpenEJBException*: createApplication.failed [C:\Documents
and Settings\Monty\Local Settings\Temp\geronimo-deploymentUtil2807.jar]:
Error building bean 'ChatRoomMDB'. Exception: class *
java.lang.NullPointerException*: null: null
at org.apache.openejb.assembler.classic.Assembler.createApplication(*
Assembler.java:588*)
at org.apache.openejb.assembler.classic.Assembler.createEjbJar(*
Assembler.java:371*)
at org.*apache*.geronimo.openejb.OpenEjbSystemGBean.createEjbJar(*
OpenEjbSystemGBean.java:390*)
at org.apache.geronimo.openejb.EjbModuleImpl.start(*EjbModuleImpl.java:123*)
at org.apache.geronimo.openejb.EjbModuleImplGBean.doStart(*
EjbModuleImplGBean.java:39*)
at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(*
GBeanInstance.java:998*)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(*
GBeanInstanceState.java:268*)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(*
GBeanInstanceState.java:102*)
at org.apache.geronimo.gbean.runtime.GBeanInstance.start(*GBeanInstance.java
:541*)
at org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(*
GBeanDependency.java:111*)
at org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(*
GBeanDependency.java:146*)
at org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(*
GBeanDependency.java:120*)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(*
BasicLifecycleMonitor.java:176*)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(*
BasicLifecycleMonitor.java:44*)
at
org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent
(*BasicLifecycleMonitor.java:254*)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(*
GBeanInstanceState.java:294*)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(*
GBeanInstanceState.java:102*)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(*
GBeanInstanceState.java:124*)
at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(*
GBeanInstance.java:555*)
at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(*
BasicKernel.java:379*)
at
org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans
(*ConfigurationUtil.java:456*)
at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(*
KernelConfigurationManager.java:187*)
at
org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration
(*SimpleConfigurationManager.java:534*)
at org.*apache*
.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(*
SimpleConfigurationManager.java:515*)
at sun.reflect.NativeMethodAccessorImpl.invoke0(*Native Method*)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(*
ReflectionMethodInvoker.java:34*)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(*
GBeanOperation.java:124*)
at org.*apache*.geronimo.gbean.runtime.GBeanInstance.invoke(*
GBeanInstance.java:867*)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(*BasicKernel.java:239
*)
at org.apache.geronimo.kernel.KernelGBean.invoke(*KernelGBean.java:342*)
at sun.reflect.GeneratedMethodAccessor163.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(*
ReflectionMethodInvoker.java:34*)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(*
GBeanOperation.java:124*)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(*
GBeanInstance.java:867*)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(*BasicKernel.java:239
*)
at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(*
MBeanGBeanBridge.java:172*)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown
Source)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(Unknown
Source)
at java.security.AccessController.doPrivileged(*Native Method*)
at javax.management.remote.rmi.RMIConnectionImpl.*doPrivilegedOperation*(Unknown
Source)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(Unknown Source)
at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.*lang*.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(*Native Method*)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.*rmi*.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: *org.apache.openejb.OpenEJBException*: Error building bean
'ChatRoomMDB'. Exception: class *java.lang.NullPointerException*: null: null
at org.apache.openejb.assembler.classic.EjbJarBuilder.build(*
EjbJarBuilder.java:64*)
at org.apache.openejb.assembler.classic.Assembler.createApplication(*
Assembler.java:491*)
... 61 *more*
Caused by: *java.lang.NullPointerException
*
at java.util.Hashtable.get(Unknown *Source*)
at org.apache.openejb.assembler.classic.EjbJarBuilder.build(*
EjbJarBuilder.java:59*)
... 62 more
19:01:34,703 ERROR [EjbModuleImpl] Module does not exist.
What am I doing wrong?
**TIA,*
*Monty
Re: problem with deploying a mdb (within ear)
Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On Thu, Feb 28, 2008 at 2:28 PM, montyk <mo...@gmail.com> wrote:
> In the "5-min enterprise application development" tutorial at
> http://cwiki.apache.org/GMOxSAMPLES/5-minute-tutorial-on-enterprise-application-development-with-eclipse-and-geronimo.html
>
> there's a small section that states: "Remove
> ejbModule/META-INF/openejb-jar.xml file in the SampleEJB project as it
> causes deployment issues."
>
> Can someone point me towards an explanation why it was possible to deploy
> the EJB in tutorial successfully but - not when attempting to create a MDB?
Hi,
Let me try it out. It's due to incompatibility between the versions of
openejb-jar.xml created by GEP (Geronimo Eclipse Plugin) and the one
expected by Geronimo 2.1. That's the only reason.
You have to map your logical resources used by MDB to the runtime
resources via openejb-jar.xml *or* geronimo deployment plan (the name
can be anything you want if deployed with deploy or web console and
specified as the second parameter or it's geronimo-application.xml if
it's in META-INF or the EAR). I keep promising myself to publish a
Polish article of mine about Geronimo and MDB (Uruchomienie ziarna MDB
w Apache Geronimo [1]) as I see people missing more 5-minute articles
like 5-minute Tutorial on Enterprise Application Development with
Eclipse and Geronimo [2]. Until it happens have a look at some
examples of these xml descriptors the Polish article of mine [1], esp.
the section Deskryptor_aplikacji_EAR_-_geronimo-application.xml [3].
The article is in Polish, but the XMLs are English-friendly ;-)
[1] http://www.jaceklaskowski.pl/wiki/Uruchomienie_ziarna_MDB_w_Apache_Geronimo
[2] http://cwiki.apache.org/GMOxDOC21/5-minute-tutorial-on-enterprise-application-development-with-eclipse-and-geronimo.html
[3] http://www.jaceklaskowski.pl/wiki/Uruchomienie_ziarna_MDB_w_Apache_Geronimo#Deskryptor_aplikacji_EAR_-_geronimo-application.xml
Jacek
--
Jacek Laskowski
http://www.JacekLaskowski.pl
Re: problem with deploying a mdb (within ear)
Posted by montyk <mo...@gmail.com>.
Thanks, I'll try the sample. I came across it earlier also but I thought
OpenEJB is an alternative/optional method of deployment. And I thought that
I'll try to stick to JEE standards, should there be a need to exchange app
srv.
In the "5-min enterprise application development" tutorial at
http://cwiki.apache.org/GMOxSAMPLES/5-minute-tutorial-on-enterprise-application-development-with-eclipse-and-geronimo.html
there's a small section that states: "Remove
ejbModule/META-INF/openejb-jar.xml file in the SampleEJB project as it
causes deployment issues."
Can someone point me towards an explanation why it was possible to deploy
the EJB in tutorial successfully but - not when attempting to create a MDB?
--
View this message in context: http://www.nabble.com/problem-with-deploying-a-mdb-%28within-ear%29-tp15743012s134p15747595.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: problem with deploying a mdb (within ear)
Posted by Viet Nguyen <vh...@gmail.com>.
Hi,
I'm not sure why you deleted the openejb-jar.xml. But I might have
misunderstood. You need to have an openejb-jar.xml deployment
descriptor to in order to surface the MDB. Have a look at this
Geronimo 2.0 sample
http://cwiki.apache.org/GMOxDOC20/jms-and-mdb-sample-application.html
I think it will help you.
--Viet
On Thu, Feb 28, 2008 at 1:10 PM, Monty King <mo...@gmail.com> wrote:
> Hi,
>
> I'm new to JEE world so please forgive all the rookie mistakes en route to
> enlightenment. Firstly I completed the 5-minute tutorial. Now I'm trying to
> create a MDB (EJB 3 style). I'm following the 5-min-example deployment style
> (create EAR project and include EJB project in it).
>
> Now I'm stuck with an exception that I can't understand. Here's what I have
> done so far (within EJB project):
> * From EJB project, I deleted the openejb-jar.xml (as per 5-min-example).
> * Created a MDB called ChatRoomMDB, here's the contents:
>
>
> package sample;
>
> import javax.annotation.Resource;
> import javax.ejb.ActivationConfigProperty;
> import javax.ejb.MessageDriven;
> import javax.ejb.MessageDrivenContext;
> import javax.jms.Message;
> import javax.jms.MessageListener;
>
> @MessageDriven (activationConfig =
> {
> @ActivationConfigProperty(propertyName="destinationType",
> propertyValue="javax.jms.Queue"),
> @ActivationConfigProperty(propertyName="destination",
> propertyValue="SendReceiveQueue")
> })
> public class ChatRoomMDB implements MessageListener {
>
> private static final long serialVersionUID = 1L;
>
> @Resource
> private MessageDrivenContext mdc;
>
> @Override
> public void onMessage(Message msg) {
> System.out.println("Rcv: " + msg);
> }
>
> }
>
>
> When I try to deploy it in app server (Geronimo 2.1 server integrated into
> Eclipse with Geronimo v2.0 Server Adapter 2.0.0) I get the following:
>
> 19:01:34,703 ERROR [GBeanInstanceState] Error while starting; GBean is now
> in the FAILED state:
> abstractName="JMSSample/JMSSample-EAR/1.0/ear?J2EEApplication=JMSSample/JMSSample-EAR/1.0/ear,j2eeType=EJBModule,name=JMSSampleEJB.jar"
>
>
>
> org.apache.openejb.OpenEJBException: createApplication.failed [C:\Documents
> and Settings\Monty\Local Settings\Temp\geronimo-deploymentUtil2807.jar]:
> Error building bean 'ChatRoomMDB'. Exception: class
> java.lang.NullPointerException: null: null
>
> at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:588)
>
> at
> org.apache.openejb.assembler.classic.Assembler.createEjbJar(Assembler.java:371)
>
> at
> org.apache.geronimo.openejb.OpenEjbSystemGBean.createEjbJar(OpenEjbSystemGBean.java:390)
>
> at org.apache.geronimo.openejb.EjbModuleImpl.start(EjbModuleImpl.java:123)
>
> at
> org.apache.geronimo.openejb.EjbModuleImplGBean.doStart(EjbModuleImplGBean.java:39)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:998)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:268)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:541)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:111)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:146)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:120)
>
> at
> org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:176)
>
> at
> org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:44)
>
> at
> org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:254)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:294)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:124)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:555)
>
> at
> org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:379)
>
> at
> org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:456)
>
> at
> org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:187)
>
> at
> org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:534)
>
> at
> org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:515)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>
> at java.lang.reflect.Method.invoke(Unknown Source)
>
> at
> org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
>
> at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
>
> at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:342)
>
> at sun.reflect.GeneratedMethodAccessor163.invoke(Unknown Source)
>
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>
> at java.lang.reflect.Method.invoke(Unknown Source)
>
> at
> org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
>
> at
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
>
> at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
>
> at
> org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:172)
>
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown
> Source)
>
> at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
>
> at javax.management.remote.rmi.RMIConnectionImpl.doOperation(Unknown Source)
>
> at javax.management.remote.rmi.RMIConnectionImpl.access$200(Unknown Source)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(Unknown
> Source)
>
> at java.security.AccessController.doPrivileged(Native Method)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(Unknown
> Source)
>
> at javax.management.remote.rmi.RMIConnectionImpl.invoke(Unknown Source)
>
> at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source)
>
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>
> at java.lang.reflect.Method.invoke(Unknown Source)
>
> at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
>
> at sun.rmi.transport.Transport$1.run(Unknown Source)
>
> at java.security.AccessController.doPrivileged(Native Method)
>
> at sun.rmi.transport.Transport.serviceCall(Unknown Source)
>
> at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
>
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
>
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
>
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
>
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>
> at java.lang.Thread.run(Unknown Source)
>
> Caused by: org.apache.openejb.OpenEJBException: Error building bean
> 'ChatRoomMDB'. Exception: class java.lang.NullPointerException: null: null
>
> at
> org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:64)
>
> at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:491)
>
> ... 61 more
>
> Caused by: java.lang.NullPointerException
>
>
>
> at java.util.Hashtable.get(Unknown Source)
>
> at
> org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:59)
>
> ... 62 more
>
> 19:01:34,703 ERROR [EjbModuleImpl] Module does not exist.
>
> What am I doing wrong?
>
> TIA,
> Monty