Fabian Ritzmann wrote:
> Hi,
>
> I have pointed the debugger at the stack exception below. This
> exception occurs with the current Metro OSGi bundles after you
> deployed a web application with a web service, the first time you
> access the web service.
>
> What I found is that lookups from META-INF/services work fine as long
> as the class that is found belongs to a package that is exported by
> the Metro bundle. The ClassNotFoundException occurs for a class that
> belongs to a package listed as Private-Package only. Is this a bug?
That should not happen, because we make available even non-exported
class if such a class is a service. See the following lines in
OSGiModuleImpl.java:
// punch in. find the provider class, no matter
where we are.
OSGiModuleImpl m =
(OSGiModuleImpl)registry.getProvidingModule(name);
if(m!=null)
return m.bundle.loadClass(name);
throw e;
Thanks,
Sahoo
> I am not very comfortable with exporting packages that are only meant
> for use inside Metro.
>
> Fabian
>
>
> Aug 20, 2008 11:22:38 AM org.apache.catalina.core.StandardWrapperValve
> log
> SEVERE: StandardWrapperValve[NewWebService]: PWC1382: Allocate
> exception for servlet NewWebService
> javax.servlet.ServletException
> at
> org.glassfish.webservices.JAXWSServlet.doInit(JAXWSServlet.java:266)
> at org.glassfish.webservices.JAXWSServlet.init(JAXWSServlet.java:105)
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1198)
>
> at
> org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:863)
>
> at
> org.apache.catalina.core.StandardWrapperValve.preInvoke(StandardWrapperValve.java:360)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:139)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:186)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
>
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
> at
> com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
>
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
>
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
>
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:142)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
>
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
>
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
> at
> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:304)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:223)
>
> at
> com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:621)
>
> at
> com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:552)
>
> at
> com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:800)
>
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
>
> at
> com.sun.enterprise.v3.services.impl.HttpProtocolFilter.execute(HttpProtocolFilter.java:82)
>
> at
> com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:70)
>
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
>
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
>
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
>
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
>
> at
> com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:169)
> Caused by:
> com.sun.xml.ws.policy.privateutil.ServiceConfigurationError: [failed
> to localize]
> WSP_0025_SPI_FAIL_SERVICE_MSG(com.sun.xml.ws.policy.spi.PolicyAssertionValidator,
> [failed to localize]
> WSP_0027_SERVICE_PROVIDER_NOT_FOUND(com.sun.xml.ws.transport.tcp.wsit.TCPTransportPolicyValidator))
>
> at
> com.sun.xml.ws.policy.privateutil.ServiceFinder.fail(ServiceFinder.java:236)
>
> at
> com.sun.xml.ws.policy.privateutil.ServiceFinder.access$100(ServiceFinder.java:139)
>
> at
> com.sun.xml.ws.policy.privateutil.ServiceFinder$LazyIterator.next(ServiceFinder.java:380)
>
> at
> com.sun.xml.ws.policy.privateutil.ServiceFinder.toArray(ServiceFinder.java:228)
>
> at
> com.sun.xml.ws.policy.privateutil.PolicyUtils$ServiceProvider.load(PolicyUtils.java:445)
>
> at
> com.sun.xml.ws.policy.AssertionValidationProcessor.<clinit>(AssertionValidationProcessor.java:55)
>
> at
> com.sun.xml.ws.policy.jaxws.WSDLPolicyMapWrapper.validateServerSidePolicies(WSDLPolicyMapWrapper.java:146)
>
> at
> com.sun.xml.ws.policy.jaxws.PolicyWSDLParserExtension.postFinished(PolicyWSDLParserExtension.java:1269)
>
> at
> com.sun.xml.ws.wsdl.parser.DelegatingParserExtension.postFinished(DelegatingParserExtension.java:187)
>
> at
> com.sun.xml.ws.wsdl.parser.WSDLParserExtensionFacade.postFinished(WSDLParserExtensionFacade.java:334)
>
> at
> com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:230)
>
> at
> com.sun.xml.ws.server.EndpointFactory.getWSDLPort(EndpointFactory.java:509)
>
> at
> com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:198)
>
> at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
> at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:510)
> at
> org.glassfish.webservices.JAXWSServlet.registerEndpoint(JAXWSServlet.java:373)
>
> at
> org.glassfish.webservices.JAXWSServlet.doInit(JAXWSServlet.java:258)
> ... 33 more
> Caused by: java.lang.ClassNotFoundException:
> com.sun.xml.ws.transport.tcp.wsit.TCPTransportPolicyValidator
> at
> org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1504)
>
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
> at
> com.sun.xml.ws.policy.privateutil.ServiceFinder$LazyIterator.next(ServiceFinder.java:378)
>
> ... 47 more
>
>
>