Re: EJB with Maven2
Hi, We already had this discussion quite a while ago. You need to specify the type since you could perfectly have an artifiact with the same group/artifact IDs and a different type. I agree things would be easier if maven would guess, but less safe as well. Hope it helpes, Stéphane On 11/24/05, Duane Homick [EMAIL PROTECTED] wrote: Thanks Henry and Alex for the help. Based on your suggestions, I was able to get this setup and running in JBoss with very few further complications. However, there was one complication that I had when defining my ear project. I setup a dependency on the ejb-jar project which in turn created a dependency on the jar utility project. However, the application.xml file did NOT contain any modules in it. It wasn't until I set the dependency/type to ejb for my dependency on the ejb-jar file that it was able to realize it needed to add an ejb-module to my application.xml. Is this a bug? I figured Maven would be able to determine the dependency type itself without needing me to specify the type explicitly. Other than that, it works like a charm. Thanks for the help! -Original Message- From: Henry Isidro [mailto:[EMAIL PROTECTED] Sent: November 23, 2005 10:15 PM To: Maven Users List Subject: Re: EJB with Maven2 Alexandre Poitras wrote: I think he also needs to add manifest entries so the ejb jar can loads class from the other jar. If you don't do that your A project won't be in your B project class path. Yup you're right there...I didn't mention it anymore since you already said something about it. Anyway, hope this clears things up. Regards, Henry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- .::You're welcome ::.
Re: EJB with Maven2
I had the same problem but it's quite easy to fix. What do you want is to add class-path entries in the manifest file of your ejb jar. Of course, Maven can do all of that for you. You just need to add this section to your B subproject pom file (I supposed the packaging specified for it is ejb) : project ... build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-ejb-plugin/artifactId configuration archive manifest addClasspathtrue/addClasspath /manifest /archive /configuration /plugin /plugins /build ... /project By the way, all those configuration options come from the jar plugin (wich ejb plugin extends). You can take a look at the following documentation for more details : http://maven.apache.org/guides/mini/guide-manifest.html It has fixed the problem in my case on Oracle oc4j but the way the classpath is contructed is standard so it should work without any problems on JBoss. Hope it's help. On 11/23/05, Duane Homick [EMAIL PROTECTED] wrote: I have a simple (hopefully) EJB question, but I couldnt find an answer on the website: I have a project that has two subprojects A B. Subproject A contains a message driven bean. Subproject B contains a utility library. Subproject A has a dependency on B since it uses that utility library. B has packaging of jar A has packaging of ejb How would I deploy this to an application server? If I do it now using the jboss:harddeploy of A, it will deploy the A-1.0.jar, but it will fail when running because B is not in the classpath (as expected). So, the question becomes 1) should B be packaged as part of A? 2) should B and A be packaged together in a third subproject called C that produces an ear? 3) some other option? Thanks Duane Homick Sandvine Incorporated - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alexandre Poitras Québec, Canada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: EJB with Maven2
Just wanted to add, that you need a subproject C to produce the ear file and include jars A and B. It is quite easy to setup. Look in the guides on the Maven site but don't be shy to ask if you need any help! On 11/23/05, Alexandre Poitras [EMAIL PROTECTED] wrote: I had the same problem but it's quite easy to fix. What do you want is to add class-path entries in the manifest file of your ejb jar. Of course, Maven can do all of that for you. You just need to add this section to your B subproject pom file (I supposed the packaging specified for it is ejb) : project ... build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-ejb-plugin/artifactId configuration archive manifest addClasspathtrue/addClasspath /manifest /archive /configuration /plugin /plugins /build ... /project By the way, all those configuration options come from the jar plugin (wich ejb plugin extends). You can take a look at the following documentation for more details : http://maven.apache.org/guides/mini/guide-manifest.html It has fixed the problem in my case on Oracle oc4j but the way the classpath is contructed is standard so it should work without any problems on JBoss. Hope it's help. On 11/23/05, Duane Homick [EMAIL PROTECTED] wrote: I have a simple (hopefully) EJB question, but I couldnt find an answer on the website: I have a project that has two subprojects A B. Subproject A contains a message driven bean. Subproject B contains a utility library. Subproject A has a dependency on B since it uses that utility library. B has packaging of jar A has packaging of ejb How would I deploy this to an application server? If I do it now using the jboss:harddeploy of A, it will deploy the A-1.0.jar, but it will fail when running because B is not in the classpath (as expected). So, the question becomes 1) should B be packaged as part of A? 2) should B and A be packaged together in a third subproject called C that produces an ear? 3) some other option? Thanks Duane Homick Sandvine Incorporated - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alexandre Poitras Québec, Canada -- Alexandre Poitras Québec, Canada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: EJB with Maven2
Alexandre Poitras wrote: Just wanted to add, that you need a subproject C to produce the ear file and include jars A and B. It is quite easy to setup. Look in the guides on the Maven site but don't be shy to ask if you need any help! On 11/23/05, Alexandre Poitras [EMAIL PROTECTED] wrote: I had the same problem but it's quite easy to fix. What do you want is to add class-path entries in the manifest file of your ejb jar. Of course, Maven can do all of that for you. You just need to add this section to your B subproject pom file (I supposed the packaging specified for it is ejb) : project ... build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-ejb-plugin/artifactId configuration archive manifest addClasspathtrue/addClasspath /manifest /archive /configuration /plugin /plugins /build ... /project By the way, all those configuration options come from the jar plugin (wich ejb plugin extends). You can take a look at the following documentation for more details : http://maven.apache.org/guides/mini/guide-manifest.html It has fixed the problem in my case on Oracle oc4j but the way the classpath is contructed is standard so it should work without any problems on JBoss. Hope it's help. On 11/23/05, Duane Homick [EMAIL PROTECTED] wrote: I have a simple (hopefully) EJB question, but I couldnt find an answer on the website: I have a project that has two subprojects A B. Subproject A contains a message driven bean. Subproject B contains a utility library. Subproject A has a dependency on B since it uses that utility library. B has packaging of jar A has packaging of ejb How would I deploy this to an application server? If I do it now using the jboss:harddeploy of A, it will deploy the A-1.0.jar, but it will fail when running because B is not in the classpath (as expected). So, the question becomes 1) should B be packaged as part of A? 2) should B and A be packaged together in a third subproject called C that produces an ear? 3) some other option? Thanks Duane Homick Sandvine Incorporated - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alexandre Poitras Québec, Canada -- Alexandre Poitras Québec, Canada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] You could package the jar inside the ejb-jar but creating an EAR file with both jars inside it is the way to do it. Deploy that EAR to your container and everything should be fine. Regards, Henry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: EJB with Maven2
I think he also needs to add manifest entries so the ejb jar can loads class from the other jar. If you don't do that your A project won't be in your B project class path. On 11/23/05, Henry Isidro [EMAIL PROTECTED] wrote: Alexandre Poitras wrote: Just wanted to add, that you need a subproject C to produce the ear file and include jars A and B. It is quite easy to setup. Look in the guides on the Maven site but don't be shy to ask if you need any help! On 11/23/05, Alexandre Poitras [EMAIL PROTECTED] wrote: I had the same problem but it's quite easy to fix. What do you want is to add class-path entries in the manifest file of your ejb jar. Of course, Maven can do all of that for you. You just need to add this section to your B subproject pom file (I supposed the packaging specified for it is ejb) : project ... build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-ejb-plugin/artifactId configuration archive manifest addClasspathtrue/addClasspath /manifest /archive /configuration /plugin /plugins /build ... /project By the way, all those configuration options come from the jar plugin (wich ejb plugin extends). You can take a look at the following documentation for more details : http://maven.apache.org/guides/mini/guide-manifest.html It has fixed the problem in my case on Oracle oc4j but the way the classpath is contructed is standard so it should work without any problems on JBoss. Hope it's help. On 11/23/05, Duane Homick [EMAIL PROTECTED] wrote: I have a simple (hopefully) EJB question, but I couldnt find an answer on the website: I have a project that has two subprojects A B. Subproject A contains a message driven bean. Subproject B contains a utility library. Subproject A has a dependency on B since it uses that utility library. B has packaging of jar A has packaging of ejb How would I deploy this to an application server? If I do it now using the jboss:harddeploy of A, it will deploy the A-1.0.jar, but it will fail when running because B is not in the classpath (as expected). So, the question becomes 1) should B be packaged as part of A? 2) should B and A be packaged together in a third subproject called C that produces an ear? 3) some other option? Thanks Duane Homick Sandvine Incorporated - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alexandre Poitras Québec, Canada -- Alexandre Poitras Québec, Canada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] You could package the jar inside the ejb-jar but creating an EAR file with both jars inside it is the way to do it. Deploy that EAR to your container and everything should be fine. Regards, Henry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alexandre Poitras Québec, Canada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: EJB with Maven2
Alexandre Poitras wrote: I think he also needs to add manifest entries so the ejb jar can loads class from the other jar. If you don't do that your A project won't be in your B project class path. Yup you're right there...I didn't mention it anymore since you already said something about it. Anyway, hope this clears things up. Regards, Henry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: EJB with Maven2
Thanks Henry and Alex for the help. Based on your suggestions, I was able to get this setup and running in JBoss with very few further complications. However, there was one complication that I had when defining my ear project. I setup a dependency on the ejb-jar project which in turn created a dependency on the jar utility project. However, the application.xml file did NOT contain any modules in it. It wasn't until I set the dependency/type to ejb for my dependency on the ejb-jar file that it was able to realize it needed to add an ejb-module to my application.xml. Is this a bug? I figured Maven would be able to determine the dependency type itself without needing me to specify the type explicitly. Other than that, it works like a charm. Thanks for the help! -Original Message- From: Henry Isidro [mailto:[EMAIL PROTECTED] Sent: November 23, 2005 10:15 PM To: Maven Users List Subject: Re: EJB with Maven2 Alexandre Poitras wrote: I think he also needs to add manifest entries so the ejb jar can loads class from the other jar. If you don't do that your A project won't be in your B project class path. Yup you're right there...I didn't mention it anymore since you already said something about it. Anyway, hope this clears things up. Regards, Henry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: EJB with Maven2
Duane Homick wrote: Thanks Henry and Alex for the help. Based on your suggestions, I was able to get this setup and running in JBoss with very few further complications. However, there was one complication that I had when defining my ear project. I setup a dependency on the ejb-jar project which in turn created a dependency on the jar utility project. However, the application.xml file did NOT contain any modules in it. It wasn't until I set the dependency/type to ejb for my dependency on the ejb-jar file that it was able to realize it needed to add an ejb-module to my application.xml. Is this a bug? I figured Maven would be able to determine the dependency type itself without needing me to specify the type explicitly. Other than that, it works like a charm. Thanks for the help! -Original Message- From: Henry Isidro [mailto:[EMAIL PROTECTED] Sent: November 23, 2005 10:15 PM To: Maven Users List Subject: Re: EJB with Maven2 Alexandre Poitras wrote: I think he also needs to add manifest entries so the ejb jar can loads class from the other jar. If you don't do that your A project won't be in your B project class path. Yup you're right there...I didn't mention it anymore since you already said something about it. Anyway, hope this clears things up. Regards, Henry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] No porblem :-) Not sure about the dependency/type thingy though...I always specify the 'ejb' type :-) maybe brett or one of the devs can shed some light on this Regards, Henry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]