Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem overriding saaj api

19 views
Skip to first unread message

gad...@gmail.com

unread,
Sep 6, 2006, 11:34:03 AM9/6/06
to
I'm trying to deploy a WAR with SAAJ 1.3 (saaj-api.jar and saaj-impl.jar from JAX-WS 2.0) in WEB-INF/lib. I'm getting the following exception when trying to run my JAX-WS 2.0 web services:

[9/6/06 8:25:10:515 PDT] 00000028 http I WSSERVLET14: JAX-WS servlet initializing
[9/6/06 8:25:10:546 PDT] 00000028 ServletWrappe I SRVE0242I: [emaxmc_webservice_war] [/emaxmc_webservice] [WebServiceServlet]: Initialization successful.
[9/6/06 8:25:10:687 PDT] 00000028 http E caught throwable
java.lang.NoSuchMethodError: javax/xml/soap/MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/MessageFactory;
at com.sun.xml.ws.util.SOAPUtil.createMessageFactory(SOAPUtil.java:174)
at com.sun.xml.ws.util.SOAPUtil.<clinit>(SOAPUtil.java:43)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPConnectionUtil.java:76)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.getSOAPMessage(SOAPMessageDispatcher.java:227)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:101)
at com.sun.xml.ws.server.Tie.handle(Tie.java:88)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.handle(WSServletDelegate.java:333)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:288)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:77)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3107)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1425)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:92)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:193)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:725)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:847)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498)


I've tried setting the Enterprise Application -> [Application Name] -> Class loader -> Class loader order -> Classes loaded with application class loader first setting in the Administrative console, but it makes no difference. Apparently it's not possible to override the jaxa.xml.soap package in ${Websphere_HOME}/lib/j2ee.jar using this method. Is there some endorsed directory where I can drop these jars and override the Websphere internal SAAJ implementation?

gad...@gmail.com

unread,
Sep 8, 2006, 12:22:01 PM9/8/06
to
I found another post on this forum and figured out that I was setting the Enterprise Application classloader options, not the WAR module classloader options. Now I'm getting the following exception in logs/ffdc on startup:

Exception = java.lang.ClassCastException
Source = com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet
probeid = 213
Stack Dump = java.lang.ClassCastException: com.sun.xml.ws.transport.http.servlet.WSServlet incompatible with javax.servlet.Servlet
at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1195)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:1190)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:385)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:339)


at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3107)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1425)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:92)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:193)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:725)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:847)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498)


I'm looking at the javax.servlet.http.HttpServlet provided in j2ee.jar with WAS 6.1 and the incompatibility is not obvious to me. Here's the source of
com.sun.xml.ws.transport.http.servlet.WSServlet:

/*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the license at
* https://glassfish.dev.java.net/public/CDDLv1.0.html.
* See the License for the specific language governing
* permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at https://glassfish.dev.java.net/public/CDDLv1.0.html.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* you own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* Copyright 2006 Sun Microsystems Inc. All Rights Reserved
*/

package com.sun.xml.ws.transport.http.servlet;

import java.util.logging.Level;
import java.util.logging.Logger;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sun.xml.ws.util.localization.LocalizableMessageFactory;
import com.sun.xml.ws.util.localization.Localizer;

/**
* The JAX-WS dispatcher servlet.
*
* @author WS Development Team
*/
public class WSServlet extends HttpServlet {

public void init(ServletConfig servletConfig) throws ServletException {
super.init(servletConfig);

localizer = new Localizer();
messageFactory =
new LocalizableMessageFactory("com.sun.xml.ws.resources.wsservlet");

try {
delegate = new WSServletDelegate();
delegate.init(servletConfig);
} catch (ServletException e) {
logger.log(Level.SEVERE,e.getMessage(), e);
throw e;
} catch (Throwable e) {
String message =
localizer.localize(
messageFactory.getMessage(
"error.servlet.caughtThrowableInInit",
new Object[] { e }));
logger.log(Level.SEVERE, message, e);
throw new ServletException(message);
}
}

public void destroy() {
if (delegate != null) {
delegate.destroy();
}
}

protected void doPost(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException {
if (delegate != null) {
delegate.doPost(request, response);
}
}

protected void doGet(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException {
if (delegate != null) {
delegate.doGet(request, response);
}
}

protected void doPut(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException {
if (delegate != null) {
delegate.doPut(request, response);
}
}

protected void doDelete(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException {
if (delegate != null) {
delegate.doDelete(request, response);
}
}



protected WSServletDelegate delegate = null;
private LocalizableMessageFactory messageFactory;
private Localizer localizer;

public static final String JAXWS_RI_RUNTIME_INFO =
"com.sun.xml.ws.server.http.info";
public static final String JAXWS_RI_PROPERTY_PUBLISH_WSDL =
"com.sun.xml.ws.server.http.publishWSDL";
public static final String JAXWS_RI_PROPERTY_PUBLISH_STATUS_PAGE =
"com.sun.xml.ws.server.http.publishStatusPage";

private static final Logger logger =
Logger.getLogger(
com.sun.xml.ws.util.Constants.LoggingDomain + ".server.http");
}

0 new messages