I just want to know the inputs for below questions.
what version of AXIS2 will come with Websphere 8.5.5.2?
Where can i see the version details of AXIS2 jars shipped with WAS 8.5.5.2?
My code actually compiled with AXIS2 1.6.1 and deployed the same in WAS 8.5.5.2. I am getting below classcast exceptions. What could your suggestions to resolve this issue. I thought there is problem with different versions of axis2 while compiling and deploying. I am not able to know what version of axis2 shipped with websphere 8.5.5.2.
Approaches I have used.
1) Part of code which uses Axis was compiled against AXIS2 1.6.1 version and generated war was deployed in WAS 8.5.5.2 with no libraires in WAR. Got classNotFoundException for org.apache.axiom.util.stax.XMLStreamWriterUtils. Added org.apache.axis2.jar located in plugins in shared libraries and attached to my server war module level. Then class cast exception came.
2) Part of code which uses Axis was compiled against AXIS2 1.6.1 and generated war was deployed in WAS 8.5.5.2 with org.apache.axis2.jar under WEB-INF/libraires in WAR. Then class cast exception came.
Calling getRendererRef(): renderer Type=[OutInRenderer]
WSRenderer I Start:
WSRenderer E Unable to perform rendering due to exception (java.lang.ClassCastException: org.apache.axiom.util.stax.xop.XOPEncodingStreamWriter incompatible with org.apache.axiom.ext.stax.datahandler.DataHandlerWriter)
WSRenderer E stacktrace=org.apache.axiom.util.stax.XMLStreamWriterUtils.internalGetDataHandlerWriter(XMLStreamWriterUtils.java:71)
org.apache.axiom.util.stax.XMLStreamWriterUtils.writeDataHandler(XMLStreamWriterUtils.java:134)
3) Kept Parent_LAST option in WAS 8.5.5.2 for server war which results plenty of errors related to parsers and other. Application stopped working because of many classcast and incompatible issues.
Any inputs are appreciable...
The code in the WebSphere runtime is not based on an official release of Apache Axis2, but on a fork created from a development version. Your only option to use Axis2 on WebSphere is to configure your application with parent last class loading. To make this work you need to remove from your application all the JARs containing APIs that must be loaded from the server runtime, such as the servlet API and various XML APIs.
Related
I am using weblogic 10.3.6.0 application server for deploying application . after
deploying one of the application which uses JDK8. at run time I got the following error.
java.lang.NoSuchMethodError: javax.servlet.http.Cookie.setHttpOnly(Z)V
contents of dependencies.gradle file are as follows
providedCompile 'javax.servlet:javax.servlet-api:3.0.1'
What would be the reason behind this error?
Cookie.setHttpOnly() is available since Servlet 3.0. You are deploying to WebLogic 10 which provides only Servlet 2.5.
Note that your project is compiling against an API dependency and not the actual runtime implementation. This is correct project setup, don't change it. However you must ensure that the APIs that you selected for compilation are provided in the runtime by deploying to the correct server.
As others have said, you are compiling against the wrong servlet jar for your version of weblogic. If you want to keep using weblogic 10 then you should change to
providedCompile 'javax.servlet:javax.servlet-api:2.5'
Once you do this I'm guessing you'll get a compilation error for Cookie.setHttpOnly().
Out of interest, why are you using weblogic? There's many free / open source servlet containers that are far better than weblogic. Weblogic doesn't conform to the same standards as the rest of the servlet containers.
I am using fabric-sdk-java client to interact with my Hyperledger Fabric V1.0 network setup locally. Everything is working fine when running the client as standalone java application. But when I am using the same within the application.ear which is deployed in Weblogic 12c server, I am getting the following exception
Caused by: java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.platformThreadFactory()Ljava/util/concurrent/ThreadFactory;
at io.grpc.internal.GrpcUtil.getThreadFactory(GrpcUtil.java:482)
at io.grpc.internal.GrpcUtil$1.create(GrpcUtil.java:421)
at io.grpc.internal.GrpcUtil$1.create(GrpcUtil.java:417)
at io.grpc.internal.SharedResourceHolder.getInternal(SharedResourceHolder.java:104)
at io.grpc.internal.SharedResourceHolder.get(SharedResourceHolder.java:74)
at io.grpc.internal.SharedResourcePool.getObject(SharedResourcePool.java:35)
at io.grpc.internal.ManagedChannelImpl.<init>(ManagedChannelImpl.java:383)
at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:331)
at org.hyperledger.fabric.sdk.OrdererClient.sendDeliver(OrdererClient.java:220)
at org.hyperledger.fabric.sdk.Orderer.sendDeliver(Orderer.java:172)
at org.hyperledger.fabric.sdk.Channel.seekBlock(Channel.java:1198)
at org.hyperledger.fabric.sdk.Channel.getLatestBlock(Channel.java:1274)
at org.hyperledger.fabric.sdk.Channel.getLastConfigIndex(Channel.java:1097)
at org.hyperledger.fabric.sdk.Channel.getConfigurationBlock(Channel.java:1028)
at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(Channel.java:949)
at org.hyperledger.fabric.sdk.Channel.initialize(Channel.java:676)
......
Since all of these dependencies are inside fabric-sdk-java I am not sure where to do its fix. I had seen some post telling it is the issue with guava version. fabric-sdk-java having the dependency with guava version 19.
I don't understand why it is working while running as standalone java application, but this issues coming after deploying in Weblogic 12c server.
Do I need to add anything more to work this in Weblogic 12c server?
99% of such exceptions are caused by mismatched versions. For example, the method was not present in previous version, but was added in the latter, and you are using the previous version. So the class is there (it's not a ClassNotFoundException), but it does not have a method with this specific signature the calling code expects.
You should carefully examine your classpath. Locate the jar which contains the com.google.common.util.concurrent.MoreExecutors class. Check that you don't have two by some mistake. And try to find an official combination of jars that are known to work together.
And of course, welcome to classpath hell!
I used to saw a tutorial about this topic. But when I try to make my example application by following the example. I can't find com.sun.xml.ws.transport.http.servlet.WSServletContextListener on my classpath.
but I found com.sun.xml.internal.ws.transport.http.servlet.WSServletContextListener
It confused me, why Oracle move those classes in com.sun.xml.xxx to com.sun.xml.internal? I am using JDK1.6.0_45. I saw some people said, form JDK6U4, jax-ws reference implementation is bundled in JDK, so we should be able to publish a web service by running a light weight http server just with JDK and no other dependencies needed, is that ture? You should notice that in the tutorial I mentioned above, additional dependencies is still needed, see step 5 "JAX-WS Dependencies".
And I also found that in IBM JDK, even com.sun.xml.internal.ws.transport.http.servlet.WSServletContextListener can't be found.
Yes, JAX-WS RI (same as JAX-B RI) is shipped with JDK since Jdk6. All the packages except for javax.xml.* are changed to .internal. in order to avoid conflicts between JDK's and standalone JAX-WS versions.
Using JDK's version, you can deploy web service using just JDK; if you want deploy WS in tomcat or in some AS, you still need JAX-WS standalone version.
If you check grepcode for (non-internal) WSServletContextListener, it shows you, the class is shipped with jaxws-rt/webservice-rt jar.
By looking for the internal WSServletContextListener, you can't find a jar shipping it. (but grepcode also contains the sources of openJDK)
Also, I tried to find WSServletContextListener in my local jdk7, but can't find it. But maybe some third-party jdk ship with the class.
Anyway, if you look into the tutorial again, you will find that jaxws-rt.jar is necessery for the application. Probably you should add it?
I'm stepping through this tutorial:
http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html
I'm trying to select the axis2 Web Service facet (step 6) but I'm getting this error message in eclipse:
"Axis2 Web Services Core 1.1 requires Dynamic Web Module with version matching expression "2.2,2.3,2.4,2.5"
Update: I had downloaded and installed axis2 1.5.4 and then in eclipse I went into "windows->preferences->web services->axis2 preferences". Under the "axis2 runtime" tab I specified the axis2 location. The message "Axis2 runtime loaded successfully" appeared.
I don't know why it says "Axis2 Web Services Core 1.1". Does eclipse wtp come bundled with axis2 1.1 or is there a separate version # for the axis core from the overall axis version #?
Change the Dynamic web module version to lower.
I used java 1.5 and
Dynamic web module version-3.0 So its raised an error. Then I changed the version 2.5. Now its not showing any error
#Yasin - you were right, it was merely a mater of changing the Dynamic web module to a previous version. I wasn't aware that the earlier versions had also been installed.
I'd give you credit for the answer, but since you just left a comment I just up-voted your comment.
when I switched it to a lower version. It says
cannot change version of project facet Dynamic Web Module to 2.5
Actually you should select project web module version to 2.5 or lower during the initial creation of the project. If you do it later, it won't accept it and cause an error.
I'm trying to deploy an Axis2 web service to an OC4J 10.1.3 app server.
I was using axis 1.4 before and had just created my own shared library with all of the files. There was an issue with 1.4 that was patched with 1.5 so now I'm using that but it does not include all of the libraries. This time I deployed the axis2.war to the OC4J server and I'm using the axis2 admin page to attempt to deploy my web service.
If I deploy a web service through axis2 then I'll get a java.lang.NoSuchMethodError: javax.jws.WebMethod.exclude()Z but I cannot find the conflicting library. Axis2 has the new jax-ws libraries in it but I think it's an issue on the OC4J app server. I excluded xml.jar (since it has old JAXB 1.0 libs) and this resolves the issue on my local machine but not on the linux box.
I tried editing the deployment plan to search local folders first and this allows me to deploy the service, but when I try to access it, or the WSDL, then I get an error regarding a class cast exception and JXDocumentBuilderFactory (I don't have the exact error at this moment).
I compared the shared libraries on the linux box with the ones on my local machine and I used the same ones on each (I didn't verify the versions of each jar, though). If axis2 is deployed to OC4J and I deploy my service to axis2 then wouldn't I inherit the axis2 libraries (jax-ws, etc)?
Try removing the inherited library in conflict by adding this to your orion-application.xml:
<orion-application>
<imported-shared-libraries>
<remove-inherited name="PUT_HERE_THE_NAME_OF_THE_LIBRARY"/>
</imported-shared-libraries>
</orion-application>
More here: Removing and/or Replacing an Oracle Shared Library Imported by Default
Edit:
I searched the shared libraries and found that is not there, jws-api.jar is loaded at boot time and can't be removed easily:
Replace the OC4J JAX-WS Libraries
OC4J has preliminary support for JAX-WS, unfortunately this means that during OC4J boot it loads outdated JAX-WS APIs and implementation by Oracle. This occurs even before shared libraries comes into action, at a very early stage of OC4J boot.
Boot-time OC4J libraries are configured in boot.xml file in $ORACLE_HOME/j2ee/home/oc4j.jar bootstrap jar. To get rid of this:
1-Copy the jar file to ${oracle.home}/webservices/lib/jaxws
2-Unpack the OC4J.jar file
3-Locate META-INF/boot.xml
4-Replace path in this line with your jar:
<code-source
path="${oracle.home}/webservices/lib/jws-api.jar"
if="java.specification.version == /1\.[5-6]/"
/>
5-Repackage oc4j.jar (don't forget about MANIFEST.MF - use jar -m META-INF/MANIFEST.MF)
Original article: OC4J Configuration for Web Services