Aw: Re: Re: Re: No XML deserialization with TomEE 9.1.0 and JAAS
[email protected] Thu, 20 Jul 2023 14:20:18 +0200
Newsgroups
gmane.comp.java.openejb.user
Message-ID
<trinity-221e1875-fde5-4349-8ce1-c5ce2c09adc7-1689855618522@3c-app-webde-bs10>
Richard, thanks for your effort,
after reading your mail I immediately understood what went wrong.
In Maven it's called provided and in Gradle it should be providedCompile when the war plugin is used.
Gruß,
Markus
> Gesendet: Mittwoch, 19. Juli 2023 um 20:11 Uhr
> Von: "Richard Zowalla" <[email protected] >
> An: [email protected]
> Betreff: Re: Re: Re: No XML deserialization with TomEE 9.1.0 and JAAS
>
> Hi Markus,
>
> thanks for the sample project. I followed the README and could
> reproduce the stacktrace. I noticed, that the WAR file created via
> Gradle contains a lot of libs of which many are already bundled within
> TomEE:
>
> -rw-rw-r-- 1 rz rz 310K Jul 19 13:59 FastInfoset-1.2.16.jar
> -rw-rw-r-- 1 rz rz 27K Jul 19 13:59 istack-commons-runtime-3.0.8.jar
> -rw-rw-r-- 1 rz rz 44K Jul 19 13:59 jakarta.activation-api-1.2.1.jar
> -rw-rw-r-- 1 rz rz 113K Jul 19 13:59 jakarta.xml.bind-api-2.3.2.jar
> -rw-rw-r-- 1 rz rz 36K Jul 19 13:59 jakarta.xml.soap-api-1.4.1.jar
> -rw-rw-r-- 1 rz rz 56K Jul 19 13:58 javax.activation-api-1.2.0.jar
> -rw-rw-r-- 1 rz rz 26K Jul 19 13:58 javax.annotation-api-1.3.2.jar
> -rw-rw-r-- 1 rz rz 23K Jul 19 13:58 javax.jws-3.1.2.2.jar
> -rw-rw-r-- 1 rz rz 46K Jul 19 13:58 javax.xml.soap-api-1.4.0.jar
> -rw-rw-r-- 1 rz rz 126K Jul 19 13:58 jaxb-api-2.3.1.jar
> -rw-rw-r-- 1 rz rz 990K Jul 19 13:59 jaxb-runtime-2.3.2.jar
> -rw-rw-r-- 1 rz rz 56K Jul 19 13:58 jaxws-api-2.3.1.jar
> -rw-rw-r-- 1 rz rz 66K Jul 19 13:59 mimepull-1.9.11.jar
> -rw-rw-r-- 1 rz rz 447K Jul 19 13:59 saaj-impl-1.5.1.jar
> -rw-rw-r-- 1 rz rz 38K Jul 19 13:59 stax-ex-1.8.1.jar
> -rw-rw-r-- 1 rz rz 71K Jul 19 13:59 txw2-2.3.2.jar
>
> Looking into FactoryFinder.find(...) and some debugging further, the
> actual exception while trying to load the factory is:
>
> java.util.ServiceConfigurationError: jakarta.xml.soap.SAAJMetaFactory:
> com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl not a subtype
>
> This is because you have a javax dependency in your webapp: saaj-impl-
> 1.5.1.jar (+ classloader looks up here first) uses the old namespace.
>
> As I am not really familiar with Gradle, I migrated the project to
> Maven and debugged it with the TomEE Maven Plugin. The resulting WAR
> file does not contain any libs as everything is provided by TomEE.
> (Don't really know why Gradle puts the whole bunch of stuff into the
> WAR file ...)
>
> Deploying that "stripped" war file, sending a related SOAP request as
> mentioned in the README:
>
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:wss="http://example.com/wssession/">
> <soapenv:Header/>
> <soapenv:Body>
> <wss:login>
> <!--Optional:-->
> <wss:username>?</wss:username>
> <!--Optional:-->
> <wss:password>?</wss:password>
> </wss:login>
> </soapenv:Body>
> </soapenv:Envelope>
>
> I get the following response:
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body>
> <ns2:loginResponse xmlns:ns2="http://example.com/wssession/">
> <ns2:sessionId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:nil="true"/>
> <ns2:message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:nil="true"/>
> </ns2:loginResponse>
> </soap:Body>
> </soap:Envelope>
>
> Gruß
> Richard
>
>
>
> Am Mittwoch, dem 19.07.2023 um 12:56 +0200 schrieb [email protected] :
> > > Sorry, opened the repository.
> > >
> > >
> > > > > Gesendet: Mittwoch, 19. Juli 2023 um 12:14 Uhr
> > > > > Von: "Richard Zowalla" <[email protected] >
> > > > > An: [email protected]
> > > > > Betreff: Re: Re: No XML deserialization with TomEE 9.1.0 and
> > > > > JAAS
> > > > >
> > > > > Hi Markus,
> > > > >
> > > > > the link results in a 404 -> private repo?
> > > > >
> > > > > Gruß
> > > > > Richard
> > > > >
> > > > > Am Mittwoch, dem 19.07.2023 um 11:10 +0200 schrieb > >
> > > > > [email protected] :
> > > > > > > Hi Richard,
> > > > > > >
> > > > > > > to my surprise I was able to reproduce the issue with a
> > > > > > > small
> > > > > > > example.
> > > > > > > https://github.com/abstract-thinking/JaasSoapTomEEIssue/tree/master
> > > > > > >
> > > > > > > I really hope that it is not mistake by myself. ;-)
> > > > > > >
> > > > > > > By the way - Java 17 is used.
> > > > > > >
> > > > > > > Cheers,
> > > > > > > Markus
> > > > > > >
> > > > > > > > > Gesendet: Dienstag, 18. Juli 2023 um 20:18 Uhr
> > > > > > > > > Von: "Richard Zowalla" <[email protected] >
> > > > > > > > > An: [email protected]
> > > > > > > > > Betreff: Re: No XML deserialization with TomEE 9.1.0
> > > > > > > > > and JAAS
> > > > > > > > >
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > maybe adding a small reproducer to GitHub would help in
> > > > > > > > > > > > > identifying
> > > > > > > > > any
> > > > > > > > > issue?
> > > > > > > > >
> > > > > > > > > Gruß
> > > > > > > > > Richard
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Am Dienstag, dem 18.07.2023 um 17:56 +0200 schrieb
> > > > > > > > > [email protected] :
> > > > > > > > > > > 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.doDefaul
> > > > > > > > > > > tLogging
> > > > > > > > > > > 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$
> > > > > > > > > > > SAAJPreInI> > > > > nter
> > > > > > > > > > > cept
> > > > > > > > > > > or.handleMessage(SAAJInInterceptor.java:145)
> > > > > > > > > > > at
> > > > > > > > > > > org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$
> > > > > > > > > > > SAAJPreInI> > > > > nter
> > > > > > > > > > > cept
> > > > > > > > > > > or.handleMessage(SAAJInInterceptor.java:107)
> > > > > > > > > > > at
> > > > > > > > > > > org.apache.cxf.phase.PhaseInterceptorChain.doInterc
> > > > > > > > > > > ept(PhaseI> > > > > nter
> > > > > > > > > > > cept
> > > > > > > > > > > orChain.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(Message
> > > > > > > > > > > Factory.ja> > > > > va:9
> > > > > > > > > > > 0)
> > > > > > > > > > > at
> > > > > > > > > > > org.apache.cxf.binding.soap.saaj.SAAJFactoryResolve
> > > > > > > > > > > r.createMe> > > > > ssag
> > > > > > > > > > > eFac
> > > > > > > > > > > tory(SAAJFactoryResolver.java:56)
> > > > > > > > > > > at
> > > > > > > > > > > org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$
> > > > > > > > > > > SAAJPreInI> > > > > nter
> > > > > > > > > > > cept
> > > > > > > > > > > or.getFactory(SAAJInInterceptor.java:151)
> > > > > > > > > > > at
> > > > > > > > > > > org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$
> > > > > > > > > > > SAAJPreInI> > > > > nter
> > > > > > > > > > > cept
> > > > > > > > > > > or.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.createEscapeHa
> > > > > > > > > > > ndler > > > > > Failed
> > > > > > > > > > > to
> > > > > > > > > > > create MinimumEscapeHandler
> > > > > > > > > > >
> > > > > > > > > > > [2]
> > > > > > > > > > > less conf/login.config
> > > > > > > > > > > jaasContext {
> > > > > > > > > > >
> > > > > > > > > > > org.apache.openejb.core.security.jaas.ServiceProvid
> > > > > > > > > > > erLoginMod> > > > > ule
> > > > > > > > > > > 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.SimpleTcpClus
> > > > > > > > > > > ter"/>
> > > > > > > > > > > -->
> > > > > > > > > > >
> > > > > > > > > > > <!-- 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.ja
> > > > > > > > > > > as.UserPri> > > > > ncip
> > > > > > > > > > > al"
> > > > > > > > > > >
> > > > > > > > > > > roleClassNames="org.apache.openejb.core.security.ja
> > > > > > > > > > > as.GroupPr> > > > > inci
> > > > > > > > > > > pal"
> > > > > > > > > > > > >
> > > > > > > > > > > </Realm>
> > > > > > > > > > >
> > > > > > > > > > > [4]
> > > > > > > > > > > less bin/setenv.sh
> > > > > > > > > > > export CATALINA_OPTS="$CATALINA_OPTS -
> > > > > > > > > > > Djava.security.auth.login.config=/opt/tomee/current
> > > > > > > > > > > /conf/logi> > > > > n.co
> > > > > > > > > > > nfig
> > > > > > > > > > > "
> > > > > > > > > > >
> > > > > > > > > > > [5]
> > > > > > > > > > > <resources>
> > > > > > > > > > > <!-- In interceptors -->
> > > > > > > > > > > <Service id="wss4j" class-
> > > > > > > > > > > name="org.apache.openejb.server.cxf.config.WSS4JInI
> > > > > > > > > > > nterceptor> > > > > Fact
> > > > > > > > > > > ory"
> > > > > > > > > > > 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
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > >
> > > > >
>
>