[ 
http://issues.apache.org/jira/browse/HIVEMIND-106?page=comments#action_12372457 
] 

Noel Winstanley commented on HIVEMIND-106:
------------------------------------------

I've done some investigating into this - as not being able to webstart my 
hibernate app is a real show-stopper for me.

It seems that the root cause of the failure above is this exception:
Caused by: javassist.NotFoundException: org.apache.hivemind.schema.Translator
        at javassist.ClassPool.get(ClassPool.java:301)
        at 
org.apache.hivemind.service.impl.CtClassSource.getCtClass(CtClassSource.java:52)
        ... 59 more

I did some tinkering around with the sources for hivemind and javassist - in 
particular I plugged in my own 'ClassPath' implementation that printed out the 
classes being searched for, which classloader and thread, and whether it was 
able to load them or not.

Some previous classes - e.g. the hivemind serialization classes, were being 
loaded successfully. However, the Translator class (which is in the same 
hivemind jar) doesn't seem to be loadable as a resource. As far as I can see, 
there's nothing special about this class - apart from it being the first class 
to be loaded that is mentioned in the hivemind.xml file.

I don't know whether this is a bug or a mistaken 'feature' in the 
JNLPClassLoader implementation. Anyhow, try as I might, I couldn't find any way 
of getting the classloader to load this class as a resource. (although it was 
already visible as a class object).

However, all this trouble can be fixed by the one-liner        
System.setSecurityManager(null); 
right at the start of your program -- This probably requires <all-permissions/> 
to do - but this isn't a problem for my webstart app - which requires this 
anyhow.

Straight after nulling the security manager, I also added the following line, 
for good measure
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); 
(where 'this' is my main class, loaded by the JNLPClassLoader). I'm unsure 
whther this is strictly necessary, but doesn't do anyharm.

Since doing this, I've been able to webstart my app with no problems. (JRE 1.5)
So, a work-around for cases when you've the permission to zap the scurity 
manager.

hopefully this will be a clue on how to fix this bug properly to someone who 
really understands webstart/classloaders/java permissions.



> Problem running through web-start
> ---------------------------------
>
>          Key: HIVEMIND-106
>          URL: http://issues.apache.org/jira/browse/HIVEMIND-106
>      Project: HiveMind
>         Type: Bug
>   Components: framework
>     Versions: 1.0
>  Environment: Windows XP Service Pack 2 with Java 1.5_02
>     Reporter: Nicholas Stuart

>
> Trying to deploy a Hivemind enabled app through webstart doesn't appear to 
> work out so well. When you go to run the app and it trys to get the register 
> for the first time you get the following stacktrace:
> org.apache.hivemind.ApplicationRuntimeException: Unable to construct 
> configuration hivemind.Startup: No translator named 'object' has been 
> registered in configuration point hivemind.Translators.
>     at 
> org.apache.hivemind.impl.ConfigurationPointImpl.processContributionElements(ConfigurationPointImpl.java:273)
>     at 
> org.apache.hivemind.impl.ConfigurationPointImpl.constructElements(ConfigurationPointImpl.java:189)
>     at 
> org.apache.hivemind.impl.ElementsInnerProxyList.inner(ElementsInnerProxyList.java:46)
>     at 
> org.apache.hivemind.impl.ElementsInnerProxyList.size(ElementsInnerProxyList.java:62)
>     at 
> org.apache.hivemind.impl.ElementsProxyList.size(ElementsProxyList.java:60)
>     at java.util.AbstractList$Itr.hasNext(Unknown Source)
>     at org.apache.hivemind.impl.StartupImpl.run(StartupImpl.java:34)
>     at $Runnable_10332d56fe7.run($Runnable_10332d56fe7.java)
>     at $Runnable_10332d56fe6.run($Runnable_10332d56fe6.java)
>     at 
> org.apache.hivemind.impl.RegistryInfrastructureImpl.startup(RegistryInfrastructureImpl.java:378)
>     at 
> org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.java:154)
>     at 
> org.apache.hivemind.impl.RegistryBuilder.constructDefaultRegistry(RegistryBuilder.java:194)
>     at hivemindtest.HiveMindTest.main(HiveMindTest.java:19)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>     at java.lang.reflect.Method.invoke(Unknown Source)
>     at com.sun.javaws.Launcher.executeApplication(Unknown Source)
>     at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
>     at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
>     at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
>     at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
>     at com.sun.javaws.Launcher.run(Unknown Source)
>     at java.lang.Thread.run(Unknown Source)
> Caused by: org.apache.hivemind.ApplicationRuntimeException: No translator 
> named 'object' has been registered in configuration point 
> hivemind.Translators.
>     at 
> org.apache.hivemind.impl.TranslatorManager.findTranslatorClass(TranslatorManager.java:146)
>     at 
> org.apache.hivemind.impl.TranslatorManager.constructTranslator(TranslatorManager.java:112)
>     at 
> org.apache.hivemind.impl.TranslatorManager.getTranslator(TranslatorManager.java:92)
>     at 
> org.apache.hivemind.impl.RegistryInfrastructureImpl.getTranslator(RegistryInfrastructureImpl.java:477)
>     at org.apache.hivemind.impl.ModuleImpl.getTranslator(ModuleImpl.java:171)
>     at 
> org.apache.hivemind.impl.SchemaProcessorImpl.getTranslator(SchemaProcessorImpl.java:293)
>     at 
> org.apache.hivemind.impl.SchemaElement.getTranslator(SchemaElement.java:255)
>     at 
> org.apache.hivemind.impl.SchemaElement.getAttributeTranslator(SchemaElement.java:262)
>     at 
> org.apache.hivemind.impl.SchemaProcessorImpl.getAttributeTranslator(SchemaProcessorImpl.java:288)
>     at 
> org.apache.hivemind.schema.rules.PushAttributeRule.begin(PushAttributeRule.java:37)
>     at 
> org.apache.hivemind.impl.SchemaElement.fireBegin(SchemaElement.java:219)
>     at 
> org.apache.hivemind.impl.SchemaProcessorImpl.processElement(SchemaProcessorImpl.java:255)
>     at 
> org.apache.hivemind.impl.SchemaProcessorImpl.processRootElement(SchemaProcessorImpl.java:235)
>     at 
> org.apache.hivemind.impl.SchemaProcessorImpl.process(SchemaProcessorImpl.java:223)
>     at 
> org.apache.hivemind.impl.ConfigurationPointImpl.processContributionElements(ConfigurationPointImpl.java:268)
>     ... 23 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to