Hi,

I ported our war file from TomEE 8.0.15 to TomEE 9.1.0.

The deployment works fine with some new infos[1] where I think they are not a 
serious issue.

The application uses a SOAP interface and the WSDL will be retrieved.

The server is using JAAS [2][3][4]. I think at the moment I configured the 
TomEE system correctly.

Now I'm observing that the SOAP messages are not deserialized and an exception 
will be thrown.

18-Jul-2023 17:19:49.419 WARNING [http-nio-8080-exec-1] 
org.apache.cxf.phase.PhaseInterceptorChain.doDefaultLogging Interceptor for 
{http://company.com/wssession/}WSSession has thrown exc
eption, unwinding now
        org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
                at 
org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.handleMessage(SAAJInInterceptor.java:145)
                at 
org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.handleMessage(SAAJInInterceptor.java:107)
                at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
        [...]
        Caused by: jakarta.xml.soap.SOAPException: Unable to create message 
factory for SOAP: Error while searching for service 
[jakarta.xml.soap.MessageFactory]
                at 
jakarta.xml.soap.MessageFactory.newInstance(MessageFactory.java:90)
                at 
org.apache.cxf.binding.soap.saaj.SAAJFactoryResolver.createMessageFactory(SAAJFactoryResolver.java:56)
                at 
org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.getFactory(SAAJInInterceptor.java:151)
                at 
org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.handleMessage(SAAJInInterceptor.java:133)
                ... 36 more


In the resources.xml the WSS4J is configured where the onterceptor is invoked 
[5] ...

Does anybody have an idea how TomEE is not finding a SoapMessageFactory? What 
can I do? My assumption was that a lib is inside the library folder? [6]

Thanks,
Markus



[1]
18-Jul-2023 17:17:48.929 INFO [main] 
org.apache.cxf.jaxb.JAXBContextInitializer.addClass Class 
jakarta.xml.bind.JAXBElement does not have a default constructor which JAXB 
requires.
18-Jul-2023 17:17:48.983 INFO [main] 
org.apache.cxf.common.jaxb.JAXBUtils.createEscapeHandler Failed to create 
MinimumEscapeHandler

[2]
less conf/login.config
jaasContext  {
    org.apache.openejb.core.security.jaas.ServiceProviderLoginModule required;
};

[3]
less conf/server.xml
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->

      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.JAASRealm" 
appName="jaasContext"
            userClassNames="org.apache.openejb.core.security.jaas.UserPrincipal"
            
roleClassNames="org.apache.openejb.core.security.jaas.GroupPrincipal">
      </Realm>

[4]
less bin/setenv.sh
export CATALINA_OPTS="$CATALINA_OPTS 
-Djava.security.auth.login.config=/opt/tomee/current/conf/login.config"

[5]
<resources>
    <!-- In interceptors -->
    <Service id="wss4j" 
class-name="org.apache.openejb.server.cxf.config.WSS4JInInterceptorFactory" 
factory-name="create">
        action = UsernameToken
        passwordCallbackClass = com.company.PasswordHandler
    </Service>
</resources>

[6]
/opt/tomee/apache-tomee-plus-9.1.0/lib$ find -name "*cxf*"
./cxf-rt-rs-mp-client-shade-9.1.0.jar
./openejb-cxf-transport-9.1.0.jar
./openejb-cxf-rs-9.1.0.jar
./cxf-shade-9.1.0.jar
./openejb-cxf-9.1.0.jar
/opt/tomee/apache-tomee-plus-9.1.0/lib$ find -name "*soap*"
./opensaml-soap-api-4.2.0.jar
/opt/tomee/apache-tomee-plus-9.1.0/lib$ find -name "*xml*"
./opensaml-xmlsec-impl-4.2.0.jar
./opensaml-xmlsec-api-4.2.0.jar
./xmlsec-3.0.1.jar
./xmlschema-core-2.2.5.jar






Reply via email to