Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File metro-default.xml not found on Weblogic 12.1.3

We're currently running on WebLogic 12.1.2. And in this environment our application runs fine.

What we want now is to homologate our applications to WebLogic 12.1.3 environments. But we are facing a problem with the Web Services we use. In the new version the server throws a exception saying that the "Default configuration file [ metro-default.xml ] was not found".

I'm trying to find something on this file but there is nothing.

PS: We do not use Metro, we use the WebLogic default JAX-WS stack. And the application is deployed as a WAR file.

Here is the stack of the exception

java.lang.IllegalStateException: MASM0001: Default configuration file [ metro-default.xml ] was not found
    at com.sun.xml.ws.assembler.MetroConfigLoader.init(MetroConfigLoader.java:142)
    at com.sun.xml.ws.assembler.MetroConfigLoader.<init>(MetroConfigLoader.java:119)
    at com.sun.xml.ws.assembler.TubelineAssemblyController.getTubeCreators(TubelineAssemblyController.java:122)
    at com.sun.xml.ws.assembler.MetroTubelineAssembler.createServer(MetroTubelineAssembler.java:173)
    at com.sun.xml.ws.server.WSEndpointImpl.<init>(WSEndpointImpl.java:193)
    at com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:337)
    at com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:332)
    at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:164)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:577)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:560)
    at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:303)
    at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:179)
    at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:131)
    at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:152)
    at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:678)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
    at weblogic.servlet.internal.EventsManager.executeContextListener(EventsManager.java:243)
    at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:200)
    at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:185)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1838)
    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2876)
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1661)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:823)
    at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:360)
    at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:356)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
    at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:138)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:216)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:211)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:73)
    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:24)
like image 306
vkrausser Avatar asked Sep 23 '14 20:09

vkrausser


3 Answers

All credit to Thomas Isaksen

I placed this metro-default.xml in my maven src/main/resources/META-INF which results in the file being placed WEB-INF/classes/META-INF

The default here caused many ClassNotFoundExceptions...

(I am using Weblogic 12.2.1.0.0)

<?xml version="1.0" encoding="UTF-8"?>
    <metro  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns='http://java.sun.com/xml/ns/metro/config'
    version="1.0">
    <tubelines default="#default-metro-tubeline">
        <tubeline name="default-metro-tubeline">
            <client-side>
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.TerminalTubeFactory" />
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.HandlerTubeFactory" />
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.ValidationTubeFactory" />
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.MustUnderstandTubeFactory" />
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.MonitoringTubeFactory" />
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.AddressingTubeFactory" />
                <tube-factory className="com.sun.xml.ws.rx.rm.runtime.RmTubeFactory" />
                <tube-factory className="com.sun.xml.ws.dump.MessageDumpingTubeFactory" />
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.TransportTubeFactory" />
            </client-side>
            <endpoint-side>
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.TransportTubeFactory" />
                <tube-factory className="com.sun.xml.ws.dump.MessageDumpingTubeFactory" />
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.AddressingTubeFactory" />
                <tube-factory className="com.sun.xml.ws.rx.rm.runtime.RmTubeFactory" />
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.MonitoringTubeFactory" />
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.MustUnderstandTubeFactory" />
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.HandlerTubeFactory" />
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.ValidationTubeFactory" />
                <tube-factory className="com.sun.xml.ws.assembler.jaxws.TerminalTubeFactory" />
            </endpoint-side>
        </tubeline>
    </tubelines>
</metro>
like image 104
rjdkolb Avatar answered Nov 10 '22 03:11

rjdkolb


I solved it so that I added jaxws-rt-2.2.8.jar as a dependency to my project and wrote following to the weblogic-application.xml:

<wls:prefer-application-packages>
    <package-name>com.sun.xml.ws.api.wsdl.parser.*</package-name> 
</wls:prefer-application-packages>
<wls:prefer-application-resources>
    <wls:resource-name>META-INF/services/javax.xml.ws.*</wls:resource-name> 
    <wls:resource-name>META-INF/services/com.sun.xml.ws.*</wls:resource-name> 
    <wls:resource-name>META-INF/services/com.sun.tools.ws.*</wls:resource-name> 
</wls:prefer-application-resources>
like image 29
Michal Avatar answered Nov 10 '22 04:11

Michal


We placed the metro-default.xml in WEB-INF/classes/META-INF to resolve the issue. Contents of the file can be taken from here : https://metro.java.net/guide/ch02.html#dynamic_tube-based_message_logging

As Tube based messaging is introduced , jaxws-ri-2.2.8 jars are required to make any JAX-WS web services work.

like image 2
swts Avatar answered Nov 10 '22 03:11

swts