CXF Webservice issue in weblogic server - java

I am trying to call a webservice from my webapplication which works fine with servers like Apache Tomcat or JBoss, but fails with below exception in Weblogic server.
Any solution for this ?
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:379)
at org.apache.geronimo.osgi.locator.ProviderLocator.getService(ProviderLocator.java:234)
at javax.xml.ws.spi.FactoryFinder$3.run(FactoryFinder.java:176)
at javax.xml.ws.spi.FactoryFinder.doPrivileged(FactoryFinder.java:220)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:160)
at javax.xml.ws.spi.Provider.provider(Provider.java:43)
at javax.xml.ws.Service.<init>(Service.java:35)
at com.my.Tpackage.imageSign.FIUsbWebServiceService.<init>(FIUsbWebServiceService.java:40)
at com.my.Tpackage.imageSign.SignatureWebServiceClient.getWebServiceResponse(SignatureWebServiceClient.java:32)
at com.my.Tpackage.imageSign.MyAction.getMySignatureImage(MyAction.java:47)
at com.my.Tpackage.imageSign.MyAction.execute(MyAction.java:28)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at com.montran.security.SecureRequestProcessor.processActionPerform(SecureRequestProcessor.java:707)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at com.montran.main.action.InheritanceActionServet.process(InheritanceActionServet.java:332)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.my.security.ActivityLoggingFilter.doFilter(ActivityLoggingFilter.java:88)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.my.security.AuthenticationFilter.doFilter(AuthenticationFilter.java:179)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.my.security.InjectionFilter.filter(InjectionFilter.java:453)
at com.my.security.InjectionFilter.doFilter(InjectionFilter.java:360)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference.
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:237)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:232)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:232)
at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:95)
... 44 more
Caused by: javax.xml.bind.JAXBException
- with linked exception:
[com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
org.w3c.dom.Element is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at org.w3c.dom.Element
at public java.util.List com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements.elements
at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements
at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements com.sun.xml.ws.developer.MemberSubmissionEndpointReference.referenceProperties
at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:263)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:235)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:432)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:637)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:584)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:235)
... 48 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
org.w3c.dom.Element is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at org.w3c.dom.Element
at public java.util.List com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements.elements
at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements
at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements com.sun.xml.ws.developer.MemberSubmissionEndpointReference.referenceProperties
at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:106)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:466)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:298)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:141)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1163)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145)
at sun.reflect.GeneratedMethodAccessor122.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:248)
... 53 more

In your weblogic-application.xml you must define your JAXB-provider to be the one from cxf not the sun reference implementation (com.sun.xml...).
Add the following to the mentioned file
<prefer-web-inf-classes>true</prefer-web-inf-classes>
This leads to reversing the classloading process. So the classes you provide with your war are loaded before the ones from weblogic.
EDIT:
The Documentation for Provider says:
The algorithm used to locate the provider subclass to use consists of
the following steps:
If a resource with the name of META-INF/services/javax.xml.ws.spi.Provider exists, then its first
line, if present, is used as the UTF-8 encoded name of the
implementation class.
If the $java.home/lib/jaxws.properties file exists and it is readable by the java.util.Properties.load(InputStream) method and it
contains an entry whose key is javax.xml.ws.spi.Provider, then the
value of that entry is used as the name of the implementation class.
If a system property with the name javax.xml.ws.spi.Provider is defined, then its value is used as the name of the implementation
class.
Finally, a default implementation class name is used.
so, if the changing the classloading is not enough add the following
<prefer-application-resources>
<resource-name>META-INF/services/javax.xml.ws.spi.Provider</resource-name>
</prefer-application-resources>
to weblogic-application.xml

Related

Hazelcast Hibernate Enum Serialization/Deserialization Exception

