[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Messages posted by: efremov  XML
Profile for efremov -> Messages posted by efremov [7]
Author Message
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() {

}
}

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
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
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
I want to run something over all nodes that uses local resources. And that something has rights to fail.
I'm looking for a way to notify the callee thread about a failure.
Command pattern you refer to is just a java.lang.Runnable. Thus there's no way to throw an exception.
I try to understand what you mean but cant grasp your thoughts.
Hello!

As I've got a DMI call, it's something that will run across the cluster.
But is it allow to throw an exception within a DMI method.
node1 proceed well,
node2 throws an exception Ex1.
node3 throws an exception Ex2.
What will be the result for the callee thread. How to catch Ex1 and Ex2?
Is there something that may help to rollback the work on the node1?

Easy way is to not allow exceptions. But what to do if you've got a failure on nodeX?
Or on all nodes?

thank you in advance,
alexander efremov
Hello,

I'm new to terracotta, 2 hours of evaluation.
If I got the instrumentation right it does the same as jboss aop. etc dynamic instrumentation.

There is one bad thing about it. It slow dramatically startup. Applications tend to load a huge set of classes on start. This due to bad design. But its a real world and a developer isn't perfect.

JBoss's answer is a weaver that allows static instrumentation. Then startup goes much more faster.

Is there a tool to do static instrumentation for terracotta.

sincerely,
alexandre efremov
 
Profile for efremov -> Messages posted by efremov [7]
Go to:   
Powered by JForum 2.1.7 © JForum Team