You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by bitrain _ <bi...@gmail.com> on 2008/04/08 15:30:10 UTC

webservice runtime modeler error

Hi all,

We are building a bundle which must access a web service using jaxws,
but we keep hitting a problem.
When we load our bundle dynamically using another bundle we get the
following error:

Exception in thread "Timer-0"
com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler
error: Wrapper class nl.prifes.printer.log.Poll is not found. Have you
run APT to generate them?
        at com.sun.xml.internal.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:256)
        at com.sun.xml.internal.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:567)
        at com.sun.xml.internal.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:514)
        at com.sun.xml.internal.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:341)
        at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:227)
        at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:588)
        at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:291)
        at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:274)
        at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:267)
        at javax.xml.ws.Service.getPort(Service.java:92)
        at nl.prifes.printer.log.PrifesPrinterService.getPrifesPrinterPort(PrifesPrinterService.java:56)
        at nl.prifes.printer.log.Activator$SendLogTask.run(Activator.java:63)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)

If we put the same code in the master bundle which loads felix and
itself, everything works fine. But to make everything more flexible we
would like to have it in another bundle.

In our pom.xml file, we have:

	  <plugin>
		<groupId>org.codehaus.mojo</groupId>
		<artifactId>jaxws-maven-plugin</artifactId>
		<executions>
			<execution>
				<goals>
					<goal>wsimport</goal>
				</goals>
				<configuration>
					<wsdlUrls>

<wsdlUrl>http://localhost:8084/prifesserver/PrifesPrinter?wsdl</wsdlUrl>
					</wsdlUrls>
					<packageName>nl.prifes.printer.log</packageName>
				</configuration>
			</execution>
		</executions>
      </plugin>

And our java source file contains:

package nl.prifes.printer.log;

....

                PrifesPrinterService serv = new PrifesPrinterService();
                PrifesPrinter pp = serv.getPrifesPrinterPort();
                System.out.println(pp.sendData(1, 1, "Test"));

....

The missing class is present in the .jar file (verified by unzipping it).

We also tried including javax.xml.ws (and others) in our .jar, but
that attempt doesn't work because:

org.osgi.framework.BundleException: Unresolved package in bundle 1:
package; (package=javax.xml.transform)

and:

[WARNING] Warning building bundle
nl.prifes.printer:printerlogbundle:bundle:1.0.0 : Instructions for
Private-Package that are never used: javax\.xml\.transform

We use the maven-bundle-plugin to generate the manifest file.

Hopefully someone can help us.

Thanks,

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: webservice runtime modeler error

Posted by Marcel Offermans <ma...@luminis.nl>.
On Apr 11, 2008, at 9:47 , bitrain _ wrote:

> We solved our problem!
> We had to set the classloader to the classes' classloader and put some
> internal class in the bootdelegation. Hopefully this post is usefull
> for others.

Good to hear that, Stefan! I'm sure solutions like this will help  
others, as these are often the hardest nuts to crack when integrating  
existing libraries with OSGi.

Greetings, Marcel


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: webservice runtime modeler error

Posted by bitrain _ <bi...@gmail.com>.
Hello,

We solved our problem!
We had to set the classloader to the classes' classloader and put some
internal class in the bootdelegation. Hopefully this post is usefull
for others.

Activator.java:

        final ClassLoader cl = this.getClass().getClassLoader();

        Thread thread = new Thread() {
            @Override
            public void run() {
                Thread.currentThread().setContextClassLoader(cl);

                PrifesPrinterService serv = new PrifesPrinterService();
                PrifesPrinter pp = serv.getPrifesPrinterPort();
                System.out.println(pp.sendData(1, 1, "Test"));
            }
        };

        thread.start();

master bundle:

...
configMap.put(Constants.FRAMEWORK_BOOTDELEGATION,
"com.sun.xml.internal.ws.api.message");
...
Felix felix = new Felix(configMap, list);
...

Greetings,

Stefan