I am trying to integrate hazelcast with a Spring boot project for hibernate L2 cache.
Hazelcast - 3.9.4
hazelcast-hibernate4
Setting up Hibernate L2 cache in Cluster Mode and connecting like a Native client.
The setup works fine (both for L2+Query cache) and I can see data in my cluster .
But now a weird Exception is coming:-
SEVERE: [10.129.252.157]:5701 [dev] [3.9.4]
java.io.InvalidObjectException: enum constant DUMMY does not exist in class com.shared.api.bean.pg.PG
com.hazelcast.nio.serialization.HazelcastSerializationException: java.io.InvalidObjectException: enum constant DUMMY does not exist in class com.shared.api.bean.pg.PG
at com.hazelcast.internal.serialization.impl.SerializationUtil.handleException(SerializationUtil.java:63)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.readObject(AbstractSerializationService.java:279)
at com.hazelcast.internal.serialization.impl.ByteArrayObjectDataInput.readObject(ByteArrayObjectDataInput.java:574)
at com.hazelcast.hibernate.serialization.Value.readData(Value.java:76)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.readInternal(DataSerializableSerializer.java:158)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.read(DataSerializableSerializer.java:105)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.read(DataSerializableSerializer.java:50)
at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:48)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.toObject(AbstractSerializationService.java:191)
at com.hazelcast.query.impl.CachedQueryEntry.getValue(CachedQueryEntry.java:75)
at com.hazelcast.hibernate.distributed.LockEntryProcessor.process(LockEntryProcessor.java:49)
at com.hazelcast.hibernate.distributed.LockEntryProcessor.process(LockEntryProcessor.java:32)
at com.hazelcast.map.impl.operation.EntryOperator.process(EntryOperator.java:335)
at com.hazelcast.map.impl.operation.EntryOperator.operateOnKeyValueInternal(EntryOperator.java:194)
at com.hazelcast.map.impl.operation.EntryOperator.operateOnKey(EntryOperator.java:179)
at com.hazelcast.map.impl.operation.EntryOperation.runVanilla(EntryOperation.java:395)
at com.hazelcast.map.impl.operation.EntryOperation.run(EntryOperation.java:177)
at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:194)
at com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl.run(OperationExecutorImpl.java:406)
at com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl.runOrExecute(OperationExecutorImpl.java:433)
at com.hazelcast.spi.impl.operationservice.impl.Invocation.doInvokeLocal(Invocation.java:569)
at com.hazelcast.spi.impl.operationservice.impl.Invocation.doInvoke(Invocation.java:554)
at com.hazelcast.spi.impl.operationservice.impl.Invocation.invoke0(Invocation.java:513)
at com.hazelcast.spi.impl.operationservice.impl.Invocation.invoke(Invocation.java:207)
at com.hazelcast.spi.impl.operationservice.impl.InvocationBuilderImpl.invoke(InvocationBuilderImpl.java:60)
at com.hazelcast.client.impl.protocol.task.AbstractPartitionMessageTask.processMessage(AbstractPartitionMessageTask.java:67)
at com.hazelcast.client.impl.protocol.task.AbstractMessageTask.initializeAndProcessMessage(AbstractMessageTask.java:123)
at com.hazelcast.client.impl.protocol.task.AbstractMessageTask.run(AbstractMessageTask.java:103)
at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:154)
at com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.process(OperationThread.java:125)
at com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.run(OperationThread.java:100)
Caused by: java.io.InvalidObjectException: enum constant DUMMY does not exist in class com.shared.api.bean.pg.PG
at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
at java.util.HashMap.readObject(HashMap.java:1404)
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1909)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
at com.hazelcast.internal.serialization.impl.JavaDefaultSerializers$JavaSerializer.read(JavaDefaultSerializers.java:79)
at com.hazelcast.internal.serialization.impl.JavaDefaultSerializers$JavaSerializer.read(JavaDefaultSerializers.java:72)
at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:48)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.readObject(AbstractSerializationService.java:273)
... 29 more
Caused by: java.lang.IllegalArgumentException: com.shared.api.bean.pg.PG is not an enum type
at java.lang.Class.enumConstantDirectory(Class.java:3344)
at java.lang.Enum.valueOf(Enum.java:232)
at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1750)
... 44 more
I also tried to Java serialization/Deserialization and able to retreive the values from my Enum
What can be the issue with Hazelcast Serialization/Deserialization?
Hz Config:-
<map name="com.entity.*">
<in-memory-format>BINARY</in-memory-format>
<backup-count>0</backup-count>
<async-backup-count>0</async-backup-count>
<time-to-live-seconds>0</time-to-live-seconds>
<max-idle-seconds>0</max-idle-seconds>
<eviction-policy>LRU</eviction-policy>
<max-size policy="PER_NODE">10000</max-size>
<eviction-percentage>20</eviction-percentage>
<merge-policy>com.hazelcast.map.merge.PassThroughMergePolicy</merge-policy>
<read-backup-data>false</read-backup-data>
<cache-deserialized-values>INDEX-ONLY</cache-deserialized-values>
</map>

java.lang.NoClassDefFoundError: Could not initialize class

