OpenLiberty ignoring WEB-INF/ibm-application-bnd.xml - websphere-liberty

My application (my-app.war) has a JAX-RS endpoint, secured with a given role, like this:
Endpoint.java
#Path("endpoint/")
#Consumes(MediaType.APPLICATION_JSON)
#Produces(MediaType.APPLICATION_JSON)
#DeclareRoles({"ADMIN_ROLE"})
public class Endpoint {
#POST
#RolesAllowed({"ADMIN_ROLE"})
public void post() {
}
}
server.xml
<server>
<featureManager>
<feature>jaxrs-2.1</feature>
<feature>appSecurity-3.0</feature>
</featureManager>
<application id="my-app" context-root="/" location="my-app.war" type="war">
</application>
<variable name="default.http.port" defaultValue="9080"/>
<variable name="default.https.port" defaultValue="9443"/>
<httpEndpoint id="defaultHttpEndpoint" httpPort="${default.http.port}" httpsPort="${default.https.port}"/>
<basicRegistry realm="defaultRealm">
<user name="test-user" password="test-password"/>
<group name="ADMIN_GROUP">
<member name="test-user"/>
</group>
</basicRegistry>
</server>
Now I have to bind ADMIN_GROUP to ADMIN_ROLE.
If I do it on server.xml application, then everything works fine:
<application id="my-app" context-root="/" location="my-app.war" type="war">
<application-bnd>
<security-role name="ADMIN_ROLE">
<group name="ADMIN_GROUP" />
</security-role>
</application-bnd>
</application>
The application is deployed and upon invoking the endpoint without authentication, it returns 403 (authentication required). When supplied with authentication header, it returns 204 (no content) as intended.
Now the problem lies when I try to configure the binding in ibm-application-bnd.xml:
<?xml version="1.0" encoding="UTF-8"?>
<application-bnd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-application-bnd_1_2.xsd"
xmlns="http://websphere.ibm.com/xml/ns/javaee"
version="1.2">
<
<security-role name="ADMIN_ROLE">
<group name="ADMIN_GROUP" />
</security-role>
</application-bnd>
I've put it both in META-INF/ibm-application-bnd.xml and WEB-INF/ibm-application-bnd.xml. But both of them are completely ignored (I've even went as far as adding invalid xml there, but get no error message from OpenLiberty).
Every call to the endpoint returns 403, even when supplied with authentication.
In https://www.ibm.com/docs/en/was-liberty/base?topic=liberty-configuring-authorization-applications-in, it says [emphasis added]:
Configure the authorization information such as the user and group to role mapping.
You can configure the authorization table in the following ways:
If you have an EAR file, you can add the authorization configuration definition to the ibm-application-bnd.xml or ibm-application-bnd.xmi file.
If you have standalone WAR files, you can add the authorization table definitions to the server.xml file under the respective application element. You can use the WebSphere® Application Server Developer Tools for Eclipse to do this.
Does this mean that for war applications the binding MUST BE on server.xml?

