WSDoAllSender class replacement in wss4j-1.6.10? - wss4j

I have a WSDD what works well with wssj4-1.5.12. It looks like this:
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>
<globalConfiguration >
<requestFlow >
<handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
<parameter name="action" value="UsernameToken"/>
<parameter name="passwordType" value="PasswordText"/>
<parameter name="passwordCallbackClass" value="my.domain.Callback"/>
</handler>
</requestFlow >
</globalConfiguration >
</deployment>
However, after switching to wss4j-1.6.10, I'm getting an ClassNotFoundException:
java.lang.ClassNotFoundException: org.apache.ws.axis.security.WSDoAllSender
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
...
It does seem that WSDoAllSender is no longer in the wss4j-1.6.4 API. However, I cannot seem to find its replacement. Does wss4j still supports UsernameToken for SOAP connection? What's the replacement class for WSDoAllSender?
Thank you.

Related

infinispan cache.put() throws null pointer exception even when values put are not null

trying to add content to infinispan cache and I get null pointer exception when i use the put method. Mine is a JSF web application. We are trying to achieve session replication using wildfly 13.
import org.infinispan.Cache;
public class index extends AbstractPageBean implements java.io.Serializable {
#Resource(lookup = "java:jboss/infinispan/cache/web/web_repl")
Cache<String, String> ilsCache;
public Cache<String, String> getCache() {
return ilsCache;
}
public void prerender() {
ilsCache.put("Message", "Hello");
logger.info("CACHE " + getCache());
}
Log file
2018-08-21 14:21:57,134 ERROR [biz.autoscan.ils.index] (default task-1) index.java::Exception occured : java.lang.NullPointerException
at biz.autoscan.ils.index.btnLogin_action(index.java:930)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:181)
at com.sun.el.parser.AstValue.invoke(AstValue.java:289)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Thread.java:745)
Any idea why I still get null pointer exception fro cache.put()?
Edit: We are using WildFly 13 in domain mode and Infinispan in replication mode. My aim is to store the session object in the infinispan cache and share it between all the nodes.
Infinispan subsystem in domain.xml: This is how I have configured infinispan. We are using only two servers at the moment hence we have gone with replication mode.
<subsystem xmlns="urn:jboss:domain:infinispan:6.0">
<cache-container name="web" aliases="ilsee" default-cache="web_repl" module="org.wildfly.clustering.web.infinispan">
<transport channel="ee" lock-timeout="60000"/>
<local-cache name="Username"/>
<replicated-cache name="web_repl">
<transaction mode="BATCH"/>
</replicated-cache>
<distributed-cache name="dist">
<transaction mode="NON_XA"/>
<file-store/>
</distributed-cache>
</cache-container>
</subsystem>
The answer depends on how you configure your server.
I will provide a generic example.
First, you need to configure your standalone.xml file
<subsystem xmlns="urn:infinispan:server:core:9.2">
<cache-container module="org.infinispan.extension:ispn-9.2" name="infinispan_container" default-cache="default">
<transport/>
<global-state/>
<distributed-cache name="default"/>
<distributed-cache name="myCache"/>
</cache-container>
</subsystem>
Then in your Java application, you need to inject the resource using
#Resource(lookup = "java:jboss/datagrid-infinispan/container/infinispan_container/cache/myCache")
Cache cache;
As you can see infinispan_container and myCache are values that you provided in the XML configuration file.
There are two possible ways for your application to utilize Infinispan within Wildfly: embedded mode and server mode.
You can find more information http://infinispan.org/docs/stable/user_guide/user_guide.html#usage_3

STS Exception when opening xml bean configuration file

