users@glassfish.java.net

Embeddable Glassfish 3.1 problem

From: <forums_at_java.net>
Date: Mon, 16 May 2011 05:41:40 -0500 (CDT)

Hello

I developed a JAX RESTService for reading out data from a smartcard, using a
smartcard reader.
Everything is working fine using the Glassfish 3.1 server (in netbeans).

Now I want to deploy my RESTService, but I want to embed glassfish 3.1 in it,

I downloaded the "glassfish embeddable 3.1 - alll" JAR and added this to my
project.
 

I used following code to start the server:

<code>

 public static void main(String[] args){
        try {
            /** Create and start GlassFish */
             GlassFish glassfish =
GlassFishRuntime.bootstrap().newGlassFish();
           
             glassfish.start();
       
        } catch (GlassFishException ex) {
           
Logger.getLogger(GFDeployer.class.getName()).log(Level.SEVERE, null, ex);
        }
       
    }

</code>

This gives me an exception with the following stacktrace:

run:
16-mei-2011 12:36:29
com.sun.enterprise.v3.server.CommonClassLoaderServiceImpl findDerbyClient
INFO: Cannot find javadb client jar file, derby jdbc driver will not be
available by default.
16-mei-2011 12:36:29
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory
processXMLProbeProviders
SEVERE: MNTG0301:Cannot process XML ProbeProvider, xml =
jersey-gf-server-probe-provider.xml
java.lang.IllegalStateException: Provider already mapped
glassfish:jersey:server-hidden
    at
org.glassfish.flashlight.impl.core.ProbeProviderRegistry.registerProbeProvider(ProbeProviderRegistry.java:100)
    at
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.registerProvider(FlashlightProbeProviderFactory.java:538)
    at
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.processXMLProbeProviders(FlashlightProbeProviderFactory.java:363)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.processProbeProviderXML(MonitoringBootstrap.java:474)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.processManifest(MonitoringBootstrap.java:350)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.addProvider(MonitoringBootstrap.java:291)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.verifyModule(MonitoringBootstrap.java:235)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.discoverProbeProviders(MonitoringBootstrap.java:178)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.enableMonitoringForProbeProviders(MonitoringBootstrap.java:614)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.postConstruct(MonitoringBootstrap.java:166)
    at
com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
    at
com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at
com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at
com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at
com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:219)
    at
com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
    at
com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
    at contribute.eidReider.deployer.GFDeployer.main(GFDeployer.java:21)
16-mei-2011 12:36:29
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory
processXMLProbeProviders
SEVERE: MNTG0301:Cannot process XML ProbeProvider, xml =
jersey-gf-bundle-probe-provider.xml
java.lang.IllegalStateException: Provider already mapped
glassfish:jersey:server-hidden
    at
org.glassfish.flashlight.impl.core.ProbeProviderRegistry.registerProbeProvider(ProbeProviderRegistry.java:100)
    at
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.registerProvider(FlashlightProbeProviderFactory.java:538)
    at
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.processXMLProbeProviders(FlashlightProbeProviderFactory.java:363)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.processProbeProviderXML(MonitoringBootstrap.java:474)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.processManifest(MonitoringBootstrap.java:350)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.addProvider(MonitoringBootstrap.java:291)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.verifyModule(MonitoringBootstrap.java:235)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.discoverProbeProviders(MonitoringBootstrap.java:178)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.enableMonitoringForProbeProviders(MonitoringBootstrap.java:614)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.postConstruct(MonitoringBootstrap.java:166)
    at
com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
    at
com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at
com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at
com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at
com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:219)
    at
com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
    at
com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
    at contribute.eidReider.deployer.GFDeployer.main(GFDeployer.java:21)
16-mei-2011 12:36:29
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory
processXMLProbeProviders
SEVERE: MNTG0301:Cannot process XML ProbeProvider, xml =
META-INF/gfprobe-provider.xml
java.lang.IllegalStateException: Provider already mapped
glassfish:javamail:smtp-transport
    at
org.glassfish.flashlight.impl.core.ProbeProviderRegistry.registerProbeProvider(ProbeProviderRegistry.java:100)
    at
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.registerProvider(FlashlightProbeProviderFactory.java:538)
    at
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.processXMLProbeProviders(FlashlightProbeProviderFactory.java:363)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.processProbeProviderXML(MonitoringBootstrap.java:474)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.processManifest(MonitoringBootstrap.java:350)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.addProvider(MonitoringBootstrap.java:291)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.verifyModule(MonitoringBootstrap.java:235)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.discoverProbeProviders(MonitoringBootstrap.java:178)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.enableMonitoringForProbeProviders(MonitoringBootstrap.java:614)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.postConstruct(MonitoringBootstrap.java:166)
    at
com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
    at
com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at
com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at
com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at
com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:219)
    at
com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
    at
com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
    at contribute.eidReider.deployer.GFDeployer.main(GFDeployer.java:21)
16-mei-2011 12:36:29
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory
processXMLProbeProviders
SEVERE: MNTG0301:Cannot process XML ProbeProvider, xml =
META-INF/mojarra-jsf-api-probe-provider.xml
java.lang.IllegalStateException: Provider already mapped
glassfish:jsf:faces-servlet
    at
