JSLEE Discussions
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
ClassLoader
Forum Index » Rhino SLEE Discussions
Author Message
mweber


Joined: 27/03/2008 00:52:45
Messages: 11
Offline

Hi,

I'm attempting to run radius server inside RA. I found JRadius server implementation works perfectly as standalone application but same code throws me some exceptions when it's used inside RA.

JRadius internally do following:


url is null but file net/jradius/handler/catalog.xml exists in one of the deployed libraries RA depends on.


Does anybody know how to struggle with class loaders inside platform?

What security privillages are required? [currently running with grant:java.security.AllPermission]

Regards
davidf


Joined: 30/01/2008 17:59:09
Messages: 492
Location: Wellington, New Zealand
Offline

Hi

Here is how Rhino's classloader structure works, and how to find out what is going wrong if you hit various class loader issues.

https://developer.opencloud.com/devportal/display/OCDEV/How+do+I+diagnose+class+loading+problems

Are you getting security permission issues or class loading issues ?

RAs have a restricted security context, but can get more permissions ...

If its a class loading issue you may want to make sure that external JARs that the RA uses are declared in a library-jar ... and the RA references that, or the RA contains all the classes that the library contains.
Library jar is a great way to go because then any Services etc can also declare a library-jar reference in their Deployment Descriptors, so that they can also access the classes.

David Ferry
Lead Architect VoLTE TAS
Metaswitch
mweber


Joined: 27/03/2008 00:52:45
Messages: 11
Offline

Hi,

Are you getting security permission issues or class loading issues ?


I find out it's a some kind of loader issue and not security problem at all. Classloader does not resolve url of given resource inside library. Yet, I did not figure out how to set different classloader for Thread.currentThread()

Library jar is a great way to go


Yes, I've already make library, that works well and should not be the issue

1. here is content of library-jar.xml



2. resource-adaptor-jar.xml



3. File jradius-extended-1.0.0.jar have following files

net/jradius/handler/SessionLogHandler.class
net/jradius/handler/catalog.xml

And here is two tests

A) first one works



B) second fails



Classloader returns null instead of

jar:file:/C%3a/RhinoSDK/work/deployment/unitX/jradius-common-lib_jradius-extended-1.0.0.jar!/net/jradius/handler/catalog.xml

So far I found only one workaround... that is to put jars directly in classpath, but that is not a solution :(

Regards
stevena


Joined: 27/03/2008 13:43:16
Messages: 274
Location: Cambridge, UK
Offline

Hi,

Instead of using the thread context class loader (which generally has little meaning in a SLEE), why not use the RA class' classloader? For example:



If the resource is in a library that the RA depends on, the classloader should find it. (This of course assumes the raVerifyConfiguration method is defined in a class loaded from the RA component jar, or some other component jar that depends on the library containing the resource.)


Steven Adams
Senior Software Engineer
OpenCloud
stevena


Joined: 27/03/2008 13:43:16
Messages: 274
Location: Cambridge, UK
Offline

Hi again,

Sorry, I didn't quite read your original post properly and got confused by your second post. You said that JRadius does the thread context load, not your code, so what you can try is something like this in your RA:



This should work so long as the JRadius code is attempting to load the resource in the same thread.

Steven Adams
Senior Software Engineer
OpenCloud
mweber


Joined: 27/03/2008 00:52:45
Messages: 11
Offline

Hi,

That's it, everything works now.

Mario
lipu


Joined: 07/10/2011 22:01:49
Messages: 1
Offline

Hi all,
I need to start HBase in starting time(./start-rhino.sh) of RhinoSDK 2.2.0.7

Can anyone help me out.
oliver


Joined: 29/10/2008 09:36:04
Messages: 680
Location: Cambridge, UK
Offline

I suggest you start a new topic with your question, not post a reply to some unrelated question from 3 years ago..
[Email]
 
Forum Index » Rhino SLEE Discussions
Go to:   
Powered by JForum 2.1.8 © JForum Team