File metro-default.xml not found on Weblogic 12.1.3
Asked Answered
P

4

11

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)
Pectoralis answered 23/9, 2014 at 20:3 Comment(0)
D
11

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>
Darbies answered 27/3, 2015 at 8:52 Comment(1)
This will work too. But, as I didn't care about using JAX-WS RT in this application, I opted to use the WebLogic stack. For this, I removed the sun-jaxws.xml file from WEB-INF and the WSServletContextListener listener from web.xml.Pectoralis
L
9

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>
Lorikeet answered 15/2, 2016 at 8:41 Comment(1)
This solved the problem for me. Thanks.Begone
P
2

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.

Pyre answered 7/11, 2014 at 6:33 Comment(2)
Hello! Well, this works to solve the missing metro-default.xml file, but know it does not find the tube factories required. I'll see if I can fix it without introducing new dependencies on the application. Any tips?Pectoralis
url broken grepcode.com/file/repo1.maven.org/maven2/org.glassfish.metro/…Iambus
R
0

create a xml file named metro-default.xml and add the below xml content into it ,then place this metro-default.xml file inside the WEB-INF folder of your project then restart the server it will work.

<?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>

Roselane answered 1/9, 2018 at 2:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.