This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

SecurityPolicyFeature is not assignable to WebServiceFeature  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Getting the below error
java.lang.VerifyError: Bad type on operand stack
Reason:
   Type '[Lweblogic/wsee/jws/jaxws/owsm/SecurityPolicyFeature;' (current frame, stack[1]) is not assignable to '[Ljavax/xml/ws/WebServiceFeature;'

I have the jars(jaxws-api.2.1.jar and ws.api_1.1.0.0.jar) related to both and tried in java 7 as well as java 8 but still getting the same error.

Please suggest me the resolution for this issue.
 
Saloon Keeper
Posts: 5341
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are the jar files that contain those two classes loaded by different classloaders?
 
Ranadhir Krishna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

I am not aware of the classloader but both of the jars were given in pom.xml as follows

<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.1.4</version>
</dependency>

<dependency>
   <groupId>weblogic</groupId>
   <artifactId>ws.api_1.1.0.0</artifactId>
   <version>1.0</version>
</dependency>

jaxws-api.2.1.jar is downloading as it is the dependency of jaxws-rt.2.1.4.jar
Is this info is helpful?
 
Tim Moores
Saloon Keeper
Posts: 5341
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a web app where both jar files are located in WEB-INF/lib? If they are, then this kind of error shouldn't occur, unless one of the files -possibly the Weblogic one- is also present somewhere else, most likely in a directory that belongs to the app server rather than the web app. So try to find out if the one of the classes is also present in one of the directories that's part of the server.
 
Ranadhir Krishna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

I checked in all the folders i have only one jaxws-rt.jar
After checking about WebServiceFeature class I came to know that JAX-WS is part of the JDK.
So now it is present in WebServiceFeature is in two jars.
rt.jar -->  javax.xml.ws.WebServiceFeature
jaxws-api.jar  --> javax.xml.ws.WebServiceFeature

How can I override WebServiceFeature of rt.jar by jaxws-api.jar ?
Please Suggest.
 
Tim Moores
Saloon Keeper
Posts: 5341
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens if you simply remove the jaxws-api.jar file?
 
Ranadhir Krishna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried that and ended up with the below error again

java.lang.LinkageError: loader constraint violation: when resolving method "javax.xml.ws.Service.<init>(Ljava/net/URL;Ljavax/xml/namespace/QName;)V" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, com/abc/abcservice/ABCService, and the class loader (instance of <bootloader>) for resolved class, javax/xml/ws/Service, have different Class objects for the type <init> used in the signature

removed jaxws-api.jar by using below code snippet

<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.1.4</version>
<exclusions>
<exclusion>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
</exclusion>
</exclusions>
</dependency>
 
Sheriff
Posts: 21692
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any dependency that is provided by your container like ws.api but also stuff like JPA, EJB etc, should be included as provided dependency. That will allow you to use their APIs without bundling them in your application. That would cause class loader conflicts like the one you're seeing, if a class is loaded by your application's class loader but some others by the container's class loader.
 
Bras cause cancer. And tiny ads:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!