I get the following error consistently when opening STS. To reproduce, I have a bean configuration file open in the editor and I exit STS. Then I re-open STS and this exception is thrown and the editor I had open does not start correctly.
If I close the editor throwing the error and then re-open it (without restarting STS), the editor is able to open fine. But then when restarting STS it will still throw this error.
The content of my bean configuration is mostly Spring Integration elements. Here are the schemas I am using:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-file="http://www.springframework.org/schema/integration/file"
xmlns:int-mail="http://www.springframework.org/schema/integration/mail"
xmlns:int-jdbc="http://www.springframework.org/schema/integration/jdbc"
xsi:schemaLocation="http://www.springframework.org/schema/integration/mail http://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc-2.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
The only non-Spring Integration elements are 2 inner-bean definitions for a custom router and a custom transformer:
<int:router id="myrouter" input-channel="routerInput">
<bean class="my.example.Router">
<property name="prop" ref="otherBean"/>
</bean>
</int:router>
<int:transformer input-channel="transformerInput" output-channel="OutboundMail" >
<bean class="my.example.Transformer">
<property name="prop" ref="otherBean"/>
</bean>
</int:transformer>
Stacktrace:
eclipse.buildId=3.6.0.201407101106-RELEASE-e44
java.version=1.7.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.springsource.sts.ide
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.springsource.sts.ide
This is a continuation of log file U:\Users\fgreg\Documents\Workspace\.metadata\.bak_0.log
Created Time: 2014-08-20 07:57:08.801
org.springframework.ide.eclipse.beans.core.metadata
Error
Wed Aug 20 08:00:16 EDT 2014
Problems occurred when invoking code from plug-in: "org.springframework.ide.eclipse.beans.core.metadata".
java.lang.IllegalArgumentException: 'beanName' must not be empty
at org.springframework.util.Assert.hasText(Assert.java:162)
at org.springframework.beans.factory.config.RuntimeBeanReference.<init>(RuntimeBeanReference.java:58)
at org.springframework.beans.factory.config.RuntimeBeanReference.<init>(RuntimeBeanReference.java:46)
at org.springframework.ide.eclipse.beans.core.internal.model.AbstractBeanMethodOverride.<init>(AbstractBeanMethodOverride.java:37)
at org.springframework.ide.eclipse.beans.core.internal.model.BeanLookupMethodOverride.<init>(BeanLookupMethodOverride.java:24)
at org.springframework.ide.eclipse.beans.core.internal.model.Bean.initBean(Bean.java:373)
at org.springframework.ide.eclipse.beans.core.internal.model.Bean.getProperty(Bean.java:192)
at org.springframework.ide.eclipse.data.SpringDataUtils.isRepositoryBean(SpringDataUtils.java:108)
at org.springframework.ide.eclipse.data.metadata.ui.RepositoriesBeanMetadataProvider.provideBeanMetadata(RepositoriesBeanMetadataProvider.java:52)
at org.springframework.ide.eclipse.beans.core.metadata.internal.model.BeanMetadataBuilderJob$1.run(BeanMetadataBuilderJob.java:198)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.springframework.ide.eclipse.beans.core.metadata.internal.model.BeanMetadataBuilderJob.attachMetadataToBean(BeanMetadataBuilderJob.java:191)
at org.springframework.ide.eclipse.beans.core.metadata.internal.model.BeanMetadataBuilderJob.attachMetadata(BeanMetadataBuilderJob.java:170)
at org.springframework.ide.eclipse.beans.core.metadata.internal.model.BeanMetadataBuilderJob.run(BeanMetadataBuilderJob.java:141)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Has anyone seen this before or know how to fix it?
Larger stacktrace from the log file:
!ENTRY org.eclipse.e4.ui.workbench 4 0 2014-08-20 07:57:05.848
!MESSAGE
!STACK 0
java.lang.IllegalArgumentException: 'beanName' must not be empty
at org.springframework.util.Assert.hasText(Assert.java:162)
at org.springframework.beans.factory.config.RuntimeBeanReference.<init>(RuntimeBeanReference.java:58)
at org.springframework.beans.factory.config.RuntimeBeanReference.<init>(RuntimeBeanReference.java:46)
at org.springframework.ide.eclipse.beans.core.internal.model.AbstractBeanMethodOverride.<init>(AbstractBeanMethodOverride.java:37)
at org.springframework.ide.eclipse.beans.core.internal.model.BeanLookupMethodOverride.<init>(BeanLookupMethodOverride.java:24)
at org.springframework.ide.eclipse.beans.core.internal.model.Bean.initBean(Bean.java:373)
at org.springframework.ide.eclipse.beans.core.internal.model.Bean.getProperty(Bean.java:192)
at org.springframework.ide.eclipse.data.SpringDataUtils.isRepositoryBean(SpringDataUtils.java:108)
at org.springframework.ide.eclipse.data.SpringDataUtils.getRepositoryBeansFor(SpringDataUtils.java:130)
at org.springframework.ide.eclipse.data.SpringDataUtils.getRepositoryBeanIds(SpringDataUtils.java:67)
at org.springframework.ide.eclipse.data.beans.ui.editor.RepositoriesReferenceableElementLocator.getReferenceableElements(RepositoriesReferenceableElementLocator.java:55)
at org.springframework.ide.eclipse.beans.ui.editor.util.BeansEditorUtils.getReferenceableNodes(BeansEditorUtils.java:918)
at org.springframework.ide.eclipse.config.graph.model.AbstractConfigGraphDiagram.updateRefNodeRegistry(AbstractConfigGraphDiagram.java:342)
at org.springframework.ide.eclipse.config.graph.model.AbstractConfigGraphDiagram.refreshModelFromXml(AbstractConfigGraphDiagram.java:331)
at org.springframework.ide.eclipse.config.graph.parts.ActivityDiagramPart.refresh(ActivityDiagramPart.java:217)
at org.eclipse.gef.editparts.AbstractEditPart.addNotify(AbstractEditPart.java:253)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotify(AbstractGraphicalEditPart.java:223)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:212)
at org.eclipse.gef.editparts.SimpleRootEditPart.setContents(SimpleRootEditPart.java:105)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:617)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:626)
at org.springframework.ide.eclipse.config.graph.AbstractConfigGraphicalEditor.initializeGraphicalViewer(AbstractConfigGraphicalEditor.java:378)
at org.eclipse.gef.ui.parts.GraphicalEditor.createGraphicalViewer(GraphicalEditor.java:158)
at org.eclipse.gef.ui.parts.GraphicalEditorWithPalette.createPartControl(GraphicalEditorWithPalette.java:63)
at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:243)
at org.eclipse.ui.forms.editor.FormEditor.addPage(FormEditor.java:325)
at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:213)
at org.eclipse.ui.forms.editor.FormEditor.addPage(FormEditor.java:308)
at org.springframework.ide.eclipse.config.ui.editors.AbstractConfigEditor.addConfigEditorPage(AbstractConfigEditor.java:237)
at org.springframework.ide.eclipse.config.ui.editors.AbstractConfigEditor.updateNamespacePages(AbstractConfigEditor.java:936)
at org.springframework.ide.eclipse.config.ui.editors.SpringConfigEditor.updateNamespacePages(SpringConfigEditor.java:189)
at org.springframework.ide.eclipse.config.ui.editors.AbstractConfigEditor.createNamespacePages(AbstractConfigEditor.java:284)
at org.springframework.ide.eclipse.config.ui.editors.AbstractConfigEditor.addPages(AbstractConfigEditor.java:253)
at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:362)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:140)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:99)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:321)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:888)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:869)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:120)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:337)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:258)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:104)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:73)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:55)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:127)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:983)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:662)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:92)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4734)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:218)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:59)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$10.widgetSelected(StackRenderer.java:1035)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:782)
at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3110)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1794)
at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:283)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Well I sort of took the nuclear approach which seems to have fixed the problem. I did 2 things that seemed to have resulted in the issue to resolving itself, I'm not sure which one had greater effect in fixing the problem:
I added the 'name' attribute to my inner bean elements:
<int:router id="myrouter" input-channel="routerInput">
<bean class="my.example.Router" name="router">
<property name="prop" ref="otherBean"/>
</bean>
</int:router>
<int:transformer input-channel="transformerInput" output-channel="OutboundMail" >
<bean class="my.example.Transformer" name="transformer">
<property name="prop" ref="otherBean"/>
</bean>
</int:transformer>
I wiped out everything in my .settings folder and restarted STS
I thought adding the 'name' to the inner beans is what did it so I removed the attribute and then restarted to see if the error would reappear. It did not reappear. So it was either a combination of doing both of these things or it was wiping out the .settings files that did it.

