users@glassfish.java.net

Could not instantiate service class

From: <forums_at_java.net>
Date: Thu, 28 Jul 2011 03:08:05 -0500 (CDT)

 I'm trying to use the embedded container to deply a WAR as described in the
one pager here:

http://wikis.sun.com/display/GlassFish/3.1EmbeddedOnePager#3.1EmbeddedOnePager-4.1.2EmbeddedAPI%3A
[1]

I'm using glassfish-embedded-all version 3.1.1-b11.  I get the following
error and Google hasn't given me any hints tonight:

28-Jul-2011 1:57:53 AM org.jboss.weld.util.ServiceLoader
prepareInstanceWARNING: Could not instantiate service class
org.glassfish.osgicdi.impl.OSGiServiceExtensionjava.lang.NoClassDefFoundError:
org/osgi/framework/ServiceException at
java.lang.ClassLoader.defineClass1(Native Method) at
java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at
java.lang.ClassLoader.defineClass(ClassLoader.java:615) at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at
java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at
java.net.URLClassLoader.access$000(URLClassLoader.java:58) at
java.net.URLClassLoader$1.run(URLClassLoader.java:197) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:190) at
java.lang.ClassLoader.loadClass(ClassLoader.java:306) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at
java.lang.ClassLoader.loadClass(ClassLoader.java:247) at
java.lang.Class.getDeclaredConstructors0(Native Method) at
java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) at
java.lang.Class.getConstructor0(Class.java:2699) at
java.lang.Class.getDeclaredConstructor(Class.java:1985) at
org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java:271) at
org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:238) at
org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.java:194) at
org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:157) at
org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:346) at
org.jboss.weld.bootstrap.ExtensionBeanDeployer.addExtensions(ExtensionBeanDeployer.java:93)
at
org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:340)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:168) at
org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128) at
org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:270) at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at
org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
at
com.sun.enterprise.admin.cli.embeddable.CommandExecutorImpl.executeCommand(CommandExecutorImpl.java:147)
at
com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:99)
at
ca.jptech.itma.container.ContainerServiceImpl.start(ContainerServiceImpl.java:24)
at ca.jptech.itma.container.Bootstrap.main(Bootstrap.java:7)Caused by:
java.lang.ClassNotFoundException: org.osgi.framework.ServiceException at
java.net.URLClassLoader$1.run(URLClassLoader.java:202) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:190) at
java.lang.ClassLoader.loadClass(ClassLoader.java:306) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at
java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 39 more
The container continues to load and claims my archive deployed successfully.
 It's going to be a few days before I can really dig into the problem, so,
in the meantime, I'm hoping someone else has seen the same error before.

Ryan


 


[1]
http://wikis.sun.com/display/GlassFish/3.1EmbeddedOnePager#3.1EmbeddedOnePager-4.1.2EmbeddedAPI%3A

--
[Message sent by forum member 'toomanyryans']
View Post: http://forums.java.net/node/826945