Hi CXF guys,
I have a little question for you :)
In this moment, deploying Syncope in Glassfish, we have following execption:
Root cause:
java.lang.NoSuchMethodError:
javax.ws.rs.core.Response.getHeaderString(Ljava/lang/String;)Ljava/lang/String;
at
org.apache.syncope.console.commons.HttpResourceStream.<init>(HttpResourceStream.java:49)
at
org.apache.syncope.console.pages.Configuration$4.onClick(Configuration.java:341)
The cause is that Glassfish's library contain jersey-core.jar because:
jar tvf jersey-core.jar:
2842 Sat Mar 31 18:48:48 CEST 2012
javax/ws/rs/core/Response$ResponseBuilder.class
1392 Sat Mar 31 18:48:48 CEST 2012
javax/ws/rs/core/Response$Status$Family.class
3979 Sat Mar 31 18:48:48 CEST 2012 javax/ws/rs/core/Response$Status.class
462 Sat Mar 31 18:48:48 CEST 2012
javax/ws/rs/core/Response$StatusType.class
5153 Sat Mar 31 18:48:48 CEST 2012 javax/ws/rs/core/Response.class
and syncope and syncope-console war have the same classes in
javax.ws.rs-api-2.0-m15.jar library.
To solve it I try cxf documentation in
http://cxf.apache.org/docs/application-server-specific-configuration-guide.html
where I found
Glassfish
CXF Interceptors will not work in Glassfish without this sun-web.xml
file to configure the classloader. By default, Glassfish will use Metro
for JAX-WS services so the classloader needs to be configured to allow
CXF libraries to provide JAX-WS services. The following sun-web.xml xml
source was added to /WEB-INF to resolve this issue:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD
Application Server 9.0 Servlet 2.5//EN'
'http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd'>
<sun-web-app>
<class-loader delegate="false"/>
</sun-web-app>
but the situation isn't changed because Glassfish documentation in
http://docs.oracle.com/cd/E18930_01/html/821-2418/gfqpi.html
"For a number of packages, including java.* and javax.*, symbol
resolution is always delegated to the parent class loader regardless of
the delegate setting. This prevents applications from overriding core
Java runtime classes or changing the API versions of specifications that
are part of the Java EE platform."
Now....how can we solve this library conflict? Have you any suggestions?
Thanks for your help.
Massimiliano
--
Massimiliano Perrone
Tel +39 393 9121310
Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 0859111173
http://www.tirasa.net
Apache Syncope PMC Member
http://people.apache.org/~massi/
"L'apprendere molte cose non insegna l'intelligenza"
(Eraclito)