On 4/10/08, bitrain _ <bi...@gmail.com> wrote:
> Hello,
>
>  I cleaned up the sources a bit and pasted them below. The code for the
>  master bundle is not very interesting (it shows a gui with a fileopen
>  button), apart from the method which loads the bundles and the method
>  which loads felix.  Both are at the bottom of the post.
>
>  Hopefully somebody can help us.
>
>  Greetings,
>
>  Stefan
>
>  Activator.java for dynamically loaded bundle:
>
>
>  package nl.prifes.printer.log;
>
>
> import org.osgi.framework.BundleActivator;
>  import org.osgi.framework.BundleContext;
>
>  public class Activator implements BundleActivator{
>     private BundleContext m_context = null;
>
>     public void start(BundleContext context) throws Exception {
>         System.out.println("Loading log bundle");
>         m_context = context;
>
>
>         final ClassLoader cl = context.getClass().getClassLoader();
>
>         System.out.println(cl);
>
>         Thread thread = new Thread() {
>             @Override
>             public void run() {
>                 System.out.println("pre" +
>  Thread.currentThread().getContextClassLoader());
>
>                 Thread.currentThread().setContextClassLoader(cl);
>
>                 PrifesPrinterService serv = new PrifesPrinterService();
>
>                 System.out.println("cla" +
>  Thread.currentThread().getContextClassLoader());
>                 PrifesPrinter pp = serv.getPrifesPrinterPort();
>                 System.out.println("sendpre");
>
>                 System.out.println(pp.sendData(1, 1, "Test"));
>             }
>         };
>
>         thread.start();
>     }
>
>
>     public void stop(BundleContext context) throws Exception {
>         System.out.println("Stopping log bundle");
>         m_context = null;
>     }
>  }
>
>  pom.xml for dynamically loaded bundle:
>
>  <project>
>   <modelVersion>4.0.0</modelVersion>
>   <packaging>bundle</packaging>
>   <name>PRIFES Printer log</name>
>   <description>Does something with logs</description>
>   <groupId>nl.prifes.printer</groupId>
>   <artifactId>printerlogbundle</artifactId>
>   <version>1.0.0</version>
>
>   <dependencies>
>     <dependency>
>       <groupId>org.apache.felix</groupId>
>       <artifactId>org.osgi.core</artifactId>
>       <version>1.0.0</version>
>     </dependency>
>     <dependency>
>       <groupId>nl.prifes.printer</groupId>
>       <artifactId>prifesprinter</artifactId>
>       <version>1.0.0</version>
>     </dependency>
>     <dependency>
>           <groupId>com.sun.xml.ws</groupId>
>           <artifactId>jaxws-rt</artifactId>
>           <version>2.0_03-SNAPSHOT</version>
>     </dependency>
>   </dependencies>
>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.felix</groupId>
>         <artifactId>maven-bundle-plugin</artifactId>
>         <version>1.4.0</version>
>         <extensions>true</extensions>
>         <configuration>
>           <instructions>
>             <Private-Package>nl.prifes.printer.log</Private-Package>
>             <Bundle-Activator>nl.prifes.printer.log.Activator</Bundle-Activator>
>             <Import-Package>javax.jws,javax.xml.bind,javax.xml.bind.annotation,javax.xml.namespace,javax.xml.ws,nl.prifes.printer.host.service,org.osgi.framework;version="1.3"</Import-Package>
>           </instructions>
>         </configuration>
>       </plugin>
>
>           <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>jaxws-maven-plugin</artifactId>
>                 <executions>
>                         <execution>
>                                 <goals>
>                                         <goal>wsimport</goal>
>                                 </goals>
>                                 <configuration>
>                                         <wsdlUrls>
>                                                 <wsdlUrl>http://localhost:8084/prifesserver/PrifesPrinter?wsdl</wsdlUrl>
>                                         </wsdlUrls>
>                                         <packageName>nl.prifes.printer.log</packageName>
>                                 </configuration>
>                         </execution>
>                 </executions>
>       </plugin>
>
>       <plugin>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <version>RELEASE</version>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>
>   <repositories>
>       <repository>
>           <id>maven-repository.dev.java.net</id>
>           <name>maven</name>
>           <url>http://download.java.net/maven/1/</url>
>           <layout>legacy</layout>
>       </repository>
>       <repository>
>           <id>maven2-repository.dev.java.net</id>
>           <name>maven2</name>
>           <url>http://download.java.net/maven/2/</url>
>       </repository>
>   </repositories>
>   <pluginRepositories>
>       <pluginRepository>
>           <id>maven2-repository.dev.java.net</id>
>           <url>http://download.java.net/maven/2/</url>
>       </pluginRepository>
>   </pluginRepositories>
>  </project>
>
>  Bundle load method:
>
>     private void actionPerformed(java.awt.event.ActionEvent evt) {
>         if(evt.getSource()  == openButton){
>             JFileChooser fc = new JFileChooser();
>             int retVal = fc.showOpenDialog(ServiceList.this);
>             if(retVal == JFileChooser.APPROVE_OPTION){
>                 File file = fc.getSelectedFile();
>                 final String filePath = file.toURI().toString();
>                 System.out.println(filePath);
>
>                 try {
>                     Bundle b = m_act.getContext().installBundle(filePath);
>                     System.out.println(b.getHeaders().toString());
>                     ServiceItem si = new ServiceItem(m_act, b);
>                     addItem(si);
>                 }
>                 catch (BundleException ex) {
>
>  Logger.getLogger(ServiceList.class.getName()).log(Level.SEVERE, "Boem
>  while installing service", ex);
>                 }
>             }
>         }
>     }
>
>
>  Felix load method:
>
>  public static void main(String[] argv) throws Exception{
>         final File cachedir =
>  File.createTempFile("felix.example.servicebased", null);
>         cachedir.delete();
>         Runtime.getRuntime().addShutdownHook(new Thread() {
>             @Override
>             public void run(){
>                 deleteFileOrDir(cachedir);
>             }
>         });
>
>         Map configMap = new StringMap(false);
>         configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES,
>             "org.osgi.framework; version=1.3.0," +
>             "org.osgi.service.packageadmin; version=1.2.0," +
>             "org.osgi.service.startlevel; version=1.0.0," +
>             "org.osgi.service.url; version=1.0.0," +
>             "org.osgi.util.tracker; version=1.3.2," +
>             "nl.prifes.printer.host.service; version=1.0.0," +
>             "javax.swing," +
>             "javax.jws,javax.xml.bind.annotation,javax.xml.bind,javax.xml.ws,javax.xml.namespace"
>             );
>         configMap.put(AutoActivator.AUTO_START_PROP + ".1",""
>             );
>         configMap.put(FelixConstants.LOG_LEVEL_PROP, "1");
>         configMap.put(BundleCache.CACHE_PROFILE_DIR_PROP,
>  cachedir.getAbsolutePath());
>
>         // Create list to hold custom framework activators.
>         List list = new ArrayList();
>         // Add activator to process auto-start/install properties.
>         list.add(new AutoActivator(configMap));
>         // Add our own activator.
>         list.add(new Activator());
>
>         try{
>             // Now create an instance of the framework.
>             Felix felix = new Felix(configMap, list);
>             felix.start();
>         }
>         catch (Exception ex){
>             System.err.println("Could not create framework: " + ex);
>             ex.printStackTrace();
>             System.exit(-1);
>
>         }
>     }
>
>  On 4/10/08, Marcel Offermans <ma...@luminis.nl> wrote:
>  > Hello Stefan,
>  >
>  >  On Apr 9, 2008, at 13:05 , bitrain _ wrote:
>  >
>  >
>  > > We tried setting the classloader in our own thread:
>  > >
>  > >       final ClassLoader cl =
>  > context.getClass().getClassLoader();
>  > >       Thread thread = new Thread() {
>  > >           public void run() {
>  > >
>  > Thread.currentThread().setContextClassLoader(cl);
>  > >
>  > >               PrifesPrinterService serv = new PrifesPrinterService();
>  > >               PrifesPrinter pp = serv.getPrifesPrinterPort();
>  > >               System.out.println(pp.sendData(1, 1,
>  > "Test"));
>  > >           }
>  > >       };
>  > >       thread.start();
>  > >
>  > > The context is the bundlecontext from the bundle which contains the
>  > > classes. We also tried getting the classloader from the master bundle,
>  > > but they all produce the same runtime modeler error.
>  > >
>  >
>  >  Hard to tell from just your messages what is going on exactly. The best
>  > advice I can give you is to use the debugger to figure out exactly what's
>  > going on inside that code. Try and instrument your classloaders if
>  > necessary.
>  >
>  >
>  >  Greetings, Marcel
>  >
>  >
>  > ---------------------------------------------------------------------
>  >  To unsubscribe, e-mail:
>  > users-unsubscribe@felix.apache.org
>  >  For additional commands, e-mail: users-help@felix.apache.org
>  >
>  >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: webservice runtime modeler error

Posted by bitrain _ <bi...@gmail.com>.
Hello,

I cleaned up the sources a bit and pasted them below. The code for the
master bundle is not very interesting (it shows a gui with a fileopen
button), apart from the method which loads the bundles and the method
which loads felix.  Both are at the bottom of the post.

Hopefully somebody can help us.

Greetings,

Stefan

Activator.java for dynamically loaded bundle:

package nl.prifes.printer.log;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

public class Activator implements BundleActivator{
    private BundleContext m_context = null;

    public void start(BundleContext context) throws Exception {
        System.out.println("Loading log bundle");
        m_context = context;

        final ClassLoader cl = context.getClass().getClassLoader();
        System.out.println(cl);

        Thread thread = new Thread() {
            @Override
            public void run() {
                System.out.println("pre" +
Thread.currentThread().getContextClassLoader());
                Thread.currentThread().setContextClassLoader(cl);

                PrifesPrinterService serv = new PrifesPrinterService();
                System.out.println("cla" +
Thread.currentThread().getContextClassLoader());
                PrifesPrinter pp = serv.getPrifesPrinterPort();
                System.out.println("sendpre");
                System.out.println(pp.sendData(1, 1, "Test"));
            }
        };

        thread.start();
    }

    public void stop(BundleContext context) throws Exception {
        System.out.println("Stopping log bundle");
        m_context = null;
    }
}

