Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Classloader (?) problem in Birt
Classloader (?) problem in Birt [message #254318] Tue, 04 September 2007 07:00 Go to next message
Eclipse UserFriend
Originally posted by: R.Schuster.dzbw.de

Hi,

I use Eclipse 3.3.0 and Birt 2.2.0 together with Java 1.6. I developed a
custom Datasource / Dataset extension which consists of 3 plugins: The 1st
one is simply a wrapper plugin which contains own and 3rd party libraries
(JBoss Client API and others). The 2nd contains the implementations of
IDriver, IConnection and so on. The last one creates a custom wizard page.

My Connection implementation reads in an external config file which
contains

birt {
// jBoss LoginModule
org.jboss.security.ClientLoginModule required
;
};

to load the JBoss login code.

My Java code also uses reflection implicitly to load some more "classes"
like in env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");

I can now create a Datasource and a Dataset. By double-clicking the new
Dataset and selecting "Preview Results" my plugin logs in to JBoss and
loads and displays data. Anything is good at this point.

But if I put the fields of my Dataset in a report page (a table for
example) and press the "Preview" tab of the designer an error occurs: "The
login module class cannot be found: org.jboss.security.ClientLoginModule".

This sounds like a problem with Eclipses class loading mechanism. I
googled the famous web page
http://www.eclipsezone.com/articles/eclipse-vms/ and gave the buddy class
loading a try. But no success.

Can somebody explain why it works in the Datasource property dialog but
not with in the Preview tab? What to do to solve the issue? Hard-coding
the call to ClientLoginModule is no solution because reflection is used at
other places, too.

Regards,

Roger
Re: Classloader (?) problem in Birt [message #254333 is a reply to message #254318] Tue, 04 September 2007 08:45 Go to previous messageGo to next message
Alexander Bieber is currently offline Alexander BieberFriend
Messages: 44
Registered: July 2009
Member
Hi Roger,

afaik BIRT report previews are executed using the eclipse tomcat plugin,
which will start the tomcat with its own classpath. I think you'll have
to add the jboss libs into the tomcats classpath. It might work putting
the jbossall-client.jar into the scriptlib directory of the birt viewer
plugin: org.eclipse.birt.report.viewer.

See
http://wiki.eclipse.org/BIRT/FAQ/Scripting#Q:_Where_do_I_hav e_to_put_my_classes_in_order_to_access_them_by_JavaScript.3F

Best regards
Alex


Roger Schuster wrote:
> Hi,
>
> I use Eclipse 3.3.0 and Birt 2.2.0 together with Java 1.6. I developed a
> custom Datasource / Dataset extension which consists of 3 plugins: The
> 1st one is simply a wrapper plugin which contains own and 3rd party
> libraries (JBoss Client API and others). The 2nd contains the
> implementations of IDriver, IConnection and so on. The last one creates
> a custom wizard page.
>
> My Connection implementation reads in an external config file which
> contains
>
> birt {
> // jBoss LoginModule
> org.jboss.security.ClientLoginModule required
> ;
> };
> to load the JBoss login code.
>
> My Java code also uses reflection implicitly to load some more "classes"
> like in env.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.jnp.interfaces.NamingContextFactory");
>
> I can now create a Datasource and a Dataset. By double-clicking the new
> Dataset and selecting "Preview Results" my plugin logs in to JBoss and
> loads and displays data. Anything is good at this point.
>
> But if I put the fields of my Dataset in a report page (a table for
> example) and press the "Preview" tab of the designer an error occurs:
> "The login module class cannot be found:
> org.jboss.security.ClientLoginModule".
> This sounds like a problem with Eclipses class loading mechanism. I
> googled the famous web page
> http://www.eclipsezone.com/articles/eclipse-vms/ and gave the buddy
> class loading a try. But no success.
> Can somebody explain why it works in the Datasource property dialog but
> not with in the Preview tab? What to do to solve the issue? Hard-coding
> the call to ClientLoginModule is no solution because reflection is used
> at other places, too.
>
> Regards,
>
> Roger
>
>
Re: Classloader (?) problem in Birt [message #254367 is a reply to message #254333] Tue, 04 September 2007 10:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: R.Schuster.dzbw.de

Hi Alexander,

I put the *.jar with the 3rd party libs into the birt/scriptlib directory
of the viewer plugin. I restarted Eclipse and tested it by "Run as Eclipse
Application". Unfortunately it still doesn't work.

Anyway, thank you for your help.

Regards,

Roger

Alexander Bieber wrote:

> afaik BIRT report previews are executed using the eclipse tomcat plugin,
> which will start the tomcat with its own classpath. I think you'll have
> to add the jboss libs into the tomcats classpath. It might work putting
> the jbossall-client.jar into the scriptlib directory of the birt viewer
> plugin: org.eclipse.birt.report.viewer.

> See
>
http://wiki.eclipse.org/BIRT/FAQ/Scripting#Q:_Where_do_I_hav e_to_put_my_classes_in_order_to_access_them_by_JavaScript.3F
Re: Classloader (?) problem in Birt [message #254370 is a reply to message #254318] Tue, 04 September 2007 10:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: R.Schuster.dzbw.de

Hi again,

after some debugging I discovered that if I make
org.eclipse.birt.report.data.adapter depend from my wrapper plugin it will
work! But I can't believe that a custom ODA will need the modification of
Birt sources or configuration. Any idea, please?

Roger
Re: Classloader (?) problem in Birt [message #254381 is a reply to message #254318] Tue, 04 September 2007 12:56 Go to previous messageGo to next message
Snjezana Peco is currently offline Snjezana PecoFriend
Messages: 789
Registered: July 2009
Senior Member
I had a similar problem that I solved using buddy classloading.
You can take a look at this thread:
http://dev.eclipse.org/newslists/news.eclipse.birt/msg20903. html

Snjeza

Roger Schuster wrote:
> Hi,
>
> I use Eclipse 3.3.0 and Birt 2.2.0 together with Java 1.6. I developed a
> custom Datasource / Dataset extension which consists of 3 plugins: The
> 1st one is simply a wrapper plugin which contains own and 3rd party
> libraries (JBoss Client API and others). The 2nd contains the
> implementations of IDriver, IConnection and so on. The last one creates
> a custom wizard page.
>
> My Connection implementation reads in an external config file which
> contains
>
> birt {
> // jBoss LoginModule
> org.jboss.security.ClientLoginModule required
> ;
> };
> to load the JBoss login code.
>
> My Java code also uses reflection implicitly to load some more "classes"
> like in env.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.jnp.interfaces.NamingContextFactory");
>
> I can now create a Datasource and a Dataset. By double-clicking the new
> Dataset and selecting "Preview Results" my plugin logs in to JBoss and
> loads and displays data. Anything is good at this point.
>
> But if I put the fields of my Dataset in a report page (a table for
> example) and press the "Preview" tab of the designer an error occurs:
> "The login module class cannot be found:
> org.jboss.security.ClientLoginModule".
> This sounds like a problem with Eclipses class loading mechanism. I
> googled the famous web page
> http://www.eclipsezone.com/articles/eclipse-vms/ and gave the buddy
> class loading a try. But no success.
> Can somebody explain why it works in the Datasource property dialog but
> not with in the Preview tab? What to do to solve the issue? Hard-coding
> the call to ClientLoginModule is no solution because reflection is used
> at other places, too.
>
> Regards,
>
> Roger
>
>
Re: Classloader (?) problem in Birt [message #254511 is a reply to message #254381] Wed, 05 September 2007 06:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: firstname.lastname.napa.fi

On Tue, 04 Sep 2007 15:56:33 +0300, Snjezana Peco <snjeza.peco@gmail.com>
wrote:

> I had a similar problem that I solved using buddy classloading.
> You can take a look at this thread:
> http://dev.eclipse.org/newslists/news.eclipse.birt/msg20903. html

I have a similar problem: javascript in the RCP designer preview fails
to find the classes exported by my ODA runtime plugin, so I tried adding
the following lines to that plugin's manifest.mf:


Eclipse-RegisterBuddy: org.eclipse.birt.report.data.adapter,
org.eclipse.tomcat,
org.mozilla.rhino,
org.eclipse.birt.report.viewer


It didn't help, did I choose the wrong buddies?



-Antti-
Re: Classloader (?) problem in Birt [message #254523 is a reply to message #254511] Wed, 05 September 2007 07:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: firstname.lastname.napa.fi

On Wed, 05 Sep 2007 09:48:16 +0300, Antti Karanta
<firstname.lastname@napa.fi> wrote:

> On Tue, 04 Sep 2007 15:56:33 +0300, Snjezana Peco
> <snjeza.peco@gmail.com> wrote:
>
>> I had a similar problem that I solved using buddy classloading.
>> You can take a look at this thread:
>> http://dev.eclipse.org/newslists/news.eclipse.birt/msg20903. html
>
> I have a similar problem: javascript in the RCP designer preview
> fails to find the classes exported by my ODA runtime plugin, so I tried
> adding the following lines to that plugin's manifest.mf:

To clarify: into my ODA runtime plugin's manifest.mf.


> Eclipse-RegisterBuddy: org.eclipse.birt.report.data.adapter,
> org.eclipse.tomcat,
> org.mozilla.rhino,
> org.eclipse.birt.report.viewer

I also threw in org.eclipse.birt.report.engine, but to no avail. I guess
I'm still being a buddy with the wrong plugins?



-Antti-
Re: Classloader (?) problem in Birt [message #254535 is a reply to message #254523] Wed, 05 September 2007 11:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: R.Schuster.dzbw.de

Antti Karanta wrote:

Hi,

> To clarify: into my ODA runtime plugin's manifest.mf.


>> Eclipse-RegisterBuddy: org.eclipse.birt.report.data.adapter,
>> org.eclipse.tomcat,
>> org.mozilla.rhino,
>> org.eclipse.birt.report.viewer

> I also threw in org.eclipse.birt.report.engine, but to no avail. I guess
> I'm still being a buddy with the wrong plugins?

AFAIK this can't work because at least
org.eclipse.birt.report.data.adapter doesn't offer a BuddyPolicy.

Regards,

Roger
Re: Classloader (?) problem in Birt [message #254561 is a reply to message #254535] Wed, 05 September 2007 23:22 Go to previous messageGo to next message
Snjezana Peco is currently offline Snjezana PecoFriend
Messages: 789
Registered: July 2009
Senior Member
Every plugin supports buddy classloading.
In order to solve that issue, you have to patch some BIRT's plugins.

I have done the following:
- added Eclipse-BuddyPolicy: registered to the org.mozilla.rhino plugin
- added Eclipse-RegisterBuddy: org.mozilla.rhino to my viewer plugin (I
have a specific viewer plugin, but you can try to use the BIRT viewer
plugin)
- fixed classloading problem in the org.eclipse.birt.report.engine as it
is described in
http://dev.eclipse.org/newslists/news.eclipse.birt/msg20833. html

After these changes Preview Results in the scripted datasource as well
as Preview in the viewer work correctly.

Snjeza

Roger Schuster wrote:
> Antti Karanta wrote:
>
> Hi,
>
>> To clarify: into my ODA runtime plugin's manifest.mf.
>
>
>>> Eclipse-RegisterBuddy: org.eclipse.birt.report.data.adapter,
>>> org.eclipse.tomcat,
>>> org.mozilla.rhino,
>>> org.eclipse.birt.report.viewer
>
>> I also threw in org.eclipse.birt.report.engine, but to no avail. I
>> guess I'm still being a buddy with the wrong plugins?
>
> AFAIK this can't work because at least
> org.eclipse.birt.report.data.adapter doesn't offer a BuddyPolicy.
>
> Regards,
>
> Roger
>
Re: Classloader (?) problem in Birt [message #254594 is a reply to message #254561] Thu, 06 September 2007 07:41 Go to previous message
Eclipse UserFriend
Originally posted by: firstname.lastname.napa.fi

On Thu, 06 Sep 2007 02:22:08 +0300, Snjezana Peco <snjeza.peco@gmail.com>
wrote:

> Every plugin supports buddy classloading.

I suppose he meant it's not enabled.


> In order to solve that issue, you have to patch some BIRT's plugins.
>
> I have done the following:
> - added Eclipse-BuddyPolicy: registered to the org.mozilla.rhino plugin
> - added Eclipse-RegisterBuddy: org.mozilla.rhino to my viewer plugin (I
> have a specific viewer plugin, but you can try to use the BIRT viewer
> plugin)
> - fixed classloading problem in the org.eclipse.birt.report.engine as it
> is described in
> http://dev.eclipse.org/newslists/news.eclipse.birt/msg20833. html
>
> After these changes Preview Results in the scripted datasource as well
> as Preview in the viewer work correctly.

Thanks a lot for your help. I was able to get the preview working by
enabling buddying in org.eclipse.birt.report.viewer plugin's manifest.mf
like this:

Eclipse-BuddyPolicy: registered

and then registering my ODA runtime plugin as its buddy:

Eclipse-RegisterBuddy: org.eclipse.birt.report.viewer



-Antti-
Previous Topic:Accessing an arbitrary data set row with javascript
Next Topic:Timezones
Goto Forum:
  


Current Time: Sat Nov 09 05:05:59 GMT 2024

Powered by FUDForum. Page generated in 0.03857 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top