|
View:
New views
12 Messages
—
Rating Filter:
Alert me
|
|
|
Trying to set up a MDBHello again!
I'm trying to use JMS and MDB. I used those tutorials: http://cwiki.apache.org/GMOxDOC21/jms-mdb-jms-and-mdb-sample-application.html and http://cwiki.apache.org/GMOxDOC21/jms-application-with-message-driven-bean.html With the first one I always had an error because it find the geronimo-activemq-ra-2.1.4.rar file. It was strange because it is inside Geronimo. But I tried to make some changes using the second tutorial. Now I get this error: Deployment failed: org.apache.openejb.OpenEJBException: Cannot unmarshall the ejb-jar.xml file: jar:file:/C:/SERVIDORES/geronimo-tomcat6-javaee5-2.1.4/var/temp/geronimo-deploymentUtil8910761794523173248.jar!/META-INF/ejb-jar.xml: unexpected element (uri:"http://java.sun.com/xml/ns/javaee", local:"openejb-jar"). Expected elements are <{http://java.sun.com/xml/ns/javaee}destination-type>,<{http://java.sun.com/xml/ns/javaee}ejb-jar>,<{http://java.sun.com/xml/ns/javaee}handler-chains>,<{http://java.sun.com/xml/ns/javaee}message-driven-destination>,<{http://java.sun.com/xml/ns/javaee}subscription-durability> Any help? By the way, should my ejb-jar.xml have a "openejb-jar" tag, or a "ejb-jar", or what? And the last thing. Where should my "jms-resources.xml" file be? Is it necessary? Thank you very much. Antonio |
|
|
Re: Trying to set up a MDBfor your MDB you should have an openejb-jar.xml an therefore openejb-jar tags see
<enterprise-beans> <message-driven> <ejb-name>OrderRecvMDB</ejb-name> <resource-adapter> <resource-link>jms-resources</resource-link> </resource-adapter> </message-driven> </enterprise-beans> </openejb-jar> The jms-resources.xml should be in your EAR-file A running example you can found under IBM wasce_samples-2.1.1.2\applications\jms-mdb Important is the Geronimo specific deployment plan geronimo-application.xml in which you declare the dependen modules <application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"> <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"> <moduleId> <groupId>${pom.groupId}</groupId> <artifactId>${pom.artifactId}</artifactId> <version>${version}</version> <type>car</type> </moduleId> </environment> <module> <connector>geronimo-activemq-ra-${geronimoVersion}.rar</connector> <alt-dd>jms-resources.xml</alt-dd> </module> </application>
|
|
|
Re: Trying to set up a MDBThank you very much!
I'm having this error now: Invalid moduleFile: geronimo-activemq-ra-2.1.4.rar org.apache.geronimo.common.DeploymentException: Invalid moduleFile: geronimo-activemq-ra-2.1.4.rar at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.addModules(EARConfigBuilder.java:783) at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.getEarPlan(EARConfigBuilder.java:402) at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.getDeploymentPlan(EARConfigBuilder.java:295) at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:227) at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:134) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116) at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61) at java.lang.Thread.run(Thread.java:619) Caused by: java.io.IOException: Jar entry does not exist: jarFile=C:\SERVIDORES\geronimo-tomcat6-javaee5-2.1.4\var\temp\geronimo-deployer142431723576948754.tmpdir\car_ear.ear, path=geronimo-activemq-ra-2.1.4.rar at org.apache.geronimo.deployment.util.NestedJarFile.<init>(NestedJarFile.java:51) at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.addModules(EARConfigBuilder.java:781) ... 15 more What should I do to make geronimo find it? |
|
|
Re: Trying to set up a MDBWhat is the structure of your ear file and what is your application.xml?
I'd guess that your application.xml lists geronimo-activemq-ra. 2.1.4.rar as a module but you have not included it in your ear. thanks david jencks On Oct 31, 2009, at 3:19 AM, Antonio Fornié wrote: > > Thank you very much! > > I'm having this error now: > Invalid moduleFile: geronimo-activemq-ra-2.1.4.rar > org.apache.geronimo.common.DeploymentException: Invalid moduleFile: > geronimo-activemq-ra-2.1.4.rar > at > org > .apache > .geronimo > .j2ee.deployment.EARConfigBuilder.addModules(EARConfigBuilder.java: > 783) > at > org > .apache > .geronimo > .j2ee.deployment.EARConfigBuilder.getEarPlan(EARConfigBuilder.java: > 402) > at > org > .apache > .geronimo > .j2ee > .deployment.EARConfigBuilder.getDeploymentPlan(EARConfigBuilder.java: > 295) > at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:227) > at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:134) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun > .reflect > .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun > .reflect > .DelegatingMethodAccessorImpl > .invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > 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 > .deployment > .plugin > .local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116) > at > org > .apache > .geronimo > .deployment > .plugin.local.DistributeCommand.run(DistributeCommand.java:61) > at java.lang.Thread.run(Thread.java:619) > Caused by: java.io.IOException: Jar entry does not exist: > jarFile=C:\SERVIDORES\geronimo-tomcat6-javaee5-2.1.4\var\temp > \geronimo-deployer142431723576948754.tmpdir\car_ear.ear, > path=geronimo-activemq-ra-2.1.4.rar > at > org > .apache > .geronimo.deployment.util.NestedJarFile.<init>(NestedJarFile.java:51) > at > org > .apache > .geronimo > .j2ee.deployment.EARConfigBuilder.addModules(EARConfigBuilder.java: > 781) > ... 15 more > > > What should I do to make geronimo find it? > -- > View this message in context: http://old.nabble.com/Trying-to-set-up-a-MDB-tp26137988s134p26141178.html > Sent from the Apache Geronimo - Users mailing list archive at > Nabble.com. > |
|
|
Re: Trying to set up a MDBHello!
My ear structure: root/car_web.war root/car_ejb.jar root/geronimo-activemq-ra-2.1.4.rar root/META-INF/MANIFEST.MF root/META-INF/application.xml root/META-INF/jms-resources.xml My application.xml is this: ------------------------------------------------------------ <?xml version="1.0" encoding="UTF-8"?> <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" id="Application_ID" version="5"> <description>My MDB APP</description> <display-name>car_ear</display-name> <module> <web> <web-uri>car_web.war</web-uri> <context-root>car_web</context-root> </web> </module> <module> <ejb>car_ejb.jar</ejb> </module> <module> <connector>geronimo-activemq-ra-2.1.4.rar</connector> </module> </application> ------------------------------------------------------------ My ejb-jar.xml is this: ------------------------------------------------------------ <?xml version="1.0" encoding="UTF-8"?> <ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"> <display-name>car_ejb </display-name> </ejb-jar> ------------------------------------------------------------ My open-ejb-jar.xml is this: ------------------------------------------------------------ <openejb-jar xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2"> <enterprise-beans> <message-driven> <ejb-name>OrderRecvMDB</ejb-name> <resource-adapter> <resource-link>jms-resources</resource-link> </resource-adapter> </message-driven> </enterprise-beans> </openejb-jar> ------------------------------------------------------------ My jms-resources is this: ------------------------------------------------------------ <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"> <resourceadapter> <resourceadapter-instance> <resourceadapter-name>jms-resources</resourceadapter-name> <nam:workmanager xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2"> <nam:gbean-link>DefaultWorkManager</nam:gbean-link> </nam:workmanager> </resourceadapter-instance> <outbound-resourceadapter> <connection-definition> <connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface> <connectiondefinition-instance> <name>CommonConnectionFactory</name> <implemented-interface>javax.jms.QueueConnectionFactory</implemented-interface> <implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface> <connectionmanager> <xa-transaction> <transaction-caching/> </xa-transaction> <single-pool> <match-one/> </single-pool> </connectionmanager> </connectiondefinition-instance> </connection-definition> </outbound-resourceadapter> </resourceadapter> <adminobject> <adminobject-interface>javax.jms.Queue</adminobject-interface> <adminobject-class>org.apache.activemq.command.ActiveMQQueue</adminobject-class> <adminobject-instance> <message-destination-name>OrderQueue</message-destination-name> <config-property-setting name="PhysicalName">OrderQueue</config-property-setting> </adminobject-instance> </adminobject> </connector> ------------------------------------------------------------ After including the rar in the ear like you told I got this error message: Deployment failed: A connector module must be deployed using a Geronimo deployment plan (either META-INF/geronimo-ra.xml in the RAR file or a standalone deployment plan passed to the deployer). Any help?? Thank you very much!! |
|
|
Re: Trying to set up a MDBAny help? If nobody can help for my specific problem, at least can anybody help me setting up this basic sample (I think it's the easier one in the docs):
http://cwiki.apache.org/GMOxDOC21/jms-mdb-jms-and-mdb-sample-application.html Did anybody get it running only following the tutorial? Isn't there anything missing? I tried to follow the tutorial setp by step several times but it was never working. Otherwise, can anybody recommend me another tutorial or another way to have JMS and an MDB running easier than this one? Thank you very much! Antonio |
|
|
Re: Trying to set up a MDBHi, two issues I noticed in your application:
1) you need to use geronimo-applicaiton.xml for your ear to be deployed on Geronimo successfully, which shall be put in the same directory with application-xml 2) jms resource should have a module name in the form of groupId/artifactId/version/type The plans for your reference: geronimo-application.xml <?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"> <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"> <moduleId> <groupId>org.apache.geronimo.samples</groupId> <artifactId>jms-mdb-ear</artifactId> <version>2.1.4</version> <type>car</type> </moduleId> </environment> <module> <connector>geronimo-activemq-ra-2.1.4.rar</connector> <alt-dd>jms-resources.xml</alt-dd> </module> </application> jms-resources.xml (this file should be placed under root instead of /root/META-INF) <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"> <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"> <dep:moduleId> <dep:groupId>org.apache.geronimo.samples</dep:groupId> <dep:artifactId>jms-resources</dep:artifactId> <dep:version>2.1.4</dep:version> <dep:type>rar</dep:type> </dep:moduleId> <dep:dependencies> <dep:dependency> <dep:groupId>org.apache.geronimo.configs</dep:groupId> <dep:artifactId>activemq-broker</dep:artifactId> <dep:type>car</dep:type> </dep:dependency> </dep:dependencies> </dep:environment> <resourceadapter> <resourceadapter-instance> <resourceadapter-name>jms-resources</resourceadapter-name> <nam:workmanager xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2"> <nam:gbean-link>DefaultWorkManager</nam:gbean-link> </nam:workmanager> </resourceadapter-instance> <outbound-resourceadapter> <connection-definition> <connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface> <connectiondefinition-instance> <name>OrderConnectionFactory</name> <implemented-interface>javax.jms.QueueConnectionFactory</implemented-interface> <implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface> <connectionmanager> <xa-transaction> <transaction-caching/> </xa-transaction> <single-pool> <match-one/> </single-pool> </connectionmanager> </connectiondefinition-instance> </connection-definition> </outbound-resourceadapter> </resourceadapter> <adminobject> <adminobject-interface>javax.jms.Queue</adminobject-interface> <adminobject-class>org.apache.activemq.command.ActiveMQQueue</adminobject-class> <adminobject-instance> <message-destination-name>OrderQueue</message-destination-name> <config-property-setting name="PhysicalName">OrderQueue</config-property-setting> </adminobject-instance> </adminobject> <adminobject> <adminobject-interface>javax.jms.Topic</adminobject-interface> <adminobject-class>org.apache.activemq.command.ActiveMQTopic</adminobject-class> </adminobject> </connector> Furthermore, you may check out this URL to find out the exact plans for jms-mdb sample application. https://svn.apache.org/repos/asf/geronimo/samples/branches/2.1/samples/jms-mdb/ Any questions, please let us know. Jeff C On Mon, Nov 2, 2009 at 8:18 PM, Antonio Fornié <sitaronocturnal@...> wrote:
|
|
|
Re: Trying to set up a MDBI've tested the WebSphere Community Edition Sample Applications downloaded from
http://www.ibm.com/developerworks/downloads/ws/wasce/?S_TACT=105AGX01&S_CMP=LP and works with Geronimo 2.1.4 |
|
|
Re: Trying to set up a MDBThank you very much. I'll try with those samples I've just downloaded.
And about the samples from geronimo docs, I've just downloaded the file "jms-mdb-ear-2.1.2.ear" from maven repository and try to deploy it from the console... I had the same problem!! Deployment failed: A connector module must be deployed using a Geronimo deployment plan (either META-INF/geronimo-ra.xml in the RAR file or a standalone deployment plan passed to the deployer). How can it be the sample in the doc is not working? That's what I meant when I said Geronimo was a "little" hard at the beginning... Thank you! |
|
|
Re: Trying to set up a MDBThank you very much. I'll try with those samples I've just downloaded.
And about the samples from geronimo docs, I've just downloaded the file "jms-mdb-ear-2.1.2.ear" from maven repository and try to deploy it from the console... I had the same problem!! Deployment failed: A connector module must be deployed using a Geronimo deployment plan (either META-INF/geronimo-ra.xml in the RAR file or a standalone deployment plan passed to the deployer). How can it be the sample in the doc is not working? That's what I meant when I said Geronimo was a "little" hard at the beginning... Thank you! |
|
|
Re: Trying to set up a MDBThank you very much. I'll try with those samples I've just downloaded.
And about the samples from geronimo docs, I've just downloaded the file "jms-mdb-ear-2.1.2.ear" from maven repository and try to deploy it from the console... I had the same problem!! Deployment failed: A connector module must be deployed using a Geronimo deployment plan (either META-INF/geronimo-ra.xml in the RAR file or a standalone deployment plan passed to the deployer). How can it be the sample in the doc is not working? That's what I meant when I said Geronimo was a "little" hard at the beginning... Thank you! |
|
|
Re: Trying to set up a MDBHi Antonio,
I looked the G doc and downloaded the file "jms-mdb-ear-2.1.2.ear" from maven repository as you did, and got the same problem as you. However, I have found the solution and made the sample work. First, the structure of the file "jms-mdb-ear-2.1.2.ear" that worked for me is as below: |-jms-mdb-ear-{version}.ear |- META-INF |- application.xml |- geronimo-application.xml |- geronimo-activemq-ra-{geronimoVersion}.rar |- activemq-core-{version}.jar |- activemq-ra-{version}.jar |- META -INF |- ra.xml |- jms-mdb-ejb-{version}.jar |- classes |- META -INF |- openejb-jar.xml |- jms-mdb-war-{version}.war |- index.jsp |- error.jsp |- WEB-INF |- web.xml |- classes |- jms-resources.xml All the .xml files mentioned above are needed. For the correct contents of "geronimo-application.xml", "openejb-jar.xml", "web.xml", and "jms-resources.xml", please download the sample applications from http://www.ibm.com/developerworks/downloads/ws/wasce/?S_TACT=105AGX01&S_CMP=LP and refer to the corresponding .xml files in the "jms-mdb" sample application. I added the .xml files in the sample application directly to my "jms-mdb-ear-2.1.2.ear" file and it worked for me. When you compress all the files with the correct contents in the struture mention above, it should work for you. If there is still problems, please let us know. About the Geronimo document of the jms-mdb sample, we will revise it accordingly. Thank you! Ellen 2009/11/3 Antonio Fornié <sitaronocturnal@...>
|
| Free embeddable forum powered by Nabble | Forum Help |