users@glassfish.java.net

Re: Using embedded GF 3.1.1 for unit testing

From: <forums_at_java.net>
Date: Sat, 3 Sep 2011 14:08:44 -0500 (CDT)

many thanks. your hint regarding the CLASSPATH was good. i had all the
Glassfish libraries in my Eclipse

build path besides glassfish-embedded.jar, i think they were added when i
deployed the webapp first time

to the Glassfish server, but i am not sure exactly. now GF enbedded starts
without problems and i can deploy

a scattered web app.

one exception is thrown during deployment of the web app:

INFO: Portable JNDI names for EJB TestErpBean :
[java:global/erp.web/TestErpBean,
java:global/erp.web/TestErpBean!erp.domain.test.erp.TestErpBean]
3774 [main] INFO org.jboss.weld.Version - WELD-000900 SNAPSHOT
3811 [main] INFO
org.hibernate.validator.engine.resolver.DefaultTraversableResolver -
Instantiated an instance of
org.hibernate.validator.engine.resolver.JPATraversableResolver.
03.09.2011 21:06:36 org.jboss.weld.util.ServiceLoader prepareInstance
WARNUNG: Could not instantiate service class
org.glassfish.osgicdi.impl.OSGiServiceExtension
java.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.DeployerImpl.deploy(DeployerImpl.java:129)
    at
com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:105)
    at erp.test.TransactionTest.setUp(TransactionTest.java:111)

but i added the following dependency to hte POM and everything is ok now with
glassfish embedded:

        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>4.2.0</version>
            <scope>test</scope>
        </dependency>

 

 


--
[Message sent by forum member 'chris.joelly']
View Post: http://forums.java.net/node/839727