I'm trying to download a report from BingAds. My code works inside IDEA downloading the report, no big issue. When I try to make it run inside sbt like:
H24_BING_CONFIG=/home/oleber/del/develop_bing.json sbt clean 'project importerBing' 'run'
The execution fails like:
[oleber] [WARN] [home24-aws] [org.apache.cxf.transport.https.HttpsURLConnectionFactory] [Default key managers cannot be initialized: /home/oleber/.keystore (No such file or directory)]
[oleber] [WARN] [home24-aws] [org.apache.cxf.transport.https.HttpsURLConnectionFactory] [Default key managers cannot be initialized: /home/oleber/.keystore (No such file or directory)]
java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at javax.xml.soap.FactoryFinder.newInstance(FactoryFinder.java:47)
at javax.xml.soap.FactoryFinder.find(FactoryFinder.java:194)
at javax.xml.soap.FactoryFinder.find(FactoryFinder.java:98)
at javax.xml.soap.SAAJMetaFactory.getInstance(SAAJMetaFactory.java:74)
at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:146)
at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:111)
at org.apache.cxf.binding.soap.saaj.SAAJFactoryResolver.createMessageFactory(SAAJFactoryResolver.java:56)
at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor.getFactory(SAAJOutInterceptor.java:87)
at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor.handleMessage(SAAJOutInterceptor.java:123)
at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:120)
at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:71)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:416)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:394)
at org.apache.cxf.jaxws.JaxWsClientProxy.invokeAsync(JaxWsClientProxy.java:297)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:136)
at com.sun.proxy.$Proxy68.submitGenerateReportAsync(Unknown Source)
at com.microsoft.bingads.reporting.ReportingServiceManager.submitDownloadAsync(ReportingServiceManager.java:196)
at importer.bing.BingAdsImporterDownloader.submit(BingAdsImporterDownloader.scala:104)
at importer.bing.BingAdsImporterDownloader$$anonfun$process$1$$anonfun$apply$2.apply(BingAdsImporterDownloader.scala:171)
at importer.bing.BingAdsImporterDownloader$$anonfun$process$1$$anonfun$apply$2.apply(BingAdsImporterDownloader.scala:170)
at common.ManagedResource$.withTmpDir(ManagedResource.scala:47)
at importer.bing.BingAdsImporterDownloader$$anonfun$process$1.apply(BingAdsImporterDownloader.scala:170)
at importer.bing.BingAdsImporterDownloader$$anonfun$process$1.apply(BingAdsImporterDownloader.scala:159)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:253)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at javax.xml.soap.FactoryFinder.newInstance(FactoryFinder.java:47)
at javax.xml.soap.FactoryFinder.find(FactoryFinder.java:194)
at javax.xml.soap.FactoryFinder.find(FactoryFinder.java:98)
at javax.xml.soap.SAAJMetaFactory.getInstance(SAAJMetaFactory.java:74)
at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:146)
at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:111)
at org.apache.cxf.binding.soap.saaj.SAAJFactoryResolver.createMessageFactory(SAAJFactoryResolver.java:56)
at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor.getFactory(SAAJOutInterceptor.java:87)
at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor.handleMessage(SAAJOutInterceptor.java:123)
at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:120)
at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:71)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:416)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:394)
at org.apache.cxf.jaxws.JaxWsClientProxy.invokeAsync(JaxWsClientProxy.java:297)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:136)
at com.sun.proxy.$Proxy68.submitGenerateReportAsync(Unknown Source)
at com.microsoft.bingads.reporting.ReportingServiceManager.submitDownloadAsync(ReportingServiceManager.java:196)
at importer.bing.BingAdsImporterDownloader.submit(BingAdsImporterDownloader.scala:104)
at importer.bing.BingAdsImporterDownloader$$anonfun$process$1$$anonfun$apply$2.apply(BingAdsImporterDownloader.scala:171)
at importer.bing.BingAdsImporterDownloader$$anonfun$process$1$$anonfun$apply$2.apply(BingAdsImporterDownloader.scala:170)
at common.ManagedResource$.withTmpDir(ManagedResource.scala:47)
at importer.bing.BingAdsImporterDownloader$$anonfun$process$1.apply(BingAdsImporterDownloader.scala:170)
at importer.bing.BingAdsImporterDownloader$$anonfun$process$1.apply(BingAdsImporterDownloader.scala:159)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:253)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
The warnings are in both places.
I'm completely lost. Do you have any possible solution?
The warnings about the keystore are not relevant to the exceptions.
The problem is most probably that the failing build is lacking dependencies surrounding com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl. IDEA probably delivers that dependency. This is possible since internal builds may live in another build environment (classpath/target platform).
The most common reasons for NoClassDefFoundErrors are exceptions thrown in static initializers of referenced classes (ExceptionInInitializer as root cause) and ClassNotFoundExceptions for referenced classes. The latter is what would happen if a dependency of the SAAJMetaFactoryImpl is missing, but not the library with the FactoryImpl itself.
I suspect the exception contains another Caused-By chain link which in turn contains the root cause of that exception, mentioning the actually missing class. Maybe you can reconfigure the build to display the complete cause-chain of thrown exceptions.
In general, try to compare the two build environments with respect to the target platforms they use to resolve dependencies. This makes the missing libraries obvious.

