2014-07-07 101 views
0

我試圖在tomcat 8(和jetty 9)和jvm 1.7.0_51中運行Hazelcast管理中心Web應用程序3.2.3版。我進入網頁並輸入默認的用戶名,登錄屏幕的密碼(admin:admin),我收到以下異常。 Hazelcast本身運行良好,我可以通過編程操作我的地圖。運行Hazelcast管理中心Web應用程序時出現NoClassDefFoundError

運行管理中心時是否有其他人遇到問題?

javax.servlet.ServletException: Filter execution threw an exception 
    root cause 

    java.lang.NoClassDefFoundError: Could not initialize class com.hazelcast.webmonitor.repositories.SerializationHelper 
    com.hazelcast.webmonitor.repositories.UserRepository.save(UserRepository.java:47) 
    com.hazelcast.webmonitor.repositories.UserRepository.login(UserRepository.java:88) 
    com.hazelcast.webmonitor.service.UserManager.login(UserManager.java:188) 
    com.hazelcast.webmonitor.service.UserManager.authenticate(UserManager.java:219) 
    org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156) 
    org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:94) 
    org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:195) 
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) 
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) 
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
    org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) 
    org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) 
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 

After removing the 2nd copy of the hazelcast jar I get this message when i try to login to the hazelcast war: 

    11-Jul-2014 17:00:10.891 WARNING [http-nio-8080-exec-1] com.hazelcast.webmonitor.repositories.UserRepository.null Problem while reading DataSerializable, namespace: 0, id: 0, class: com.hazelcast.webmonitor.model.User, exception: com.hazelcast.webmonitor.model.User 
    com.hazelcast.nio.serialization.HazelcastSerializationException: Problem while reading DataSerializable, namespace: 0, id: 0, class: com.hazelcast.webmonitor.model.User, exception: com.hazelcast.webmonitor.model.User 
     at com.hazelcast.nio.serialization.DataSerializer.read(DataSerializer.java:114) 
     at com.hazelcast.nio.serialization.DataSerializer.read(DataSerializer.java:36) 
     at com.hazelcast.nio.serialization.StreamSerializerAdapter.read(StreamSerializerAdapter.java:59) 
     at com.hazelcast.nio.serialization.SerializationServiceImpl.toObject(SerializationServiceImpl.java:221) 
     at com.hazelcast.webmonitor.repositories.SerializationHelper.deserialize(SerializationHelper.java:87) 
     at com.hazelcast.webmonitor.repositories.SerializationHelper.deserialize(SerializationHelper.java:94) 
     at com.hazelcast.webmonitor.repositories.UserRepository.get(UserRepository.java:151) 
     at com.hazelcast.webmonitor.repositories.UserRepository.login(UserRepository.java:80) 
     at com.hazelcast.webmonitor.service.UserManager.login(UserManager.java:188) 
     at com.hazelcast.webmonitor.service.UserManager.authenticate(UserManager.java:219) 
     at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156) 
     at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:94) 
     at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:195) 
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
     at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) 
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
     at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) 
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 
     at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) 
     at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) 
     at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 
     at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) 
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) 
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503) 
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136) 
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:78) 
     at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610) 
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) 
     at com.jamonapi.http.JAMonTomcatValve.invoke(JAMonTomcatValve.java:67) 
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526) 
     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1033) 
     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652) 
     at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) 
     at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566) 
     at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) 
     at java.lang.Thread.run(Thread.java:744) 
Caused by: java.lang.ClassNotFoundException: com.hazelcast.webmonitor.model.User 
     at java.net.URLClassLoader$1.run(URLClassLoader.java:366) 
     at java.net.URLClassLoader$1.run(URLClassLoader.java:355) 
     at java.security.AccessController.doPrivileged(Native Method) 
     at java.net.URLClassLoader.findClass(URLClassLoader.java:354) 
     at java.lang.ClassLoader.loadClass(ClassLoader.java:425) 
     at java.lang.ClassLoader.loadClass(ClassLoader.java:358) 
     at com.hazelcast.nio.ClassLoaderUtil.tryLoadClass(ClassLoaderUtil.java:123) 
     at com.hazelcast.nio.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:112) 
     at com.hazelcast.nio.ClassLoaderUtil.newInstance(ClassLoaderUtil.java:64) 
     at com.hazelcast.nio.serialization.DataSerializer.read(DataSerializer.java:103) 
     ... 41 more 

回答

2

您的classpath中是否有多個版本的Hazelcast JAR?如果是這樣,那麼您的類路徑中應該只有一個,以便正確構建Hazelcast和管理中心的序列化服務。

序列化服務在SerializationHelper類中被初始化爲一個靜態塊,因此拋出的異常傳播到類加載器,作爲NoClassDefFoundError

+0

這很有幫助。我在這裏安裝了hazelcast:/apache-tomcat-8.0.8/lib/hazelcast-3.2.3.jar,它似乎也被捆綁在戰爭中。我在戰爭中刪除了版本,並且tomcat不再有錯誤。
但是,我仍然無法登錄。我嘗試輸入admin:admin和dev:dev_password(來自hazelcast.xml)。
我收到以下錯誤:錯誤!錯誤的用戶名或密碼 ! – user3519746

相關問題