Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CF9.0.0, CHF 3, Java 1.7.0.45, WinXP - Strange behaviour with SoapMessage-Object

Guest
Mar 25, 2014 Mar 25, 2014

Hi Adobe Community!

We have a development server running with windows xp SP2 and Coldfusion 9.0.0. I installed now the Coldfusion Hotfix 3, so that we can run Java 1.7 on the development server.

Because we have the problem now for some time. And we thought that the still used 1.6 Java Version was the problem. But now after the updates we still have the same problem.

The only thing that changed was the error message in the log file:

loader constraint violation: loader (instance of coldfusion/bootstrap/BootstrapClassLoader) previously initiated loading for a different type with name ""javax/xml/soap/SOAPMessage"" The specific sequence of files included or processed is "Path to file plus rownumber"

So, but what are we trying to do? We use a SOAP Webservice and want to protocol the outgoing and incoming messages. For that and manipulating the SOAPHeader we set a HandlerResolver on our service. When the service wants to get the HandlerChain, the HandlerResolver adds our SOAPHandler to the list and returns it. Our SOAPHandler then has a handleMessage function. The function gets called everytime the service wants to recieve or send a message. In that function we have a SOAPMessageContext. From this context we get the SOAPMessage. Until this point the server has no problem and everything is working fine. But the next line lets the server breakdown and restart the coldfusion service. The line of code gets the SOAPPart out of the SOAPMessage.

Here is code i tried to describe:

------------------------ MyService.cfc ------------------------

<cffunction name="initMyService" returntype="void">

<cfset var handlerResolver = 0>

<cfset var bp = 0>

<!--- <cfif NOT IsDefined("session.myProject.webService")> --->

    <cfset session.tcook.myProject= StructNew()>

    <cfset session.tcook.myProject.service = CreateObject("java", "com.SomeFirm.ServiceName.webservice.service.versionNumber.TheService").init()>

    <cfset handlerResolver = CreateObject("java", "myProjektPackage.HandlerResolver").init()>

    <cfset session.myProject.webService.service.setHandlerResolver(handlerResolver)>

    <cfset session.myProject.webService.servicePort = session.myProject.webService.service.getTheServiceSoapPort()>

   <cfset session.myProject.webService.servicePort.sessionCreate()> <!--- starts a request to webservice --->

         ........

         ....

------------------------ MyHandlerResolver.java ------------------------

package myProjektPackage;

import java.util.ArrayList;

import java.util.List;

import javax.xml.ws.handler.Handler;

import javax.xml.ws.handler.HandlerResolver;

import javax.xml.ws.handler.PortInfo;

public class MyHandlerResolver implements HandlerResolver

{

    private HeaderHandler hh = null;

    public List<Handler> getHandlerChain(PortInfo portInfo)

    {

          List<Handler> handlerChain = new ArrayList<Handler>();

          this.hh = new MyHandler();

          handlerChain.add(this.hh);

          return handlerChain;

    }

    public HeaderHandler getHeaderHandler()

    {

        return this.hh;

    }

}

------------------------ MyHandler.java ------------------------

package myProjektPackage;

import java.util.Iterator;

import java.util.Set;

import javax.xml.namespace.QName;

import javax.xml.soap.SOAPElement;

import javax.xml.soap.SOAPEnvelope;

import javax.xml.soap.SOAPHeader;

import javax.xml.soap.SOAPHeaderElement;

import javax.xml.soap.SOAPPart;

import javax.xml.ws.handler.MessageContext;

import javax.xml.ws.handler.soap.SOAPHandler;

import javax.xml.ws.handler.soap.SOAPMessageContext;

public class MyHandler implements SOAPHandler<SOAPMessageContext>

{

    public boolean handleMessage(SOAPMessageContext smc)

    {

        try

        {

            Boolean outboundProperty = (Boolean) smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);

            if (outboundProperty.booleanValue())

            {

                SOAPPart sp = smc.getMessage().getSOAPPart();

               ........

               ....

Message was edited by: HerrKnilch I forgot to write my request: Has someone an idea what we are doing wrong? Or what we could try to get our code to work. I already invested so much time in this problem and still have no solution. I pretty much don't know what to do or try next. I appriciate every afford or idea. Thanks and Greetings HerrKnilch

378
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources