Trying to configure an active MQ broker with a plugin in Java, where should <bean class="..."> attribute be pointing to? - plugins

I'm trying to configure an activemq broker with a plugin installed, but can't seem to get the qualified name of the plugin class right in the broker configuration file.
I have pasted the error message followed by the broker config below. Basicallly in the element I'm specifying
class="file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin"
which is absolute path to the XmlValidationPlugin.class file(have tried appending .class to path above but I get the same error).
Initially I assumed that the class attribute should be pointing to the .class file but have tried pointing it to .java and still doesn't work.
I have read the active MQ faq on developing plugins, FAQs, spring documentation etc.
My class path is
.;JAVA_HOME\lib;C:\Marcus\JavaProjects\Project;C:\Marcus\JavaProjects\Project\build\prod\classes
and JAVA_HOME is:
C:\Program Files\Java\jdk1.7.0_03
all the java source resides in
C:\Marcus\JavaProjects\Project\src
and the .class files are in
C:\Marcus\JavaProjects\Project\build\prod\classes
( file structure in classes mirrors that in src,so for example
com.foo.jms.amqplugin.XmlValidationPlugin
will have its .class file in
classes/com/foo/jms/amqplugin )
the plugin in question is XmlValidationPlugin.java, and is in folder src in package:
com.foo.jms.amqplugin
I have tried putting XmlValidationPlugin.class in a JAR and putting the JAR in activemqinstalldir/lib,( as was recommended to other people who had a similar problem) but this has not helped.
I have spent a day and a half on this already, and would really appreciate if anyone has any idea what the value of the plugins class attribute should be, as I have tried everything... Thanks in advance!
TOP OF ERROR OUTPUT:
C:\Program Files\apache-activemq-5.5.1>bin\activemq xbean:file:C:/Marcus/JavaProjects/Project/config/custom-broker.xml
Java Runtime: Oracle Corporation 1.7.0_03 C:\Program Files\Java\jdk1.7.0_03\jre
Heap sizes: current=15872k free=14246k max=506816k
JVM args: -Dcom.sun.management.jmxremote -Xmx512M -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Djava.util.logging.config.file=logging.properties -Dactivemq.classpath=C:\Program Files\apache-
activemq-5.5.1\bin\../conf;C:\Program Files\apache-activemq-5.5.1\bin\../conf; -Dactivemq.home=C:\Program Files\apache-activemq-5.5.1\bin\.. -Dactivemq.base=C:\Program Files\apache-activemq-5.5.1\bin\
..
ACTIVEMQ_HOME: C:\Program Files\apache-activemq-5.5.1\bin\..
ACTIVEMQ_BASE: C:\Program Files\apache-activemq-5.5.1\bin\..
Loading message broker from: xbean:file:C:/Marcus/JavaProjects/Project/config/custom-broker.xml
INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1#7a8ba4: startup date [Thu Apr 12 10:38:26 CEST 2012]; root of context hierarchy
ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin. Reason: java.lang.ClassNotFoundException: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin; nested exception is java.lang.ClassNotFoundException: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin
java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin.
Reason: java.lang.ClassNotFoundException: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin; nested exception is java.lang.ClassNotFoundException: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:98)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:143)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
...
BROKER CONFIG FILE:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.base}/conf/credentials.properties</value>
</property>
</bean>
<!--The <broker> element is used to configure the ActiveMQ broker. -->
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost"
dataDirectory="${activemq.base}/data">
...
<!--plugin-->
<plugins>
<bean xmlns="http://www.springframework.org/schema/beans"
id="xmlValidationPlugin"
class="com.foo.jms.amqplugin.XmlValidationPlugin"/>
</plugins>
</broker>
</beans>

