从Netbeans启动Glassfish 4.1.1时出错

时间:2016-05-09 18:18:29

标签: java-ee glassfish netbeans-8

从Netbeans启动Glassfish 4.1.1我得到了下一个例外:

java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer cannot be cast to org.glassfish.tyrus.server.TyrusServerContainer

这是我的日志:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=192m; support was removed in 8.0
objc[5414]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
Launching GlassFish on Felix platform
may 09, 2016 7:55:16 PM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner createBundleProvisioner
INFORMACIÓN: Create bundle provisioner class = class com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.
may 09, 2016 7:55:16 PM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner$DefaultCustomizer getLocations
ADVERTENCIA: Skipping entry  because it is not an absolute URI.
may 09, 2016 7:55:16 PM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner$DefaultCustomizer getLocations
ADVERTENCIA: Skipping entry  because it is not an absolute URI.
may 09, 2016 7:55:16 PM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner startBundles
ADVERTENCIA: Can not start bundle file:/Users/japochino/glassfish4.1.1/glassfish/modules/core.jar because it is not contained in the list of installed bundles.
Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishRuntime@2d14e1 in service registry.
#!## LogManagerService.postConstruct : rootFolder=/Users/japochino/glassfish4.1.1/glassfish
#!## LogManagerService.postConstruct : templateDir=/Users/japochino/glassfish4.1.1/glassfish/lib/templates
#!## LogManagerService.postConstruct : src=/Users/japochino/glassfish4.1.1/glassfish/lib/templates/logging.properties
#!## LogManagerService.postConstruct : dest=/Users/japochino/glassfish4.1.1/glassfish/domains/domain1/config/logging.properties
Información:   Running GlassFish Version: GlassFish Server Open Source Edition  4.1.1  (build 1)
Información:   Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter
Información:   Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
Información:   Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
Información:   Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
Información:   Authorization Service has successfully initialized.
Información:   Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
Advertencia:   Instance could not be initialized. Class=interface org.glassfish.grizzly.http.server.AddOn, name=http-listener-1, realClassName=org.glassfish.grizzly.http2.Http2AddOn
Información:   JTS5014: Recoverable JTS instance, serverId = [100]
Información:   Grizzly Framework 2.3.23 started in: 100ms - bound to [/0.0.0.0:8080]
Advertencia:   Instance could not be initialized. Class=interface org.glassfish.grizzly.http.server.AddOn, name=http-listener-2, realClassName=org.glassfish.grizzly.http2.Http2AddOn
Información:   Grizzly Framework 2.3.23 started in: 2ms - bound to [/0.0.0.0:8181]
Advertencia:   Instance could not be initialized. Class=interface org.glassfish.grizzly.http.server.AddOn, name=admin-listener, realClassName=org.glassfish.grizzly.http2.Http2AddOn
Información:   Grizzly Framework 2.3.23 started in: 1ms - bound to [/0.0.0.0:4848]
Información:   Grizzly Framework 2.3.23 started in: 1ms - bound to [/0.0.0.0:3700]
Información:   visiting unvisited references
Información:   Java security manager is disabled.
Información:   Entering Security Startup Service.
Información:   Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
Información:   Security Service(s) started successfully.
Información:   Created HTTP listener http-listener-1 on host/port 0.0.0.0:8080
Información:   Created HTTP listener http-listener-2 on host/port 0.0.0.0:8181
Información:   Created HTTP listener admin-listener on host/port 0.0.0.0:4848
Información:   Created virtual server server
Información:   Created virtual server __asadmin
Información:   Setting JAAS app name glassfish-web
Información:   Virtual server server loaded default web module 
Información:   WELD-000900: 2.2.13 (Final)
Información:   HV000001: Hibernate Validator 5.1.2.Final
WARN:   WELD-001700: Interceptor annotation class javax.ejb.PostActivate not found, interception based on it is not enabled
WARN:   WELD-001700: Interceptor annotation class javax.ejb.PrePassivate not found, interception based on it is not enabled
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Información:   WebModule[null] ServletContext.log():Spring WebApplicationInitializers detected on classpath: [org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration@580e26bb]
Información:   Registering WebSocket filter for url pattern /*
Información:   Inicializando Mojarra 2.2.12 ( 20150720-0848 https://svn.java.net/svn/mojarra~svn/tags/2.2.12@14885) para el contexto '/chp'
Información:   Monitoring jndi:/server/chp/WEB-INF/faces-config.xml for modifications
Información:   Running on PrimeFaces 5.2
Grave:   WebModule[/chp]Exception starting filter WebSocket filter
java.lang.InstantiationException
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:135)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:5329)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:5974)
    at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2286)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1932)
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:500)
    at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:406)
    at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:243)
    at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:326)
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:374)
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471)
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:228)
    at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:85)
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2072)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:114)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:88)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1213)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1144)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer cannot be cast to org.glassfish.tyrus.server.TyrusServerContainer
    at org.glassfish.tyrus.servlet.TyrusServletFilter.init(TyrusServletFilter.java:119)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:131)
    ... 28 more

Información:   Constructor Loging
Información:   Loading application [chp] at [/chp]
Información:   Loading application chp done in 45.554 ms
Información:   GlassFish Server Open Source Edition  4.1.1  (1) startup time : Felix (54.002ms), startup services(47.639ms), total(101.641ms)
Información:   Grizzly Framework 2.3.23 started in: 1ms - bound to [/0.0.0.0:7676]
Información:   JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://192.168.1.37:8686/jndi/rmi://192.168.1.37:8686/jmxrmi
Información:   Listening to REST requests at context: /management/domain.
Información:   Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl@232cce0 as OSGi service registration: org.apache.felix.framework.ServiceRegistrationImpl@6e106680.
Información:   visiting unvisited references
Información:   visiting unvisited references
Información:   visiting unvisited references
Información:   visiting unvisited references
Información:   Inicializando Mojarra 2.2.12 ( 20150720-0848 https://svn.java.net/svn/mojarra~svn/tags/2.2.12@14885) para el contexto ''
Información:   Loading application [__admingui] at [/]
Información:   Loading application __admingui done in 3.547 ms

有任何帮助吗? 感谢

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题。我尝试了一切,例如查找未使用的端口,重新配置xml文件中的端口,重新安装Netbeans和glassfish几次。

然后我卸载了Google Drive应用程序,我怀疑它会阻塞端口(它没有显示在活动监视器中或终端中的lsof命令)。卸载后,它工作正常!

因此,请尝试删除所有第三方云存储应用程序,例如Drive,Box,DropBox等,看看它是否有效。