-
1. Re: cannot load classes located in WEB-INF/lib
jbosshog98 Jun 11, 2009 5:09 AM (in response to jbosshog98)I thought I'd add... I'd like to be able to specify in jboss-service.xml in the server/default/conf folder to look in an additional folder in each WEB-INF for libs if it existed.
So to be able to add some way to reference WEB-INF/lib/extra in the same way as:
So something like:
Of course, this looks in the server lib, not the WAR lib. So, what kind of modification could I make here to tell JBoss to load JARs from the WEB-INF/lib/extra (or WEB-INF/extra/lib1) folder in each WAR during startup?
Or is there a better way to do this?
My main issue is that I need the JARs available at startup, but also need them available at runtime, but not located in the lib folder of the EAR, but per WAR. If I put them in WEB-INF/lib they do load at startup, but cannot be accessed at runtime as they can when loaded in the EAR/lib
Thanks! -
2. Re: cannot load classes located in WEB-INF/lib
jbosshog98 Jun 11, 2009 5:11 AM (in response to jbosshog98)Oops, code didn't show up.
to be able to add some way to reference WEB-INF/lib/extra in the same way as:<classpath codebase="${jboss.server.lib.url:lib}" archives="*"/>
So something like:<classpath codebase="${jboss.server.lib.url:lib}/extra" archives="*"/>
Of course, this looks in the server lib, not the WAR lib. So, what kind of modification could I make here to tell JBoss to load JARs from the WEB-INF/lib/extra (or WEB-INF/extra/lib1) folder in each WAR during startup? -
3. Re: cannot load classes located in WEB-INF/lib
jbosshog98 Jun 11, 2009 5:40 AM (in response to jbosshog98)I should also add that when I use just a WAR for deployment, without it being inside an EAR, this works just fine and the library loads as needed at runtime from WEB-INF/lib, so this is only an issue when putting the WAR inside and EAR.
-
4. Re: cannot load classes located in WEB-INF/lib
jbosshog98 Jun 11, 2009 6:24 AM (in response to jbosshog98)I should add that I tried the code below with my JARs in WEB-INF/lib
and am receiving the error below. With the JARs in the EAR file I
don't have to do the updateJar, I can just use the code as is without
the two tags and it works. I'm not sure if this is a
dependency thing or what, I'm a little baffled. I just need to get
ahold of the Spring application context from within Railo, which I can
do with the JAR in the EAR/lib but not this way.<cfadmin action="updateJar" type="web" password="testtest" jar="/work/jboss/jboss-4.2.3.GA/server/default/deploy/ railo.ear/railo1.war/WEB-INF/lib/spring.jar"> <cfset var utils = createObject("java", "org.springframework.web.context.support.WebApplicationContextUtils", "/work/jboss/jboss-4.2.3.GA/server/default/deploy/railo.ear/railo1.war/ WEB-INF/lib/spring.jar") /> <cfset var context = getPageContext().getServletContext() /> <cfset variables.applicationContext = utils.getWebApplicationContext (context)> <cfadmin action="removeJar" type="web" password="testtest" jar="/work/jboss/jboss-4.2.3.GA/server/default/deploy/ railo.ear/railo1.war/WEB-INF/lib/spring-web-2.0.4.jar">
When I do this I get the following error:
Root context attribute is not of type WebApplicationContext:
org.springframework.web.context.support.XmlWebApplicationContext@1ff48d8:
display name [Root WebApplicationContext]; startup date [Thu Jun 11
03:06:42 PDT 2009]; root of context hierarchy
at
org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext
(WebApplicationContextUtils.java:66):66
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method):-2
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source):-1
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source):-1
at java.lang.reflect.Method.invoke(Unknown Source):-1
at railo.runtime.reflection.pairs.MethodInstance.invoke
(MethodInstance.java:37):37
at railo.runtime.java.JavaObject.call(JavaObject.java:241):241
at railo.runtime.java.JavaObject.call(JavaObject.java:260):260
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues
(VariableUtilImpl.java:617):617