[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
NP exception in java.util.Hashtable  XML
Forum Index -> General
Author Message
efremov

neo

Joined: 06/14/2008 13:34:09
Messages: 7
Offline

Hello.
Try to make work terracotta-3.0.0-stable1 with glassfish v2.1-b60e-linux.jar.
java version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) 64-Bit Server VM (build 11.2-b01, mixed mode)

Sure I got well known issue with com.sun.enterprise.server.logging.ServerLogManager.
Go ahead and try to use admin console, Doesnt work.
NP exception in java.util.Hashtable.__tc_get(Hashtable.java:334) seems very weird to see.

Is there anybody who gets it run? What version of glassfish I have to use? jdk?
Question: how to make it works?

sincerely,
alexandre efremov


WARNING: Admin MBean Registry is not found
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.sun.enterprise.admin.meta.MBeanRegistryEntry.<init>(MBeanRegistryEntry.java:306)
at com.sun.enterprise.admin.meta.MBeanRegistry.loadMBeanRegistry(MBeanRegistry.java:394)
at com.sun.enterprise.admin.meta.MBeanRegistry.loadMBeanRegistry(MBeanRegistry.java:377)
at com.sun.enterprise.admin.meta.MBeanRegistryFactory.getAdminMBeanRegistry(MBeanRegistryFactory.java:264)
at com.sun.enterprise.config.serverbeans.validation.DomainMgr.<init>(DomainMgr.java:116)
at com.sun.enterprise.config.serverbeans.validation.DomainMgr.<init>(DomainMgr.java:98)
at com.sun.enterprise.config.serverbeans.validation.DomainMgr.<init>(DomainMgr.java:94)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at com.sun.enterprise.admin.server.core.AdminContextImpl.registerValidator(AdminContextImpl.java:142)
at com.sun.enterprise.admin.server.core.AdminContextImpl.setServerContext(AdminContextImpl.java:111)
at com.sun.enterprise.admin.server.core.AdminService.createAdminService(AdminService.java:248)
at com.sun.enterprise.admin.server.core.AdminServiceLifeCycle.onInitialization(AdminServiceLifeCycle.java:115)

Caused by: java.lang.NullPointerException
at java.util.Hashtable.__tc_get(Hashtable.java:334)
at java.util.Hashtable.get(Hashtable.java)
at com.sun.enterprise.util.i18n.StringManagerBase.getStringManager(StringManagerBase.java:133)
at com.sun.enterprise.ee.admin.lbadmin.mbeans.LoadBalancerAdminConfig.<clinit>(LoadBalancerAdminConfig.java:122)
... 28 more
teck

seraphim
[Avatar]
Joined: 05/24/2006 15:03:25
Messages: 1128
Offline

I'm not sure if anyone knows whether glassfish 2.1 works with Terracotta. We test with v1 and v2, but v2.1 is not in our support matrix.

The NullPointerException is in a "__tc_" method but that really isn't terracotta code. There is a null being passed to Hashtable.get() from com.sun.enterprise.util.i18n.StringManagerBase.getStringManager(). Terracotta could still easily be to blame for why null is getting passed there, but there isn't anything wrong with Hashtable really.

Tim Eck (terracotta engineer)
efremov

neo

Joined: 06/14/2008 13:34:09
Messages: 7
Offline

Hello there,

Clearly, I have no intention to blame terracotta. I try to find a working solution.
Well, from http://www.terracotta.org/web/display/docs/Platform+Support page I see that v2 is supported. But seriously, It just stands for v2.1. Because I don't think that somebody uses previous releases in production. So many bugs. the last one hopefully fixed in glassfish v2.1-b60e. (concurrency issue with ejbclassloader) Dont want to mention others. You can check out glassfish site to get full list. Just curious about your answer.
Will be very glad to see a workaround. I gonna set up last release 2.1 and try with it.
I meant if somebody has got it work well, It clearly saves time for others.

sincerely,
alexandre efremov
teck

seraphim
[Avatar]
Joined: 05/24/2006 15:03:25
Messages: 1128
Offline

To the best of my knowledge there isn't anyone using Terracotta with glassfish 2.1 yet. If you (or someone) else already has or would like to develop a patch to get things working, we'd be more than happy to accept it :-).

I entered a feature request in our database so that at least folks know we need to add support for this latest version of glassfish
https://jira.terracotta.org/jira/browse/CDV-1229


Tim Eck (terracotta engineer)
efremov

neo

Joined: 06/14/2008 13:34:09
Messages: 7
Offline

Hello,

Dont think that this problem is relevant to particular glassfish version.
The well know issue has its root in terracotta hook. The problem emerges even before glassfish class is loader by ClassLoader into jvm, Thus there is no way to set ThreadContextClassLoader to make LogManager works.

NP exception is due to standard java LogManager, glassfish cant just work with. But Terracotta's hook fails to load it. And it shouldnt.
Even If I remove harm from systemLoaderInitialized I still get the same error because of terracotta context initialization. Is it possible to load it lazy?

Well. There is another issue with 3.0.0-stable1. I tried to add tim-glassfish-v2 into tc-config.xml and got "Unable to resolve dependency TIM: modules-base version"

sincerely,
alexandre efremov

1.Hook does too much. Application class is not even loaded.
a)
java.lang.ClassNotFoundException: com.sun.enterprise.server.logging.ServerLogManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at sun.misc.Launcher$AppClassLoader.findClass(Launcher.java)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.util.logging.LogManager$1.run(LogManager.java:166)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:156)
at com.tc.object.bytecode.hook.impl.ClassProcessorHelper.systemLoaderInitialized(ClassProcessorHelper.java:793)
at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1336)
at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1295)