Error in camel route

I am trying to create a simple route in camel,receiving the message from rest uri and storing the message in the cache,I have done the below
my routes are as below
<camel:endpoint id="fooCache1" uri="cache:TestCache1"/> <camel:from uri="cxfrs://bean://rsServer" />
<camel:to uri="log:output?showAll=true" />
<camel:to uri="bean:payProcessor" />
<camel:to uri="direct:start" />
</camel:route>
<camel:route>
<camel:from uri="direct:start" />
<camel:setHeader headerName="CamelCacheOperation">
<camel:constant>CamelCacheAdd</camel:constant>
</camel:setHeader>
<camel:setHeader headerName="CamelCacheKey">
<camel:constant>myCache</camel:constant>
</camel:setHeader>
<camel:to ref="fooCache1"/>
<camel:to uri="log:output?showAll=true" />
</camel:route>
when trying to run it on camel by mvn camel:run I am getting the below error
Error occurred while running main from: org.apache.camel.spring.Main
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:440)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCrea
teRouteException: Failed to create route route2 at: >>> To[ref:fooCache1] <<< in
route: Route[[From[direct:start]] -> [SetHeader[CamelCacheOperation... because
of org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'fooCache1': FactoryBean threw exception on object creation; nested ex
ception is java.lang.NoSuchMethodError: org.apache.camel.util.ObjectHelper.notNu
ll(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHe
lper.java:1271)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringC
amelContext.java:120)
at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(Ca
melContextFactoryBean.java:280)
at org.springframework.context.event.SimpleApplicationEventMulticaster.m
ulticastEvent(SimpleApplicationEventMulticaster.java:97)
at org.springframework.context.support.AbstractApplicationContext.publis
hEvent(AbstractApplicationContext.java:303).....
Can someone please let me know where I am wrong and why the cache bean is not being created..I am at loss with this error.
Thanks in advance.
Check the versions of camel-spring and camel-core components, there seems to be a compatibility issue in your case. Use the same version of both the libraries.
After changing the camel version to 2.12.1 its now working properly..

inbound and outband JMS queue mule class cast

I have got simple setup of mule. Reading from JMS queue processing message and in case of exception sending to DLQ. With Mule 3.3.0 and HornetQ 2.3.0.BETA1. I am getting following exception:
Caused by: java.lang.ClassCastException: org.mule.transport.jms.ReusableTopicSessionWrapper cannot be cast to javax.jms.QueueSession
at org.mule.transport.jms.Jms102bSupport.createDestination(Jms102bSupport.java:231)
at org.mule.transport.jms.Jms11Support.createDestination(Jms11Support.java:142)
at org.mule.transport.jms.JmsMessageDispatcher.dispatchMessage(JmsMessageDispatcher.java:163)
at org.mule.transport.jms.JmsMessageDispatcher.doDispatch(JmsMessageDispatcher.java:81)
at org.mule.transport.AbstractMessageDispatcher.process(AbstractMessageDispatcher.java:99)
... 113 more
My setup:
<jms:connector name="connector.jms" maxRedelivery="10" doc:name="JMS"
jndiInitialFactory="org.jnp.interfaces.NamingContextFactory"
jndiProviderUrl="jnp://localhost:1099"
connectionFactoryJndiName="ConnectionFactory"
createMultipleTransactedReceivers="true"
numberOfConcurrentTransactedReceivers="100"
acknowledgementMode="AUTO_ACKNOWLEDGE">
<reconnect-forever frequency="5000"/>
</jms:connector>
<flow name="jmsListenerFlow1" doc:name="jmsListenerFlow1">
<jms:inbound-endpoint queue="adsLogQueue" connector-ref="connector.jms" doc:name="JMS">
<jms:transaction action="ALWAYS_BEGIN"/>
</jms:inbound-endpoint>
<component >
<spring-object bean="logSaver"/>
</component>
<catch-exception-strategy>
<jms:outbound-endpoint queue="DLQ"> <!-- [2] -->
<jms:transaction action="ALWAYS_JOIN" />
</jms:outbound-endpoint>
</catch-exception-strategy>
</flow>
Can it be bug in Mule itself ? Or am I doing something wrong?
Set specification="1.1" on the jms:connector.

Mule: Why does VM queue break using HTTPS, basic-auth and spring security manager

I am trying to configure some basic HTTP authentication over HTTPS using the spring security manager. I have got this working previously and I have it pretty much working now with one major problem. I get the error below when my flow tries to write the message to a VM queue. My mule config works fine if I remove the the security filter (<http:basic-security-filter realm="mule-realm"/>) line but as soon as this line is present I get the error below. I'm using a custom class as the mule payload, could this be part of the problem?
Any help will be much appreciated, I have run out of ideas...
From the log:
INFO 2012-02-17 11:18:27,188 [[rhea_interoperability_layer_v2].HTTPSConnector.receiver.02] org.mule.api.processor.LoggerMessageProcessor: Structured message: RestfulHttpRequest {
url: ws/rest/v1/facilities
body: null
requestParms: [
sector: Musha
type: test
]} Full Message:
org.mule.DefaultMuleMessage
{
id=59003ade-5948-11e1-b071-65acfd51e8fc
payload=org.jembi.rhea.RestfulHttpRequest
correlationId=<not set>
correlationGroup=-1
correlationSeq=-1
encoding=UTF-8
exceptionPayload=<not set>
Message properties:
INVOCATION scoped properties:
queryTimeout=-1
INBOUND scoped properties:
Accept-Encoding=gzip,deflate
Authorization=Basic YWRtaW46YWRtaW4=
Connection=false
Host=localhost:5000
Keep-Alive=false
MULE_ORIGINATING_ENDPOINT=endpoint.https.localhost.5000
MULE_REMOTE_CLIENT_ADDRESS=/127.0.0.1:43740
User-Agent=Jakarta Commons-HttpClient/3.1
http.context.path=/
http.method=GET
http.request=/ws/rest/v1/facilities?sector=Musha&type=test
http.request.path=/ws/rest/v1/facilities
http.version=HTTP/1.1
sector=Musha
type=test
OUTBOUND scoped properties:
LOCAL_CERTIFICATES=[Ljava.security.cert.X509Certificate;#47abfd68
MULE_ENCODING=UTF-8
MULE_ENDPOINT=jdbc://insertMsg
MULE_ROOT_MESSAGE_ID=59003ade-5948-11e1-b071-65acfd51e8fc
SESSION scoped properties:
}
ERROR 2012-02-17 11:18:27,215 [[rhea_interoperability_layer_v2].HTTPSConnector.receiver.02] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : An exception occurred while invoking message processor "DefaultMessageProcessorChain '(inner iterating chain) of OutboundEndpoint 'vm://normalizationQueue' request chain'
[
org.mule.endpoint.outbound.OutboundEventTimeoutMessageProcessor,
org.mule.endpoint.outbound.OutboundSessionHandlerMessageProcessor,
org.mule.endpoint.outbound.OutboundEndpointPropertyMessageProcessor,
org.mule.endpoint.outbound.OutboundRootMessageIdPropertyMessageProcessor,
org.mule.endpoint.outbound.OutboundResponsePropertiesMessageProcessor
]" with transaction "Transaction{factory=null, action=INDIFFERENT, timeout=0}".. Message payload is of type: RestfulHttpRequest
Type : org.mule.api.MessagingException
Code : MULE_ERROR-29999
Payload : RestfulHttpRequest {
url: ws/rest/v1/facilities
body: null
requestParms: [
sector: Musha
type: test
]}
JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html
********************************************************************************
Exception stack is:
1. org.mule.config.spring.parsers.assembly.MapEntryCombiner (java.io.NotSerializableException)
java.io.ObjectOutputStream:1180 (null)
2. java.io.NotSerializableException: org.mule.config.spring.parsers.assembly.MapEntryCombiner (org.apache.commons.lang.SerializationException)
org.apache.commons.lang.SerializationUtils:111 (null)
3. An exception occurred while invoking message processor "DefaultMessageProcessorChain '(inner iterating chain) of OutboundEndpoint 'vm://normalizationQueue' request chain'
[
org.mule.endpoint.outbound.OutboundEventTimeoutMessageProcessor,
org.mule.endpoint.outbound.OutboundSessionHandlerMessageProcessor,
org.mule.endpoint.outbound.OutboundEndpointPropertyMessageProcessor,
org.mule.endpoint.outbound.OutboundRootMessageIdPropertyMessageProcessor,
org.mule.endpoint.outbound.OutboundResponsePropertiesMessageProcessor
]" with transaction "Transaction{factory=null, action=INDIFFERENT, timeout=0}".. Message payload is of type: RestfulHttpRequest (org.mule.api.MessagingException)
org.mule.processor.TransactionalInterceptingMessageProcessor:63 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
********************************************************************************
Root Exception stack trace:
java.io.NotSerializableException: org.mule.config.spring.parsers.assembly.MapEntryCombiner
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
at java.util.ArrayList.writeObject(ArrayList.java:673)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
at org.apache.commons.collections.map.AbstractHashedMap.doWriteObject(AbstractHashedMap.java:1182)
at org.mule.util.CaseInsensitiveHashMap.writeObject(CaseInsensitiveHashMap.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
at java.util.TreeMap.writeObject(TreeMap.java:2275)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:438)
at org.mule.MessagePropertiesContext.writeObject(MessagePropertiesContext.java:420)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:438)
at org.mule.DefaultMuleMessage.writeObject(DefaultMuleMessage.java:1643)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:141...
********************************************************************************
My flow config
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:https="http://www.mulesoft.org/schema/mule/https" xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security" xmlns:ss="http://www.springframework.org/schema/security" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.2.1" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd
http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/current/mule-jdbc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/spring-security http://www.mulesoft.org/schema/mule/spring-security/3.1/mule-spring-security.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd ">
<mule-ss:security-manager>
<mule-ss:delegate-security-provider name="memory-provider" delegate-ref="authenticationManager"/>
</mule-ss:security-manager>
<spring:beans>
<ss:authentication-manager alias="authenticationManager">
<ss:authentication-provider>
<ss:user-service id="userService">
<ss:user name="admin" password="admin" authorities="ROLE_ADMIN"/>
</ss:user-service>
</ss:authentication-provider>
</ss:authentication-manager>
<spring:bean id="jdbcDataSource" name="jdbcDataSource" class="org.enhydra.jdbc.standard.StandardDataSource" doc:name="jdbcDataSource">
<spring:property name="password" value="${db.password}"/>
<spring:property name="user" value="${db.user}"/>
<spring:property name="url" value="${db.url}"/>
<spring:property name="driverName" value="${db.driverName}"/>
</spring:bean>
</spring:beans>
<context:property-placeholder xmlns:context="http://www.springframework.org/schema/context" location="classpath:my.properties"></context:property-placeholder>
<jdbc:connector name="JDBCConnector" dataSource-ref="jdbcDataSource" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="JDBCConnector"/>
<https:connector name="HTTPSConnector" cookieSpec="netscape" validateConnections="true" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0" proxyHostname="localhost" proxyPort="80" doc:name="HTTPSConnector">
<https:tls-key-store path="keystore.jks" keyPassword="Jembi#123" storePassword="Jembi#123"/>
</https:connector>
<flow name="RESTEntryPoint" doc:name="RESTEntryPoint">
<https:inbound-endpoint exchange-pattern="request-response" host="localhost" port="5000" connector-ref="HTTPSConnector" doc:name="HTTP">
<http:basic-security-filter realm="mule-realm"/>
</https:inbound-endpoint>
<response>
<custom-transformer class="org.jembi.rhea.transformers.RestfulHttpResponseToHttpResponseTransformer" doc:name="RestfulHttpResponseToHttpResponseTransformer"/>
<logger message="Transaction responce sent from entry point: #[groovy:return message.toString();] with payload #[groovy:return message.payload.toString();]" level="INFO" doc:name="Logger"/>
</response>
<logger message="Message recieved at entry point: #[groovy:return message.toString();] with payload #[groovy:return message.payload.toString();]" level="INFO" doc:name="Log raw message"/>
<custom-transformer class="org.jembi.rhea.transformers.HttpRequestToRestfulHttpRequestTransformer" doc:name="HttpRequestToRestfulHttpRequestTransformer"/>
<logger message="Structured message: #[groovy: message.payload.toString();]" level="INFO" doc:name="Log Structured Message"/>
<jdbc:outbound-endpoint exchange-pattern="request-response" queryKey="insertMsg" responseTimeout="10000" queryTimeout="-1" connector-ref="JDBCConnector" doc:name="Persist raw message">
<jdbc:query key="insertMsg" value="insert into inbound_messages (payload, timestamp) values (#[groovy: return message.payload.toString();], now());"/>
</jdbc:outbound-endpoint>
<choice doc:name="Choice">
<when expression="message.getInboundProperty('X-SENDING-APP') != null" evaluator="groovy">
<processor-chain>
<logger message="Propagating sending app header" level="INFO" doc:name="Log propagate sending app header"/>
<message-properties-transformer doc:name="Propagate sending app header">
<add-message-property key="X-SENDING-APP" value="#[header:inbound:X-SENDING-APP]"/>
</message-properties-transformer>
</processor-chain>
</when>
<otherwise>
<processor-chain>
<logger message="No sending app header detected" level="INFO" doc:name="Log no sending app header"/>
</processor-chain>
</otherwise>
</choice>
<message-properties-transformer scope="invocation" doc:name="Message Properties">
<delete-message-property key="queries"/>
<delete-message-property key="LOCAL_CERTIFICATES"/>
</message-properties-transformer>
<logger message="Structured message: #[groovy: message.payload.toString();] Full Message: #[groovy: message.toString();]" level="INFO" doc:name="Log Structured Message"/>
<vm:outbound-endpoint exchange-pattern="request-response" path="normalizationQueue" responseTimeout="10000" mimeType="text/plain" doc:name="Queue message"/>
</flow>
</mule>
The custom payload class
package org.jembi.rhea;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
public class RestfulHttpRequest implements Serializable {
private static final long serialVersionUID = 1L;
private String url;
private String body;
private String httpMethod;
// automatically extracted when a url is set
private Map<String, String> requestParams = new HashMap<String, String>();
// HTTPMethods
public static String HTTP_GET = "GET";
public static String HTTP_POST = "POST";
public static String HTTP_PUT = "PUT";
public static String HTTP_DELETE = "DELETE";
... getters and setters for the above ...
}
There doesn't seem to be a VM consumer for the endpoint in your config, the only thing Mule can do is 'store' messages for this queue, and this requires payloads to be serializable in turn. Either add a consumer to the 'normalizationQueue' or make sure the payload is serializable.
Ok, so I don't have an answer of exactly why this was happening but I managed to solve the problem. All I did was move the all the jdbc stuff out to a separate flow that gets called after this one. This solved my problem and all is now running smoothly.

Resources