Unable to reconnect with Hornet, Wildfly, JMS

I am trying to use JMS with wildfly but getting this error in wildfly server log. Can anyone tell me whats wrong I am doing?
2015-05-27 17:10:09,292 ERROR [org.hornetq.ra] (default-threads - 4) HQ154003: Unable to reconnect org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter#19213379 connectionFactoryLookup=null destination=queue/freightdesk.xmlintmanager.inbound destinationType=javax.jms.Queue selector=MESSAGETYPE = 'ORHFA' ack=Auto-acknowledge durable=false clientID=null user=null maxSession=15): java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.jboss.classfilewriter.ClassFile.define(ClassFile.java:282)
at org.jboss.invocation.proxy.AbstractClassFactory.defineClass(AbstractClassFactory.java:164)
at org.jboss.invocation.proxy.AbstractClassFactory.newInstance(AbstractClassFactory.java:225)
at org.jboss.invocation.proxy.ProxyFactory.newInstance(ProxyFactory.java:270)
at org.jboss.as.ejb3.inflow.JBossMessageEndpointFactory.createEndpoint(JBossMessageEndpointFactory.java:70)
at org.jboss.as.ejb3.inflow.JBossMessageEndpointFactory.createEndpoint(JBossMessageEndpointFactory.java:62)
at org.hornetq.ra.inflow.HornetQMessageHandler.setup(HornetQMessageHandler.java:198) [hornetq-ra-2.4.5.Final.jar:]
at org.hornetq.ra.inflow.HornetQActivation.setup(HornetQActivation.java:340) [hornetq-ra-2.4.5.Final.jar:]
at org.hornetq.ra.inflow.HornetQActivation.handleFailure(HornetQActivation.java:768) [hornetq-ra-2.4.5.Final.jar:]
at org.hornetq.ra.inflow.HornetQActivation$SetupActivation.run(HornetQActivation.java:823) [hornetq-ra-2.4.5.Final.jar:]
at org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:219)
at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808)
at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:828)
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) [:1.8.0_40]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_40]
at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_40]
at org.jboss.classfilewriter.ClassFile.define(ClassFile.java:277)
... 16 more
Caused by: java.lang.VerifyError: class com.freightdesk.fdfoliox.organization.mdb.XMLOrgFindAddListener$$$endpoint11 overrides final method onMessage.(Ljavax/jms/Message;)V
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.8.0_40]
at java.lang.ClassLoader.defineClass(ClassLoader.java:760) [rt.jar:1.8.0_40]
... 20 more
Check the default constructor of your service implementation classes. Make sure it's public.
The stack trace shows that it tried to perform a new MyServiceImpl() using reflection (i.e. MyServiceImpl.class.newInstance()). Given the fact that it failed, it could be because there was no public constructor.
class MyServiceImpl extends MyService
{
public MyServiceImpl(){}
}

send email in java by outlook