Basicallly in the element I'm specifying class="file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin" which is absolute path to the XmlValidationPlugin.class file(have tried appending .class to path above but I get the same error). Initially I assumed that the class attribute should be pointing to the .class file but have tried pointing it to .java and still doesn't work.
It seems that the error you are getting is from the classloader.
Reason: java.lang.ClassNotFoundException: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin; nested exception is java.lang.ClassNotFoundException: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin
Classloader expects a fully qualified class-name instead of a path to the class file. Try to specify the fully qualified class name instead of the path to the class file .
Instead of:
file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin
Use:
com.foo.jms.amqplugin.XmlValidationPlugin
and do make sure that CLASSPATH environment variable will contain: C:/Marcus/JavaProjects/Project/build/prod/classes
If ActiveMQ uses some custom classloader for loading plug-ins (I do not know the details), you might need to specify the classpath in some ActivemMQ-specific way.

Related

WebLogic 12c not obeying "prefer-web-inf-classes" or "prefer-application-packages" during deployment

I am having a very strange problem with WebLogic 12.1.3.0.0. I have an application that causes a NullPointerException inside the AdminServer during deployment, yet the application runs fine after the error.
The NullPointerException during deployment happens because the deployment process is not respecting the following settings in my deployment descriptors:
AppName.war/WEB-INF/weblogic.xml:
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app>
<context-root>AppName</context-root>
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
And AppName.ear/META-INF/weblogic-application.xml:
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-application>
<prefer-application-packages>
<package-name>javax.faces.*</package-name>
</prefer-application-packages>
</weblogic-application>
Since these settings are ignored, javax.faces.webapp.FacesServlet class is loaded by the System Classloader (sun.misc.Launcher$AppClassLoader), from $WL_HOME/wlserver/modules/glassfish.jsf_2.0.0.0_2-1-20.jar, not from the WAR classloader. This eventually leads to the NPE due to some poorly written code in weblogic.servlet.internal.WebAnnotationProcessor, which assumes that javax.faces.webapp.FacesServlet will be annotated with #MultipartConfig, which it is not in glassfish.jsf_2.0.0.0_2-1-20.jar. The correct version of this class is located in AppName.ear/AppName.war/WEB-INF/lib/jsf-api-2.2.16.jar.
I have verified all of this by remote debugging the AdminServer, and by turning on Classloader Logging, which shows this:
GCL[61ba0535][AppName.ear#AppName.war] GCL.loadClass(javax.faces.webapp.FacesServlet)>
FCL[10d372cb][] FCL.loadClass(javax.faces.webapp.FacesServlet)>
FCL[10d372cb][] FCL.findClass(javax.faces.webapp.FacesServlet)>
GCL[75bc8d74][DomainLib] GCL.loadClass(javax.faces.webapp.FacesServlet)>
This issue makes it impossible to open the AppName Deployment in the Admin Console, b/c it always throw the error (with the aforementioned NPE in the logs):
The configuration for AppName is still being loaded from your last request, please wait a moment and retry.
In contrast to this, when I run the EAR in the server where it was deployed, exactly the same EAR works just fine. To prove that classloading is working properly, here's the log:
CACL[6eb4b4ad][AppName#AppName] CACL.loadClass(javax.faces.webapp.FacesServlet)>
CACL[6eb4b4ad][AppName#AppName] GCL.loadClass(javax.faces.webapp.FacesServlet)>
FCL[37ee3b94][AppName#AppName] FCL.loadClass(javax.faces.webapp.FacesServlet)>
FCL[37ee3b94][AppName#AppName] FCL.findClass(javax.faces.webapp.FacesServlet)>
GCL[3cc63f62][AppName#] GCL.loadClass(javax.faces.webapp.FacesServlet)>
FCL[770e8d03][] FCL.loadClass(javax.faces.webapp.FacesServlet)>
FCL[770e8d03][] FCL.findClass(javax.faces.webapp.FacesServlet)>
FCL[770e8d03][] FCL.matchesClassFilterList(javax.faces.webapp.FacesServlet): javax.faces. index : 0 end : 12>
FCL[770e8d03][] FCL.findClass(javax.faces.webapp.FacesServlet): Found match>
GCL[3cc63f62][AppName#] GCL.findClass(javax.faces.webapp.FacesServlet)>
GCL[3cc63f62][AppName#] GCL.findLocalClass(javax.faces.webapp.FacesServlet): Classpath in use: <LIST OF ALL JARS IN MY EAR>
GCL[3cc63f62][AppName#] GCL.findLocalClass(javax.faces.webapp.FacesServlet): not found>
CACL[6eb4b4ad][AppName#AppName] CACL.findClass(javax.faces.webapp.FacesServlet)>
CACL[6eb4b4ad][AppName#AppName] CACL.findClass(javax.faces.webapp.FacesServlet): About to loadClass>
CACL[6eb4b4ad][AppName#AppName] GCL.findClass(javax.faces.webapp.FacesServlet)>
CACL[6eb4b4ad][AppName#AppName] GCL.findLocalClass(javax.faces.webapp.FacesServlet): Classpath in use: <LIST OF ALL JARS IN MY WAR>
CACL[6eb4b4ad][AppName#AppName] GCL.findLocalClass(javax.faces.webapp.FacesServlet): Found class>
CACL[6eb4b4ad][AppName#AppName] GCL.defineClass(javax.faces.webapp.FacesServlet)>
I don't know how to fix this... Why is the AdminServer completely ignoring the deployment descriptors in my EAR, while the server that runs the EAR sets everything up properly?
Any ideas would be appreciated.

jbossfuse: Cannot find the declaration of element 'blueprint'

While Deploying a War application into fuse container, Im getting the Exception: cvc-elt.1.a: Cannot find the declaration of element 'blueprint'
My blueprint schema is:
<blueprint
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
Exception detail:
org.ops4j.pax.web.pax-web-extender-war - 4.3.0 | Error deploying web application
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 12 in XML document from ServletContext resource [/WEB-INF/camel-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1.a: Cannot find the declaration of element 'blueprint'.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:397)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)[310:org.apache.servicemix.bundles.spring-web:3.2.16.RELEASE_1]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)[310:org.apache.servicemix.bundles.spring-web:3.2.16.RELEASE_1]
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[205:org.apache.servicemix.bundles.spring-context:3.2.16.RELEASE_1]
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:542)[205:org.apache.servicemix.bundles.spring-context:3.2.16.RELEASE_1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)[205:org.apache.servicemix.bundles.spring-context:3.2.16.RELEASE_1]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)[310:org.apache.servicemix.bundles.spring-web:3.2.16.RELEASE_1]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)[310:org.apache.servicemix.bundles.spring-web:3.2.16.RELEASE_1]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)[310:org.apache.servicemix.bundles.spring-web:3.2.16.RELEASE_1]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext$3.call(HttpServiceContext.java:354)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext$3.call(HttpServiceContext.java:350)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.callContextInitialized(HttpServiceContext.java:349)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:791)[93:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294)[94:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.startContext(HttpServiceContext.java:601)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)[93:org.eclipse.jetty.server:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:260)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)[96:org.eclipse.jetty.util:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:279)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.end(HttpServiceStarted.java:1096)[116:org.ops4j.pax.web.pax-web-runtime:4.3.0]
at org.ops4j.pax.web.service.internal.HttpServiceProxy.end(HttpServiceProxy.java:417)[116:org.ops4j.pax.web.pax-web-runtime:4.3.0]
at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.end(RegisterWebAppVisitorWC.java:380)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:692)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf.jar:2.4.0.redhat-630187]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)[karaf.jar:2.4.0.redhat-630187]
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf.jar:2.4.0.redhat-630187]
at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf.jar:2.4.0.redhat-630187]
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf.jar:2.4.0.redhat-630187]
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf.jar:2.4.0.redhat-630187]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:219)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:179)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:59)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:281)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_121]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: org.xml.sax.SAXParseException: cvc-elt.1.a: Cannot find the declaration of element 'blueprint'.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:201)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:132)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:394)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:282)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2143)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:788)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:875)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:798)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)[:2.11.0.SP4-redhat-1]
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:389)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
... 49 more
Can anyone give a clue in this scenario?
In JBoss FUSE the war isn't a preferred way, you should use bundle instead, and use blueprint to configure the route. Please take a look at the camel quickstarts in JBoss FUSE kit.