Per this answer, META-INF/ibm-application-bnd.xml - though undocumented - can be used inside a web archive.
Then I've mvn package my project, and inpected it's war file (showing only relevant files):
Length Date Time Name
--------- ---------- ----- ----
0 2021-04-28 22:13 META-INF/
131 2021-04-28 22:13 META-INF/MANIFEST.MF
0 2021-04-28 22:13 WEB-INF/
0 2021-04-28 22:13 WEB-INF/classes/
0 2021-04-28 22:13 WEB-INF/classes/META-INF/
0 2021-04-28 22:13 WEB-INF/lib/
0 2021-04-22 17:58 WEB-INF/beans.xml
134 2021-04-28 22:13 WEB-INF/classes/META-INF/ibm-application-bnd.xml
592 2021-04-28 22:13 WEB-INF/classes/META-INF/persistence.xml
300365 2021-04-15 09:58 WEB-INF/lib/log4j-api-2.14.1.jar
1745700 2021-04-15 09:59 WEB-INF/lib/log4j-core-2.14.1.jar
393 2021-04-28 21:50 WEB-INF/web.xml
0 2021-04-28 22:13 META-INF/maven/
--------- -------
Now note that there are META-INF/* entries and WEB-INF/classes/META-INF/* entries.
Then I've found this answer (which is unrelated to liberty/openliberty). It's first sentence struck me in awe:
It looks like your META-INF folder is in src/main/resources directory.
Exactly like mine. So I moved META-INF from src/main/resources to src/main/webapp.
Now the war lists as:
Length Date Time Name
--------- ---------- ----- ----
0 2021-04-28 22:22 META-INF/
131 2021-04-28 22:22 META-INF/MANIFEST.MF
0 2021-04-28 22:22 WEB-INF/
0 2021-04-28 22:22 WEB-INF/classes/
0 2021-04-28 22:22 WEB-INF/lib/
134 2021-04-28 22:13 META-INF/ibm-application-bnd.xml
592 2021-04-27 10:19 META-INF/persistence.xml
0 2021-04-22 17:58 WEB-INF/beans.xml
300365 2021-04-15 09:58 WEB-INF/lib/log4j-api-2.14.1.jar
1745700 2021-04-15 09:59 WEB-INF/lib/log4j-core-2.14.1.jar
393 2021-04-28 21:50 WEB-INF/web.xml
0 2021-04-28 22:22 META-INF/maven/
--------- -------
Now the file ibm-application-bnd.xml gets processed. And it works. EXCEPT THAT...
This way JPA is not working anymore.
It seems that META-INF/persistence.xml must be in src/main/resources after all.
Now I have two META-INF/ folders (¯\_(ツ)_/¯).
UPDATE
Apart from having two META-INF/ folders (a problem on its own), now my tests can't access resources from META-INF/ (the other one, in WEB-INF/classes/META-INF is readily available, as every resource inside WEB-INF/classes/).
Then why would I need to access ibm-application-bnd.xml from tests, you might ask. Because I'm using arquillian, and I need to create a deployment, and I need to include these role <-> group mappings.
Now I have 3 options:
create a copy of ibm-application-bnd.xml inside src/test/resources; the problem here is that I need to keep both in sync;
add src/main/webapps to the surefire/failsafe classpath (see this answer);
specifically for Liberty/OpenLiberty, I can rely on an implicit mapping (assuming each group bind to a role with the same name; go look for CWWKS2104I here). This is the one I'm choosing for the moment.
Options 1 and 3 share the same downside: the tested code is not EXACTLY the code that will be deployed to production.
Option 2 has another downside: when running tests through the IDE, this extra folder must also be added to the classpath (unless the IDE has a very good integration with maven and can read surefire/failsafe configuration).
The

Related

Configure SSL in blueprint for CXF

I have an existing application deployed to Apache Karaf OSGi container.
The application bundles implement SOAP and REST web services using Apache CXF, configured by blueprint.xml files that look like this:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.2.0"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd
http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.2.0 http://aries.apache.org/schemas/blueprint-ext/blueprint-ext.xsd">
<jaxws:endpoint id="bundle1-server" implementor="com.myapp.Bundle1ServiceImpl" endpointName="s:Bundle1Port"
serviceName="s:Bundle1Service" address="http://0.0.0.0:9080/SoapContext/Bundle1Port" wsdlLocation="wsdl/Bundle1Service.wsdl" xmlns:s="http://com.myapp/services/bundle1service">
</jaxws:endpoint>
</blueprint>
When the endpoint starts, I can see this in the log:
INFO | org.apache.cxf.endpoint.ServerImpl | | org.apache.cxf.endpoint.ServerImpl - initDestination - 85 | 109 - org.apache.cxf.cxf-core - 3.1.9 | Setting the server's publish address to be http://0.0.0.0:9080/SoapContext/Bundle1Port
INFO  | org.eclipse.jetty.server.ServerConnector |  | org.eclipse.jetty.server.AbstractConnector - doStart -  266 | 204 - org.eclipse.jetty.util - 9.2.15.v20160210 | Started ServerConnector#30394ac6{HTTP/1.1}{0.0.0.0:9080}
The CXF uses Jetty to receive the incoming HTTP requests (there is a cxf-rt-transports-http-jetty dependency in the pom.xml).
I want to switch the web services from http to https.
When I change the port number in the blueprint.xml, the web service is indeed reachable at the new port.
However, changing the URL scheme from http to https (http://:9080 to https://:9443) results in an error:
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to initialize bean bundle1-server
...
Caused by: java.io.IOException: Protocol mismatch for port 9443: engine's protocol is http, the url protocol is https
at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory.createJettyHTTPServerEngine(JettyHTTPServerEngineFactory.java:277)
Obviously, I also need to specify the server certificate and the CA certificate. I have tried to add the following:
<httpj:engine-factory bus="cxf">
<httpj:engine port="9443">
<httpj:tlsServerParameters>
<sec:keyManagers keyPassword="changeit">
<sec:keyStore type="JKS" password="changeit"
file="/path-to-certificates/keystore.ks"/>
</sec:keyManagers>
<sec:trustManagers>
<sec:keyStore type="JKS" password="password"
file="/path-to-certificates/truststore.ks"/>
</sec:trustManagers>
<sec:clientAuthentication want="false" required="false"/>
</httpj:tlsServerParameters>
</httpj:engine>
</httpj:engine-factory>
But now I get:
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to load class org.eclipse.jetty.server.Connector from recipe MapRecipe[name='#recipe-85']
...
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Connector not found by Bundle1 [255]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)[org.apache.felix.framework-5.4.0.jar:]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)[:1.8.0_262]
at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1925)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:978)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.loadClass(BlueprintContainerImpl.java:467)[13:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.BlueprintRepository.loadClass(BlueprintRepository.java:419)[13:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.GenericType.parse(GenericType.java:135)[13:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.di.AbstractRecipe.doLoadType(AbstractRecipe.java:168)[13:org.apache.aries.blueprint.core:1.6.1]
What am I missing here?
Update: I also tried to configure SSL globally for the whole Karaf server by editing etc/org.ops4j.pax.web.cfg to include
org.osgi.service.http.secure.enabled=true
org.ops4j.pax.web.ssl.keystore=/path-to-keystore.ks
org.ops4j.pax.web.ssl.password=changeit
org.ops4j.pax.web.ssl.keypassword=changeit
org.osgi.service.http.port.secure=8443
Then I can see in the logs
INFO | org.ops4j.pax.web.service.jetty.internal.JettyServerImpl | | org.ops4j.pax.web.service.jetty.internal.JettyServerImpl - addConnector - 226 | 222 - org.ops4j.pax.web.pax-web-jetty - 4.2.6 | Pax Web available at [0.0.0.0]:[8443]
INFO | org.eclipse.jetty.server.ServerConnector | | org.eclipse.jetty.server.AbstractConnector - doStart - 266 | 204 - org.eclipse.jetty.util - 9.2.15.v20160210 | Started secureDefault#3bae4ef2{SSL-http/1.1}{0.0.0.0:8443}
..
Caused by: java.io.IOException: Protocol mismatch for port 8443: engine's protocol is http, the url protocol is https
Which is really confusing...
I have fixed the ClassNotFoundException by adding org.eclipse.jetty.server to Import-Package in META-INF/MANIFEST.MF
However, I have read this: "I strongly discourage people from configuring the jetty servers in their blueprint files" http://servicemix.396122.n5.nabble.com/servicemix-5-4-0-cxf-jetty-blueprint-issue-td5722268.html
So maybe I should still try to fix the latter (global) config if possible.

Karaf: Missing classes from my own jar

I created an OSGi bundle using the camel-archetype-blueprint maven archetype. I then tried to install this into Karaf, but the bundle is going into GracePeriod. After running diag, it's missing a dependency that is inside the jar file itself.
Ok, the long version:
The jar file generated from the archetype contains the Hello and HelloBean classes that are included from the archetype:
$ jar tvf myproject-1.0-SNAPSHOT.jar
455 Tue Jul 26 11:25:10 UTC 2016 META-INF/MANIFEST.MF
0 Tue Jul 26 11:25:10 UTC 2016 META-INF/
0 Tue Jul 26 11:25:10 UTC 2016 META-INF/maven/
0 Tue Jul 26 11:25:10 UTC 2016 META-INF/maven/com.petewall/
0 Tue Jul 26 11:25:10 UTC 2016 META-INF/maven/com.petewall/myproject/
143 Tue Jul 26 11:25:10 UTC 2016 META-INF/maven/com.petewall/myproject/pom.properties
3418 Tue Jul 26 11:25:06 UTC 2016 META-INF/maven/com.petewall/myproject/pom.xml
0 Tue Jul 26 11:25:10 UTC 2016 OSGI-INF/
0 Tue Jul 26 11:25:10 UTC 2016 OSGI-INF/blueprint/
1376 Tue Jul 26 11:20:12 UTC 2016 OSGI-INF/blueprint/blueprint-bean.xml
961 Tue Jul 26 11:20:12 UTC 2016 OSGI-INF/blueprint/blueprint-service.xml
0 Tue Jul 26 11:25:10 UTC 2016 com/
0 Tue Jul 26 11:25:10 UTC 2016 com/petewall/
143 Tue Jul 26 11:24:56 UTC 2016 com/petewall/Hello.class
1022 Tue Jul 26 11:24:56 UTC 2016 com/petewall/HelloBean.class
676 Tue Jul 26 11:20:12 UTC 2016 log4j.properties
I dropped this jar file into the deploy directory of my karaf instance. The bundle is installed and listed in the bundle:list command. However, when the bundle starts, it goes into GracePeriod. Diagnosing it shows that it's missing a dependency:
karaf#root()> bundle:diag 98
Camel Blueprint Route (98)
--------------------------
Status: GracePeriod
Blueprint
7/26/16 6:26 PM
Missing dependencies:
(objectClass=com.petewall.Hello)
However, those classes are even found using karaf's exports command:
karaf#root()> exports
Package Name | Version | ID | Bundle Name
-----------------------------------------------------------------------------
...
com.petewall | 1.0.0.SNAPSHOT | 98 | myproject
...
And the classes command:
karaf#root()> classes
...
com/petewall/Hello.class
com/petewall/HelloBean.class
I'm very new to all of these technologies (Karaf, Camel, OSGi, etc...), so I'm sure I'm missing something. Please, can someone point me in the right direction here?
UPDATE 1:
The archetype generates two XML files which seem to define the blueprint service and bean.
blueprint-bean.xml:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="..." xmlns:xsi="..." xmlns:cm="..." xsi:schemaLocation="...">
<cm:property-placeholder persistent-id="HelloBean" update-strategy="reload">
<cm:default-properties>
<cm:property name="greeting" value="Hi from Camel" />
</cm:default-properties>
</cm:property-placeholder>
<bean id="helloBean" class="com.petewall.HelloBean">
<property name="say" value="${greeting}"/>
</bean>
<camelContext id="blueprint-bean-context" xmlns="http://camel.apache.org/schema/blueprint">
<route id="timerToLog">
<from uri="timer:foo?period=5000"/>
<setBody>
<method ref="helloBean" method="hello"/>
</setBody>
<log message="The message contains ${body}"/>
<to uri="mock:result"/>
</route>
</camelContext>
</blueprint>
blueprint-service.xml:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="..." xmlns:xsi="..." xmlns:cm="..." xsi:schemaLocation="...">
<reference id="helloService" interface="com.petewall.Hello" />
<camelContext id="blueprint-service-context" xmlns="http://camel.apache.org/schema/blueprint">
<route id="timerToLog">
<from uri="timer:foo?period=5000"/>
<setBody>
<method ref="helloService" method="hello"/>
</setBody>
<log message="The message contains ${body}"/>
<to uri="mock:result"/>
</route>
</camelContext>
</blueprint>
The archetype generates an interface, Hello, that defines one method: String hello(). The HelloBean class implements that interface and uses a private String say parameter to change what the hello() method prints.
What Blueprint reports as a "missing dependency" is actually a missing OSGi Service.
It's difficult to be sure because you haven't posted your Blueprint XML, but the error message strongly suggests this. You probably have a <reference> element in there which refers to the com.petewall.Hello service.
Does any bundle provide an instance of com.petewall.Hello as a service? Note that the presence of a class file in your bundle with this name is irrelevant. Perhaps you have this the wrong way around, and your bundle should be providing the service? Can you explain a bit more about what you're trying to do, from a high level?
The archetype seems to have created two different styles of calling a method on a bean.
The first blueprint defines the HelloBean locally and calls a method on it. This would be able to run on its own. It does not publish any OSGi services though.
The second blueprint references an OSGi service and calls a method on it. This will not be able to start unless you install a bundle that exports a service with that interface.
All blueprint xmls of a bundle are merged together into one blueprint context. So the merged blueprint context will only start once there is HelloBean service present in your runtime.
Try to omit the second blueprint.xml and your bundle should start fine.

Servlet 2.5 version ear does not start in Websphere 8.5

I deploy an ear with a unique war inside with servlet 2.5 version.
When I try to start the application, the log shows this message and the server tries to start the application infinitely. It ends after 20 minutes throwing a java HeapException.
[11/18/13 11:12:24:235 CET] 00000044 FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on /opt/was/WebSphere/AppServer/profiles/AppSrv01/logs/ffdc/server1_a74ac991_13.11.18_11.12.24.2348371791741532456941.txt com.ibm.ws.classloader.ClassLoaderUtils.addDependents 238
[11/18/13 11:12:26:007 CET] 00000044 webapp I com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I: Loading Web Module: ISicres 8.2 GISS Servlet 2.5.
[11/18/13 11:12:26:490 CET] 00000044 WASSessionCor I SessionContextRegistry getSessionContext SESN0176I: Will create a new session context for application key default_host/ISicres
If I deploy the same ear but with servlet 2.4 version, when I start the application, it starts in a few seconds.
The servlet 2.4 definition is the following:
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
The servlet 2.5 definition is the following:
<web-app version="2.5" 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/web-app_2_5.xsd">
At the startup it shows the following exception in the log /opt/was/WebSphere/AppServer/profiles/AppSrv01/logs/ffdc/server1_a74ac991_13.11.18_11.12.24.2348371791741532456941.txt:
[11/18/13 11:12:24:234 CET] FFDC Exception:java.util.zip.ZipException SourceId:com.ibm.ws.classloader.ClassLoaderUtils.addDependents ProbeId:238 Reporter:java.lang.Class#e9e29e43
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:150)
at java.util.jar.JarFile.<init>(JarFile.java:149)
at java.util.jar.JarFile.<init>(JarFile.java:113)
at com.ibm.ws.classloader.ClassLoaderUtils.addDependents(ClassLoaderUtils.java:147)
at com.ibm.ws.classloader.ClassLoaderUtils.addDependents(ClassLoaderUtils.java:195)
at com.ibm.ws.classloader.ClassLoaderUtils.addDependentJars(ClassLoaderUtils.java:113)
at com.ibm.ws.classloader.ClassGraph.<init>(ClassGraph.java:117)
at com.ibm.ws.classloader.ClassLoaderManager.initialize(ClassLoaderManager.java:202)
at com.ibm.ws.classloader.ClassLoaderManager.<init>(ClassLoaderManager.java:166)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:923)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:769)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2172)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:994)
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:349)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1783)
At the end, the server writes some headdump files. This is the content of the file 'javacore.20131118.103120.6704.0005.txt' written:
0SECTION TITLE subcomponent dump routine
NULL ===============================
1TICHARSET UTF-8
1TISIGINFO Dump Event "systhrow" (00040000) Detail "java/lang/OutOfMemoryError" "Java heap space" received
1TIDATETIME Date: 2013/11/18 at 10:34:30
1TIFILENAME Javacore filename: /opt/was/WebSphere/AppServer/profiles/AppSrv01/javacore.20131118.103120.6704.0005.txt
1TIREQFLAGS Request Flags: 0x81 (exclusive+preempt)
1TIPREPSTATE Prep State: 0x104 (exclusive_vm_access+trace_disabled)
NULL ------------------------------------------------------------------------
0SECTION GPINFO subcomponent dump routine
NULL ================================
2XHOSLEVEL OS Level : Linux 2.6.32.12-0.7-default
2XHCPUS Processors -
3XHCPUARCH Architecture : amd64
3XHNUMCPUS How Many : 1
3XHNUMASUP NUMA is either not supported or has been disabled by user
NULL
1XHERROR2 Register dump section only produced for SIGSEGV, SIGILL or SIGFPE.
NULL
NULL ------------------------------------------------------------------------
0SECTION ENVINFO subcomponent dump routine
NULL =================================
1CIJAVAVERSION JRE 1.6.0 Linux amd64-64 build 20120322_106210 (pxa6460_26sr2ifix-20120419_02(SR2+IV19661))
1CIVMVERSION VM build R26_Java626_SR2_20120322_1722_B106210
1CIJITVERSION r11_20120322_22976
1CIGCVERSION GC - R26_Java626_SR2_20120322_1722_B106210_CMPRSS
1CIJITMODES JIT enabled, AOT enabled, FSD disabled, HCR disabled
1CIRUNNINGAS Running as a standalone JVM
1CICMDLINE /opt/was/WebSphere/AppServer/java/bin/java -Declipse.security -Dwas.status.socket=44247
What could be the problem with WAS 8.5 and servlets 2.5 spec?
Without knowledge of the contents of your application I can only assume that extensive classpath scanning is going on (a lot of annotations were introduced in Java EE 6/Servlet 2.5). You should check with Reducing annotation searches during application deployment for possible solutions.

Jenkins slave running Maven gives log4j warning

I'm using Jenkins, and I have a Windows machine set up as a slave worker. I have a Maven-based project that runs on the slave. The build works correctly, but I get a warning from log4j about it not being initialized. I'd like to scratch that itch and remove the warning, but I don't know how.
I'm not very familiar with log4j. I do understand I could set a system property to tell it where to find a config file, but I don't know where in the Jenkins pipeline that property should be set or how. It looks like the warning comes before Maven starts but after the slave begins the job.
Here's the snippit of console output:
Parsing POMs
[MyTest] $ java -cp C:\jenkins\maven3-agent.jar;C:\jenkins\tools\Maven\Maven\boot\plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main C:\jenkins\tools\Maven\Maven C:\Users\waisbrot\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\28\5c50da9c-2d1a9aef C:\jenkins\maven3-interceptor.jar 49210
<===[JENKINS REMOTING CAPACITY]===>channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f C:\jenkins\workspace\MyTest\pom.xml test
[INFO] Scanning for projects...
I'm not particularly proud of this, but I wasn't interested in any of that idle chatter, so I suppressed it by doing
jar uf <path to maven3-agent-1.2.jar>/maven3-agent-1.2.jar log4j.xml
where log4j.xml contains
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<root>
<level value="off"/>
</root>
</log4j:configuration>
NB: the jar command must be executed as shown, with log4j.xml in the current directory.
Just provide a log4j.properties or a log4j.xml with valid contents in the classpath. See the log4j documentation for details

Deploying WAR to Fuse ESB get 'FileNotFoundException: URL [bundle://248.0:1/com/bookstore/app/]'

Any help would be gratefully received...
Maven Spring Roo project, JPA2 combined with CXF archetype simple Web Service application.
After deploying to Fuse (Servicemix 4.4.1) as a WAR (Fuse converts this into a bundle), when activating (osgi:start nnn) get the following error..
java.io.FileNotFoundException: URL [bundle://248.0:1/com/bookstore/app/] cannot be resolved to absolute file path because it does not reside in the file system: bundle://248.0:1/com/bookstore/app/
Seems to be when Springs component scan starts..
app-context.xml contains
<context:component-scan base-package="com.bookstore.app" />
Apologies for the extended stack trace, but thought it may prove useful...
21:28:07,365 | INFO | l Console Thread | XmlBeanDefinitionReader | 248 - mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war - 0.0.0 | Loading XML bean definitions from class path resource [META-INF/spring/app-context.xml]
21:28:07,457 | WARN | l Console Thread | hMatchingResourcePatternResolver | 248 - mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war - 0.0.0 | Cannot search for matching files underneath URL [bundle://248.0:1/com/bookstore/app/] because it does not correspond to a directory in the file system
java.io.FileNotFoundException: URL [bundle://248.0:1/com/bookstore/app/] cannot be resolved to absolute file path because it does not reside in the file system: bundle://248.0:1/com/bookstore/app/
at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:204)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:52)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.core.io.UrlResource.getFile(UrlResource.java:168)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingFileResources(PathMatchingResourcePatternResolver.java:528)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.web.context.support.ServletContextResourcePatternResolver.doFindPathMatchingFileResources(ServletContextResourcePatternResolver.java:92)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:349)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:267)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1227)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:204)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:204)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1335)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:186)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)[248:mvn_com.bookstore_bookstore-ws_1.0-SNAPSHOT_war:0]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext$1.call(HttpServiceContext.java:168)[160:org.ops4j.pax.web.pax-web-jetty:1.0.3]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext$1.call(HttpServiceContext.java:164)[160:org.ops4j.pax.web.pax-web-jetty:1.0.3]
at org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60)[160:org.ops4j.pax.web.pax-web-jetty:1.0.3]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.addEventListener(HttpServiceContext.java:161)[160:org.ops4j.pax.web.pax-web-jetty:1.0.3]
at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.addEventListener(JettyServerImpl.java:235)[160:org.ops4j.pax.web.pax-web-jetty:1.0.3]
at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Started.addEventListener(ServerControllerImpl.java:276)[160:org.ops4j.pax.web.pax-web-jetty:1.0.3]
at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.addEventListener(ServerControllerImpl.java:127)[160:org.ops4j.pax.web.pax-web-jetty:1.0.3]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerEventListener(HttpServiceStarted.java:286)[158:org.ops4j.pax.web.pax-web-runtime:1.0.3]
at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerEventListener(HttpServiceProxy.java:133)[158:org.ops4j.pax.web.pax-web-runtime:1.0.3]
at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:276)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:561)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.register(WebAppPublisher.java:170)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.serviceChanged(WebAppPublisher.java:155)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.serviceChanged(WebAppPublisher.java:119)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.swissbox.tracker.ReplaceableService.setService(ReplaceableService.java:114)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.swissbox.tracker.ReplaceableService.access$100(ReplaceableService.java:28)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.swissbox.tracker.ReplaceableService$CollectionListener.serviceAdded(ReplaceableService.java:183)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.swissbox.tracker.ServiceCollection$Tracker.addingService(ServiceCollection.java:181)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)[karaf.jar:2.2.2-fuse-04-06]
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)[karaf.jar:2.2.2-fuse-04-06]
at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184)[karaf.jar:2.2.2-fuse-04-06]
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:339)[karaf.jar:2.2.2-fuse-04-06]
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:273)[karaf.jar:2.2.2-fuse-04-06]
at org.ops4j.pax.swissbox.tracker.ServiceCollection.onStart(ServiceCollection.java:139)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle$Stopped.start(AbstractLifecycle.java:121)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle.start(AbstractLifecycle.java:49)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.swissbox.tracker.ReplaceableService.onStart(ReplaceableService.java:146)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle$Stopped.start(AbstractLifecycle.java:121)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle.start(AbstractLifecycle.java:49)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:81)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.web.extender.war.internal.WebXmlObserver.doPublish(WebXmlObserver.java:304)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.web.extender.war.internal.WebXmlObserver.addingEntries(WebXmlObserver.java:153)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.swissbox.extender.BundleWatcher.register(BundleWatcher.java:186)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.swissbox.extender.BundleWatcher.access$000(BundleWatcher.java:45)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.ops4j.pax.swissbox.extender.BundleWatcher$1.bundleChanged(BundleWatcher.java:127)[163:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:795)[org.apache.felix.framework-3.0.9-fuse-05-06.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:717)[org.apache.felix.framework-3.0.9-fuse-05-06.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:597)[org.apache.felix.framework-3.0.9-fuse-05-06.jar:]
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3781)[org.apache.felix.framework-3.0.9-fuse-05-06.jar:]
at org.apache.felix.framework.Felix.startBundle(Felix.java:1792)[org.apache.felix.framework-3.0.9-fuse-05-06.jar:]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:927)[org.apache.felix.framework-3.0.9-fuse-05-06.jar:]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:914)[org.apache.felix.framework-3.0.9-fuse-05-06.jar:]
at org.apache.karaf.shell.osgi.StartBundle.doExecute(StartBundle.java:29)[19:org.apache.karaf.shell.osgi:2.2.2.fuse-04-06]
at org.apache.karaf.shell.osgi.BundlesCommand.doExecute(BundlesCommand.java:37)[19:org.apache.karaf.shell.osgi:2.2.2.fuse-04-06]
at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[36:org.apache.karaf.shell.console:2.2.2.fuse-04-06]
at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[36:org.apache.karaf.shell.console:2.2.2.fuse-04-06]
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[36:org.apache.karaf.shell.console:2.2.2.fuse-04-06]
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[36:org.apache.karaf.shell.console:2.2.2.fuse-04-06]
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[36:org.apache.karaf.shell.console:2.2.2.fuse-04-06]
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[36:org.apache.karaf.shell.console:2.2.2.fuse-04-06]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[36:org.apache.karaf.shell.console:2.2.2.fuse-04-06]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[36:org.apache.karaf.shell.console:2.2.2.fuse-04-06]
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[36:org.apache.karaf.shell.console:2.2.2.fuse-04-06]
at org.apache.karaf.shell.console.jline.Console.run(Console.java:240)[36:org.apache.karaf.shell.console:2.2.2.fuse-04-06]
at java.lang.Thread.run(Thread.java:680)[:1.6.0_29]
Long shot - but it looks like some Spring is trying to scan for the bundle cache but has got confused as to the bundle's original location.
In your Fuse configuration, try switching from Felix to Equinox, in Karaf it's in etc/config.properties and the property is karaf.framework - should be virtually the same in Fuse ESB.
Have a look at this page,
https://ops4j1.jira.com/wiki/display/ops4j/Pax+Web+Extender+-+War+-+Examples
<context:component-scan base-package="*" /> is currently not supported by OSGI environment. Make sure that you make use of <context:annotation-config /> and define all your components as beans in your application context.

Resources