I found a package that might help me send mails from my java using my outlook and it is called Java Outlook Connector.
i put the code and compile normally but when i send the email an error occurs.
this error is that java didnt find my class imported. on the other hand i imported the classes carefully and inserted them in my Jdeveloper library but still the error is appearing.
i think mainly the error now is due to not setting the java library path correctly. how can i solve this problem?
Below is my code and my error
Thank you
import com.moyosoft.connector.com.*;
import com.moyosoft.connector.exception.*;
import com.moyosoft.connector.ms.outlook.*;
import com.moyosoft.connector.ms.outlook.folder.*;
import com.moyosoft.connector.ms.outlook.item.*;
import com.moyosoft.connector.ms.outlook.mail.*;
public void testbutton_action() {
try
{
// System.load("C:\\Program Files (x86)\\Java\\jdk1.7.0_71\\bin\\moyocore_x64.dll");
// Outlook.setLibraryPath("C:\\Program Files (x86)\\Java\\jdk1.7.0_71\\bin\\moyocore.dll");
// Outlook application
Outlook outlookApplication = new Outlook();
// Get the Outbox folder
OutlookFolder outbox = outlookApplication.getDefaultFolder(FolderType.OUTBOX);
// Create a new mail in the outbox folder
OutlookMail mail = (OutlookMail) outbox.createItem(ItemType.MAIL);
// Set the subject, destination and contents of the mail
mail.setSubject("Hello world !");
mail.setTo("me#test.com");
mail.setBody("This is a test message.");
// Send the mail
mail.send();
// Dispose the library
outlookApplication.dispose();
}
catch(ComponentObjectModelException ex)
{
System.out.println("COM error has occured: ");
ex.printStackTrace();
}
catch(LibraryNotFoundException ex)
{
// If this error occurs, verify the file 'moyocore.dll' is present
// in java.library.path
System.out.println("The Java Outlook Library has not been found.");
ex.printStackTrace();
}
}
Below is the error
javax.faces.el.EvaluationException: //C:/Users/Darwish/AppData/Roaming/JDeveloper/system11.1.2.4.39.64.36.1/o.j2ee/drs/New/Project1WebApp.war/fields.jsf #9,70 action="#{TheBean.testbutton_action}": java.lang.NoClassDefFoundError: com/moyosoft/connector/com/ComponentObjectModelException
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:973)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:354)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: java.lang.NoClassDefFoundError: com/moyosoft/connector/com/ComponentObjectModelException
at project1.TheBeanC.testbutton_action(TheBeanC.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
... 44 more
Caused by: java.lang.ClassNotFoundException: com.moyosoft.connector.com.ComponentObjectModelException
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
... 53 more
You can send emails using the "normal" method even if you only have intranet. Outlook is nothing fancy other than an User friendly interface for the email system. To be precise, you can send email using smtp protocal as long as you can connect to your mailing server even if it is intranet.
Outlook is a COM server which you can automate using the OLE COM technology. I don't use Java for developing, but I hope you will find how to call the COM servers in Java, for example - Is there OLE Automation in Java?. See Using Automation to Send a Microsoft Outlook Message. It shows you how to use Automation to create and send a Microsoft Outlook message.
Also you may find the How to automate Outlook from another program article helpful.
i fount the answer
the problem was in the library path
i just needed to go to the library options in Jdeveloper and reselect the library in the JAR/Directory

java.lang.ClassCastException in WebLogic 10.3.3 after recompile

While editing some code a developer noticed this error after a recompile in Weblogic 10.3.3. And the underlying object is a DimensionLabel. And we tried this in Weblogic 9.2 and it works fine with no exception. The developer simply recompiled the class calling the DimensionLabel the SearchServiceProcessor and reran the application.
net.nrj.service.SearchServiceProcessor java.lang.ClassCastException: net.nrj.alf.DimensionLabel
java.lang.ClassCastException: net.nrj.alf.DimensionLabel
at net.nrj.service.SearchServiceProcessor.setRefinements(SearchServiceProcessor.java:911)
at net.nrj.service.SearchServiceProcessor.process(SearchServiceProcessor.java:134)
at net.nrj.service.ServiceController.processRequest(ServiceController.java:323)
at net.nrj.service.ServiceController.doGet(ServiceController.java:307)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:529)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:719)
at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:591)
at weblogic.servlet.FileServlet.findSource(FileServlet.java:270)
at weblogic.servlet.FileServlet.doGetHeadPost(FileServlet.java:191)
at weblogic.servlet.FileServlet.service(FileServlet.java:173)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3686)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Here is my code :
DimensionLabel dimLabel = (DimensionLabel);
dimensionLabel.get(currentDimension.getName());
currentRefinementDimension = new Refinement(); // Exception here
currentRefinementDimension.setExpanded(true);
I debugged into the code and the hashtable dimensionLabel has a DimensionLabel in it.
If you can debug into the code then check from where your class is being called from. Generally you need to call
this.getClass().getProtectionDomain().getCodeSource().getLocation()
This will tell you the jar from which your classes are loaded. Check if there is a jar conflict(old jar etc.)

Categories

Resources