b) Even without LogManager.getLogManager() in systemLoaderInitialized it cat work
Could not load Logmanager "com.sun.enterprise.server.logging.ServerLogManager"
java.lang.ClassNotFoundException: com.sun.enterprise.server.logging.ServerLogManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at sun.misc.Launcher$AppClassLoader.findClass(Launcher.java)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.util.logging.LogManager$1.run(LogManager.java:166)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:156)
at java.util.logging.Logger.getLogger(Logger.java:273)
at sun.net.www.protocol.http.HttpURLConnection.<clinit>(HttpURLConnection.java:63)
at sun.net.www.protocol.http.Handler.openConnection(Handler.java:44)
at sun.net.www.protocol.http.Handler.openConnection(Handler.java:39)
at java.net.URL.openConnection(URL.java:945)
at com.tc.object.config.StandardDSOClientConfigHelperImpl.getPropertiesFromL2Stream(StandardDSOClientConfigHelperImpl.java:1841)
at com.tc.object.config.StandardDSOClientConfigHelperImpl.getServerGroupsFromL2(StandardDSOClientConfigHelperImpl.java:1871)
at com.tc.object.config.StandardDSOClientConfigHelperImpl.validateGroupInfo(StandardDSOClientConfigHelperImpl.java:1913)
at com.tc.object.DistributedObjectClient.start(DistributedObjectClient.java:279)
at com.tc.object.bytecode.ManagerImpl$2.execute(ManagerImpl.java:198)
at com.tc.lang.StartupHelper.startUp(StartupHelper.java:39)
at com.tc.object.bytecode.ManagerImpl.startClient(ManagerImpl.java:212)
at com.tc.object.bytecode.ManagerImpl.init(ManagerImpl.java:150)
at com.tc.object.bytecode.ManagerImpl.init(ManagerImpl.java:138)
at com.tc.object.bytecode.hook.impl.ClassProcessorHelper.createGlobalContext(ClassProcessorHelper.java:642)
at com.tc.object.bytecode.hook.impl.ClassProcessorHelper.initialize(ClassProcessorHelper.java:400)
at com.tc.object.bytecode.hook.impl.ClassProcessorHelper.defineClass0Pre(ClassProcessorHelper.java:680)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at sun.misc.Launcher$AppClassLoader.findClass(Launcher.java)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

2)FATAL - Unable to resolve dependency TIM: modules-base version [1.1.0.SNAPSHOT,1.2.0.SNAPSHOT) (group-id: org.terracotta.modules)


tim-glassfish-v2 version 1.1.0-SNAPSHOT (group-id: org.terracotta.modules, file: tim-glassfish-v2-1.1.0-SNAPSHOT.jar)
+- tim-glassfish-common version 1.1.0-SNAPSHOT (group-id: org.terracotta.modules, file: tim-glassfish-common-1.1.0-SNAPSHOT.jar)
+- tim-session-common version 1.1.0-SNAPSHOT (group-id: org.terracotta.modules, file: tim-session-common-1.1.0-SNAPSHOT.jar)
+- modules-base version [1.1.0.SNAPSHOT,1.2.0.SNAPSHOT) (group-id: org.terracotta.modules, file: modules-base-[1.1.0.SNAPSHOT,1.2.0.SNAPSHOT).jar)

modules/org/terracotta/modules/tim-glassfish-v2/1.1.0-SNAPSHOT/tim-glassfish-v2-1.1.0-SNAPSHOT.jar
modules/org/terracotta/modules/tim-session-common/1.1.0-SNAPSHOT/tim-session-common-1.1.0-SNAPSHOT.jar
modules/org/terracotta/modules/tim-glassfish-common/1.1.0-SNAPSHOT/tim-glassfish-common-1.1.0-SNAPSHOT.jar
modules/org/terracotta/modules/modules-base/1.0.0-SNAPSHOT/modules-base-1.0.0-SNAPSHOT.jar
efremov

neo

Joined: 06/14/2008 13:34:09
Messages: 7
Offline

Hello,

Well, because terracotta framework gets in on very early stage of glassfish start up process. Even before the main class is loaded! The only workaround that I see is to create faked version of ServerLogManager.
Compile faked ServerLogManager, SystemOutandErrHandler and put them as prefix into classpath.

unzip -l ~/logger.jar
com/sun/enterprise/server/logging/SystemOutandErrHandler.class
com/sun/enterprise/server/logging/ServerLogManager.class

<jvm-options>-Xbootclasspath/p:${user.home}/logger.jar:${user.home}/terracotta-2.7.3/lib/dso-boot/dso-boot-hotspot_linux_160_12.jar</jvm-options>

The server seems to work under terracotta 2.7.3.

sincerely,
alexandre efremov

package com.sun.enterprise.server.logging;
public class SystemOutandErrHandler {

}

package com.sun.enterprise.server.logging;
import java.util.MissingResourceException;
public class ServerLogManager extends LogManager{
@Override
public boolean addLogger(Logger logger) {
final String name;
if(logger.getResourceBundleName()!=null ||
(name=logger.getName())==null ||
"".equals(name) ||
Logger.GLOBAL_LOGGER_NAME.equals(name)){
return super.addLogger(logger);
}
if(!super.addLogger(logger)){
return false;
}
try{
Logger.getLogger(name, name.replaceFirst("javax.","com.sun.logging.") + ".LogStrings");
}catch(MissingResourceException ex){

}
return true;
}

public static void reInitializeServerLoggers() {

}
}

 
Forum Index -> General
Go to:   
Powered by JForum 2.1.7 © JForum Team