pom.xml for dynamically loaded bundle:

<project>
  <modelVersion>4.0.0</modelVersion>
  <packaging>bundle</packaging>
  <name>PRIFES Printer log</name>
  <description>Does something with logs</description>
  <groupId>nl.prifes.printer</groupId>
  <artifactId>printerlogbundle</artifactId>
  <version>1.0.0</version>

  <dependencies>
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.osgi.core</artifactId>
      <version>1.0.0</version>
    </dependency>
    <dependency>
      <groupId>nl.prifes.printer</groupId>
      <artifactId>prifesprinter</artifactId>
      <version>1.0.0</version>
    </dependency>
    <dependency>
	  <groupId>com.sun.xml.ws</groupId>
	  <artifactId>jaxws-rt</artifactId>
	  <version>2.0_03-SNAPSHOT</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>1.4.0</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Private-Package>nl.prifes.printer.log</Private-Package>
            <Bundle-Activator>nl.prifes.printer.log.Activator</Bundle-Activator>
            <Import-Package>javax.jws,javax.xml.bind,javax.xml.bind.annotation,javax.xml.namespace,javax.xml.ws,nl.prifes.printer.host.service,org.osgi.framework;version="1.3"</Import-Package>
          </instructions>
        </configuration>
      </plugin>
	  <plugin>
		<groupId>org.codehaus.mojo</groupId>
		<artifactId>jaxws-maven-plugin</artifactId>
		<executions>
			<execution>
				<goals>
					<goal>wsimport</goal>
				</goals>
				<configuration>
					<wsdlUrls>
						<wsdlUrl>http://localhost:8084/prifesserver/PrifesPrinter?wsdl</wsdlUrl>
					</wsdlUrls>
					<packageName>nl.prifes.printer.log</packageName>
				</configuration>
			</execution>
		</executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>RELEASE</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <repositories>
      <repository>
          <id>maven-repository.dev.java.net</id>
          <name>maven</name>
          <url>http://download.java.net/maven/1/</url>
          <layout>legacy</layout>
      </repository>
      <repository>
          <id>maven2-repository.dev.java.net</id>
          <name>maven2</name>
          <url>http://download.java.net/maven/2/</url>
      </repository>
  </repositories>
  <pluginRepositories>
      <pluginRepository>
          <id>maven2-repository.dev.java.net</id>
          <url>http://download.java.net/maven/2/</url>
      </pluginRepository>
  </pluginRepositories>
