users@glassfish.java.net

Re: Module not able to find ProviderImpl

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Wed, 06 Jul 2011 03:46:13 +0530

Add the following repo in your pom.xml:

<!-- This is where some GlassFish specific dependencies exist -->
<repository>
<id>glassfish-nexus-repo</id>
<name>Nexus repository collection for Glassfish</name>
<url>http://maven.glassfish.org/content/groups/glassfish</url>
<snapshots>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>


I suggest you use version 3.1 of internal-api.

I do see getCommonClassLoader() as a method in ClassLoaderHierarchy.

Your problem about ObjectFactory is that you are using wrong
ObjectFactory. JAXB uses javax.xml.bind...ObjectFactory.

Last, but not the least, I don't understand if you are trying out JAXB
workaround as an experiment or what. Your problem of ProviderImpl should
go away by simply switching the thread's context class loader
temporarily to common class loader.

Thanks,
Sahoo

On Tuesday 05 July 2011 09:42 PM, forums_at_java.net wrote:
> I picked it up from here:
> http://www.mvnbrowser.com/artifact-details.html?groupId=org.glassfish.common&artifactId=internal-api&version=3.2-b06&tab=FILES#tabs
>
> [1]
>
> The code does not make sense though so maybe that is not right:
>
> ClassLoader ccl =
> Globals.get(ClassLoaderHierarchy.class).getCommonClassLoader();
>
> getCommonClassLoader does not exist as a method.
>
> JAXBContext jc = JAXBContext.newInstance(ObjectFactory.class);
>
> Not a valid argument for that method.
>
> My imports:
>
> import java.net.URL; import javax.naming.spi.ObjectFactory; import
> javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import
> javax.xml.namespace.QName; import javax.xml.ws.Service; import
> org.glassfish.internal.api.Globals; import
> org.glassfish.internal.api.ClassLoaderHierarchy; import
> org.osgi.framework.BundleActivator; import
> org.osgi.framework.BundleContext;
> If you could give me some more hints to get this solved I would be
> eternally grateful, I've been stuck in my tracks for a week. :-(
>
>
> [1]
> http://www.mvnbrowser.com/artifact-details.html?groupId=org.glassfish.common&amp;artifactId=internal-api&amp;version=3.2-b06&amp;tab=FILES#tabs
>
> --
>
> [Message sent by forum member 'dpwr']
>
> View Post: http://forums.java.net/node/818465
>
>