Exposing SOAP service using apache Camel and WSDL

I have a WSDL file located under src\main\resources\wsdl\ folder and it is having multiple operations defined within it. My application is running on Weblogic 12C server. I'm trying to expose the SOAP web-service using Apache Cammel (version: 2.18.3) with Java DSL -
I have written below code under configuration method of my RouteBuilder class -
CxfComponent cxfComponent = new CxfComponent(getContext());
CxfEndpoint serviceEndpoint = new CxfEndpoint("/soap/Manage_Order", cxfComponent);
serviceEndpoint.setAddress("http://<IP>:<PORT>/myproject/soap/ManageOrder_Details");
serviceEndpoint.setServiceClass(
"Fully qualified service interface name generated from WSDL file using maven with #WebService annotation");
serviceEndpoint.setEndpointName(<end point name defined in the service class with #WebEndpoint annotation>);
serviceEndpoint.setDataFormat(DataFormat.MESSAGE);
serviceEndpoint.setDefaultOperationName("manageOrder");
getContext().addEndpoint("myServiceEndPoint1", serviceEndpoint);
from("cxf:myServiceEndPoint1").log("Hi, I am here").end();
While I'm deploying the application, it is throwing below exception -
weblogic.application.ModuleException: java.lang.IllegalArgumentException: serviceClass must be specified
at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalArgumentException: serviceClass must be specified
at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:311)
at org.apache.camel.component.cxf.CxfEndpoint.createServerFactoryBean(CxfEndpoint.java:663)
at org.apache.camel.component.cxf.CxfConsumer.createServer(CxfConsumer.java:70)
at org.apache.camel.component.cxf.CxfConsumer.<init>(CxfConsumer.java:66)
at org.apache.camel.component.cxf.CxfEndpoint.createConsumer(CxfEndpoint.java:252)
Truncated. see log file for complete stacktrace
pom.xml
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-soap</artifactId>
<version>2.18.3</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>2.18.3</version>
<!-- use the same version as your Camel core version -->
</dependency>
As the error says, you have not mentioned the service class and endpoint names.serviceEndpoint.setServiceClass("Fully qualified service interface name generated from WSDL file using maven with #WebService annotation");
serviceEndpoint.setEndpointName(<end point name defined in the service class with #WebEndpoint annotation>);
Step 1: Generate the service from your wsdl using wsdl2java command or your choice of IDE.
Step 2: Have that in your code classpath
Step 3: Mention the class name and endpoint names in the above piece of code

Wildcard bean loading in JBoss 5.1.0.GA

We have this in config.xml, which loads OK in JBoss 4.2.2.GA
<import resource="classpath*:/META-INF/apollo/babel-*-beans.xml"/>
However in JBoss 5.1.0.GA, it does not load (as I am aware things are stricter)
Offending resource: ServletContext resource [/WEB-INF/config/catalog-config.xml];
nested exception is org.springframework.beans.factory.BeanDefinitionStoreException:
Could not resolve bean definition resource pattern [classpath*:/META-INF/apollo/babel-*-beans.xml];
nested exception is java.io.FileNotFoundException:
I followed the advice here http://community.jboss.org/message/6502 to disable validation,
%JBOSS_HOME%/server/< serverName>/deployers/ear-deployer-jboss-beans.xml, uncommentthe commented out lines:
<property name="useValidation">false</property>
but the error stays.
So how do I make JBoss 5.1.0.GA less strict and able to load using wildcard?

Where to define <Environment...> elements in JBoss

I try to define environment entries in JBoss 5.1 and added following to the server/default/deploy/jbossweb.sar/context.xml file:
<Environment type="java.lang.String" name="name" value="value" />
Following error occurs on startup:
2010-01-26 14:50:08,383 ERROR
[org.jboss.web.tomcat.service.deployers.JBossContextConfig]
(main) XML error parsing: context.xml
org.jboss.xb.binding.JBossXBException:
Failed to parse source: Resource
cannot appear in this position.
Expected content of Context is
unordered_sequence: attributes?
InstanceListener* Realm? Parameters*
Manager? Loader? Valve* SessionCookie?
Resources? Listener*
Where may I define environment entries in JBoss (but outside of application's EAR)?
This article confirms that (likely) it is not possible to configure environment entries in JBoss. Author suggests to use PropertiesService as alternative.
Property configuration in properties-service.xml works great!