</project>

Bundle load method:

    private void actionPerformed(java.awt.event.ActionEvent evt) {
        if(evt.getSource()  == openButton){
            JFileChooser fc = new JFileChooser();
            int retVal = fc.showOpenDialog(ServiceList.this);
            if(retVal == JFileChooser.APPROVE_OPTION){
                File file = fc.getSelectedFile();
                final String filePath = file.toURI().toString();
                System.out.println(filePath);

                try {
                    Bundle b = m_act.getContext().installBundle(filePath);
                    System.out.println(b.getHeaders().toString());
                    ServiceItem si = new ServiceItem(m_act, b);
                    addItem(si);
                }
                catch (BundleException ex) {

Logger.getLogger(ServiceList.class.getName()).log(Level.SEVERE, "Boem
while installing service", ex);
                }
            }
        }
    }


Felix load method:

public static void main(String[] argv) throws Exception{
        final File cachedir =
File.createTempFile("felix.example.servicebased", null);
        cachedir.delete();
        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run(){
                deleteFileOrDir(cachedir);
            }
        });

        Map configMap = new StringMap(false);
        configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES,
            "org.osgi.framework; version=1.3.0," +
            "org.osgi.service.packageadmin; version=1.2.0," +
            "org.osgi.service.startlevel; version=1.0.0," +
            "org.osgi.service.url; version=1.0.0," +
            "org.osgi.util.tracker; version=1.3.2," +
            "nl.prifes.printer.host.service; version=1.0.0," +
            "javax.swing," +
            "javax.jws,javax.xml.bind.annotation,javax.xml.bind,javax.xml.ws,javax.xml.namespace"
            );
        configMap.put(AutoActivator.AUTO_START_PROP + ".1",""
            );
        configMap.put(FelixConstants.LOG_LEVEL_PROP, "1");
        configMap.put(BundleCache.CACHE_PROFILE_DIR_PROP,
cachedir.getAbsolutePath());

        // Create list to hold custom framework activators.
        List list = new ArrayList();
        // Add activator to process auto-start/install properties.
        list.add(new AutoActivator(configMap));
        // Add our own activator.
        list.add(new Activator());

        try{
            // Now create an instance of the framework.
            Felix felix = new Felix(configMap, list);
            felix.start();
        }
        catch (Exception ex){
            System.err.println("Could not create framework: " + ex);
            ex.printStackTrace();
            System.exit(-1);
        }
    }

On 4/10/08, Marcel Offermans <ma...@luminis.nl> wrote:
> Hello Stefan,
>
>  On Apr 9, 2008, at 13:05 , bitrain _ wrote:
>
>
> > We tried setting the classloader in our own thread:
> >
> >       final ClassLoader cl =
> context.getClass().getClassLoader();
> >       Thread thread = new Thread() {
> >           public void run() {
> >
> Thread.currentThread().setContextClassLoader(cl);
> >
> >               PrifesPrinterService serv = new PrifesPrinterService();
> >               PrifesPrinter pp = serv.getPrifesPrinterPort();
> >               System.out.println(pp.sendData(1, 1,
> "Test"));
> >           }
> >       };
> >       thread.start();
> >
> > The context is the bundlecontext from the bundle which contains the
> > classes. We also tried getting the classloader from the master bundle,
> > but they all produce the same runtime modeler error.
> >
>
>  Hard to tell from just your messages what is going on exactly. The best
> advice I can give you is to use the debugger to figure out exactly what's
> going on inside that code. Try and instrument your classloaders if
> necessary.
>
>
>  Greetings, Marcel
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail:
> users-unsubscribe@felix.apache.org
>  For additional commands, e-mail: users-help@felix.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: webservice runtime modeler error

