• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

SecurityPolicyFeature is not assignable to WebServiceFeature

 
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: 6454
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • 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: 6454
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • 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: 6454
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • 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: 21955
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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.
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic