Re: EAR bundle dir classpath issue
What is the workaround? Where should we put the lib for the time being? THanks JFR fmeili wrote: > > Hi, > > I've try to build an EAR with the default lib/ bundle directory without > using the manifes Class-Path entry in all WAR's which references the jar > files in the lib/ directory. This EAR should be standard JEE5 compliant > and should be deployable without any change in Geronimo 2.1.2 and > GlassFish (latest Version). > > Now I found a difference in how to access the jar files located in the > EARs lib/ directory from within an WAR module. > > In Geronimo I have to use: > getClass().getClassLoader().getResourceAsStream("lib/sample.jar") > to get the jar file content. > > In GlassFish I have to use: > getClass().getClassLoader().getResourceAsStream("sample.jar") > notice - without the lib/ prefix. > > As far as I understand the JEE5 specification (section 8.2.1 Bundled > Libraries), all JAR-Files in the EARs lib/ directory should be available > in all (also WAR) Modules classloaders. So I think the lib/ prefix should > not be specified. > > I've tried to workaround this problem by specifying the lib directory in > the WAR manifest entry with the following entry: > ClassPath: lib/ > > But this results in an deployment error in Geronimo with the following > message: > > 15:20:13,170 ERROR [DirectoryHotDeployer] Unable to deploy: Manifest class > path > entries must end with the .jar extension (J2EE 1.4 Section 8.2): > module=../ > org.apache.geronimo.common.DeploymentException: Manifest class path > entries must > end with the .jar extension (J2EE 1.4 Section 8.2): module=../ > at > org.apache.geronimo.deployment.DeploymentContext.addManifestClassPath > (DeploymentContext.java:419) > ... > > I think this is definitely an error because the JEE5 specification section > 8.2.1 explicitely allows directories in manifest Class-Path entries. > > So it seems the workaround didn't work, too. > > Do I make something wrong? > > If not, do I have a chance to generate an generic EAR file (with the same > source code) with bundled lib/ directory usage from WAR modules, which is > deployable under Geronimo and GlassFish? > > Thanks, > Frank > > -- View this message in context: http://www.nabble.com/EAR-bundle-dir-classpath-issue-tp18982334s134p19276997.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: EAR bundle dir classpath issue
Hi David, thanks for your fast answer. I've tried to find other workarounds, without success (workarounds with different code path for different appservers would work). So I've opend two issues for both problems, like you suggested. Class-Path directory entry didn't work: https://issues.apache.org/jira/browse/GERONIMO-4250 Wrong path to load library via getResourceAsStream out of EARs lib/ dir: https://issues.apache.org/jira/browse/GERONIMO-4251 Because both problems seems to brake the JEE5 specification, I've choosed priority "major" for both. thanks, Frank -- View this message in context: http://www.nabble.com/EAR-bundle-dir-classpath-issue-tp18982334s134p18995197.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: EAR bundle dir classpath issue
I think you've identified two bugs. Could you please open jira issues for them? https://issues.apache.org/jira/browse/GERONIMO I don't immediately see a workaround other than defining the "lib" directory to be / and putting all the lib jars in the root of the ear. thanks david jencks On Aug 14, 2008, at 7:13 AM, fmeili wrote: Hi, I've try to build an EAR with the default lib/ bundle directory without using the manifes Class-Path entry in all WAR's which references the jar files in the lib/ directory. This EAR should be standard JEE5 compliant and should be deployable without any change in Geronimo 2.1.2 and GlassFish (latest Version). Now I found a difference in how to access the jar files located in the EARs lib/ directory from within an WAR module. In Geronimo I have to use: getClass().getClassLoader().getResourceAsStream("lib/sample.jar") to get the jar file content. In GlassFish I have to use: getClass().getClassLoader().getResourceAsStream("sample.jar") notice - without the lib/ prefix. As far as I understand the JEE5 specification (section 8.2.1 Bundled Libraries), all JAR-Files in the EARs lib/ directory should be available in all (also WAR) Modules classloaders. So I think the lib/ prefix should not be specified. I've tried to workaround this problem by specifying the lib directory in the WAR manifest entry with the following entry: ClassPath: lib/ But this results in an deployment error in Geronimo with the following message: 15:20:13,170 ERROR [DirectoryHotDeployer] Unable to deploy: Manifest class path entries must end with the .jar extension (J2EE 1.4 Section 8.2): module=../ org.apache.geronimo.common.DeploymentException: Manifest class path entries must end with the .jar extension (J2EE 1.4 Section 8.2): module=../ at org.apache.geronimo.deployment.DeploymentContext.addManifestClassPath (DeploymentContext.java:419) ... I think this is definitely an error because the JEE5 specification section 8.2.1 explicitely allows directories in manifest Class-Path entries. So it seems the workaround didn't work, too. Do I make something wrong? If not, do I have a chance to generate an generic EAR file (with the same source code) with bundled lib/ directory usage from WAR modules, which is deployable under Geronimo and GlassFish? Thanks, Frank -- View this message in context: http://www.nabble.com/EAR-bundle-dir-classpath-issue-tp18982334s134p18982334.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
EAR bundle dir classpath issue
Hi, I've try to build an EAR with the default lib/ bundle directory without using the manifes Class-Path entry in all WAR's which references the jar files in the lib/ directory. This EAR should be standard JEE5 compliant and should be deployable without any change in Geronimo 2.1.2 and GlassFish (latest Version). Now I found a difference in how to access the jar files located in the EARs lib/ directory from within an WAR module. In Geronimo I have to use: getClass().getClassLoader().getResourceAsStream("lib/sample.jar") to get the jar file content. In GlassFish I have to use: getClass().getClassLoader().getResourceAsStream("sample.jar") notice - without the lib/ prefix. As far as I understand the JEE5 specification (section 8.2.1 Bundled Libraries), all JAR-Files in the EARs lib/ directory should be available in all (also WAR) Modules classloaders. So I think the lib/ prefix should not be specified. I've tried to workaround this problem by specifying the lib directory in the WAR manifest entry with the following entry: ClassPath: lib/ But this results in an deployment error in Geronimo with the following message: 15:20:13,170 ERROR [DirectoryHotDeployer] Unable to deploy: Manifest class path entries must end with the .jar extension (J2EE 1.4 Section 8.2): module=../ org.apache.geronimo.common.DeploymentException: Manifest class path entries must end with the .jar extension (J2EE 1.4 Section 8.2): module=../ at org.apache.geronimo.deployment.DeploymentContext.addManifestClassPath (DeploymentContext.java:419) ... I think this is definitely an error because the JEE5 specification section 8.2.1 explicitely allows directories in manifest Class-Path entries. So it seems the workaround didn't work, too. Do I make something wrong? If not, do I have a chance to generate an generic EAR file (with the same source code) with bundled lib/ directory usage from WAR modules, which is deployable under Geronimo and GlassFish? Thanks, Frank -- View this message in context: http://www.nabble.com/EAR-bundle-dir-classpath-issue-tp18982334s134p18982334.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.