org.glassfish.flashlight.impl.core.ProbeProviderRegistry.registerProbeProvider(ProbeProviderRegistry.java:100)
    at
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.registerProvider(FlashlightProbeProviderFactory.java:538)
    at
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.processXMLProbeProviders(FlashlightProbeProviderFactory.java:363)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.processProbeProviderXML(MonitoringBootstrap.java:474)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.processManifest(MonitoringBootstrap.java:350)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.addProvider(MonitoringBootstrap.java:291)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.verifyModule(MonitoringBootstrap.java:235)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.discoverProbeProviders(MonitoringBootstrap.java:178)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.enableMonitoringForProbeProviders(MonitoringBootstrap.java:614)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.postConstruct(MonitoringBootstrap.java:166)
    at
com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
    at
com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at
com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at
com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at
com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:219)
    at
com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
    at
com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
    at contribute.eidReider.deployer.GFDeployer.main(GFDeployer.java:21)
16-mei-2011 12:36:29
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory
processXMLProbeProviders
SEVERE: MNTG0301:Cannot process XML ProbeProvider, xml =
jersey-gf-server-probe-provider.xml
java.lang.IllegalStateException: Provider already mapped
glassfish:jersey:server-hidden
    at
org.glassfish.flashlight.impl.core.ProbeProviderRegistry.registerProbeProvider(ProbeProviderRegistry.java:100)
    at
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.registerProvider(FlashlightProbeProviderFactory.java:538)
    at
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.processXMLProbeProviders(FlashlightProbeProviderFactory.java:363)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.processProbeProviderXML(MonitoringBootstrap.java:474)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.processManifest(MonitoringBootstrap.java:350)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.addProvider(MonitoringBootstrap.java:291)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.verifyModule(MonitoringBootstrap.java:235)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.discoverProbeProviders(MonitoringBootstrap.java:178)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.enableMonitoringForProbeProviders(MonitoringBootstrap.java:614)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.postConstruct(MonitoringBootstrap.java:166)
    at
com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
    at
com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at
com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at
com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at
com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:219)
    at
com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
    at
com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
    at contribute.eidReider.deployer.GFDeployer.main(GFDeployer.java:21)
16-mei-2011 12:36:29
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory
processXMLProbeProviders
SEVERE: MNTG0301:Cannot process XML ProbeProvider, xml =
jersey-gf-statsprovider-probe-provider.xml
java.lang.IllegalStateException: Provider already mapped
glassfish:jersey:server
    at
org.glassfish.flashlight.impl.core.ProbeProviderRegistry.registerProbeProvider(ProbeProviderRegistry.java:100)
    at
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.registerProvider(FlashlightProbeProviderFactory.java:538)
    at
org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.processXMLProbeProviders(FlashlightProbeProviderFactory.java:363)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.processProbeProviderXML(MonitoringBootstrap.java:474)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.processManifest(MonitoringBootstrap.java:350)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.addProvider(MonitoringBootstrap.java:291)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.verifyModule(MonitoringBootstrap.java:235)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.discoverProbeProviders(MonitoringBootstrap.java:178)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.enableMonitoringForProbeProviders(MonitoringBootstrap.java:614)
    at
org.glassfish.admin.monitor.MonitoringBootstrap.postConstruct(MonitoringBootstrap.java:166)
    at
com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
    at
com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at
com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at
com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at
com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:219)
    at
com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
    at
com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
    at contribute.eidReider.deployer.GFDeployer.main(GFDeployer.java:21)
16-mei-2011 12:36:30 org.glassfish.ha.store.spi.BackingStoreFactoryRegistry
register
INFO: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy
for persistence-type = replicated in BackingStoreFactoryRegistry
16-mei-2011 12:36:30 com.sun.enterprise.v3.services.impl.GrizzlyService
createNetworkProxy
INFO: Network listener http-listener on port 0 disabled per domain.xml
16-mei-2011 12:36:30 com.sun.enterprise.v3.services.impl.GrizzlyService
createNetworkProxy
INFO: Network listener https-listener on port 0 disabled per domain.xml
16-mei-2011 12:36:30 com.sun.enterprise.v3.services.impl.GrizzlyService
createNetworkProxy
INFO: Network listener http-listener on port 0 disabled per domain.xml
16-mei-2011 12:36:30 com.sun.enterprise.v3.services.impl.GrizzlyService
createNetworkProxy
INFO: Network listener https-listener on port 0 disabled per domain.xml
16-mei-2011 12:36:30 com.sun.enterprise.v3.server.AppServerStartup run
SEVERE: Startup service failed to start :
com.sun.enterprise.naming.GlassFishNamingBuilder
16-mei-2011 12:36:30 com.sun.enterprise.v3.server.AppServerStartup run
INFO: GlassFish Server Open Source Edition 3.1 (java_re-private) startup time
: Embedded (645ms), startup services(834ms), total(1.479ms)
16-mei-2011 12:36:30
org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread
run
INFO: JMXStartupService: JMXConnector system is disabled, skipping.
Exception in thread "main" java.lang.IllegalStateException: AMX Booter MBean
is already registered: amx-support:type=boot-amx
    at org.glassfish.admin.mbeanserver.BootAMX.<init>(BootAMX.java:88)
    at org.glassfish.admin.mbeanserver.BootAMX.create(BootAMX.java:103)
    at
org.glassfish.admin.mbeanserver.JMXStartupService.postConstruct(JMXStartupService.java:121)
    at
com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
    at
com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at
com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at
com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at
com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:326)
    at
com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
    at
com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
    at contribute.eidReider.deployer.GFDeployer.main(GFDeployer.java:21)
Java Result: 1
BUILD SUCCESSFUL (total time: 5 seconds)

 

I can't find any solution for it...
 


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