Posted by Marcel Offermans <ma...@luminis.nl>.
Hello Stefan,

On Apr 9, 2008, at 13:05 , bitrain _ wrote:

> We tried setting the classloader in our own thread:
>
>        final ClassLoader cl = context.getClass().getClassLoader();
>        Thread thread = new Thread() {
>            public void run() {
>                Thread.currentThread().setContextClassLoader(cl);
>
>                PrifesPrinterService serv = new PrifesPrinterService();
>                PrifesPrinter pp = serv.getPrifesPrinterPort();
>                System.out.println(pp.sendData(1, 1, "Test"));
>            }
>        };
>        thread.start();
>
> The context is the bundlecontext from the bundle which contains the
> classes. We also tried getting the classloader from the master bundle,
> but they all produce the same runtime modeler error.

Hard to tell from just your messages what is going on exactly. The  
best advice I can give you is to use the debugger to figure out  
exactly what's going on inside that code. Try and instrument your  
classloaders if necessary.

Greetings, Marcel


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: webservice runtime modeler error

Posted by bitrain _ <bi...@gmail.com>.
Hello Marcel,

We tried setting the classloader in our own thread:

        final ClassLoader cl = context.getClass().getClassLoader();
        Thread thread = new Thread() {
            public void run() {
                Thread.currentThread().setContextClassLoader(cl);

                PrifesPrinterService serv = new PrifesPrinterService();
                PrifesPrinter pp = serv.getPrifesPrinterPort();
                System.out.println(pp.sendData(1, 1, "Test"));
            }
        };
        thread.start();

The context is the bundlecontext from the bundle which contains the
classes. We also tried getting the classloader from the master bundle,
but they all produce the same runtime modeler error.

Thanks for your help!

Stefan


On 4/8/08, Marcel Offermans <ma...@luminis.nl> wrote:
> Hello Stefan,
>
>  On Apr 8, 2008, at 15:30 , bitrain _ wrote:
>
>
> > We are building a bundle which must access a web service using jaxws,
> > but we keep hitting a problem.
> > When we load our bundle dynamically using another bundle we get the
> > following error: [...]
> >
>
>  Just a wild guess, but sometimes these errors occur because of Java code
> using the context classloader to load classes. In OSGi, that context
> classloader might not be able to access all classes in the bundle.
>
>  If that is indeed the problem, look for a way to set the correct
> classloader for that code (some libraries allows you to do that). The other
> alternative is to make sure that the thread that's going through your code
> has its context classloader set to the bundle classloader (but remember
> there that if this is not a thread you created, you might want to restore
> the original classloader afterwards). Alternatively, create your own, new
> thread and set its context classloader.
>
>  Greetings, Marcel
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail:
> users-unsubscribe@felix.apache.org
>  For additional commands, e-mail: users-help@felix.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: webservice runtime modeler error

Posted by Marcel Offermans <ma...@luminis.nl>.
Hello Stefan,

On Apr 8, 2008, at 15:30 , bitrain _ wrote:

> We are building a bundle which must access a web service using jaxws,
> but we keep hitting a problem.
> When we load our bundle dynamically using another bundle we get the
> following error: [...]

Just a wild guess, but sometimes these errors occur because of Java  
code using the context classloader to load classes. In OSGi, that  
context classloader might not be able to access all classes in the  
bundle.

If that is indeed the problem, look for a way to set the correct  
classloader for that code (some libraries allows you to do that). The  
other alternative is to make sure that the thread that's going through  
your code has its context classloader set to the bundle classloader  
(but remember there that if this is not a thread you created, you  
might want to restore the original classloader afterwards).  
Alternatively, create your own, new thread and set its context  
classloader.

Greetings, Marcel


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org