Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » RCP, log4j and webstart
RCP, log4j and webstart [message #466415] Wed, 18 April 2007 15:39 Go to next message
Eclipse UserFriend
Originally posted by: seah.sherley.gmail.com

Hi all,

I am trying to get these 3 to work together. Initially log4j and RCP works well together. I have create a log4j.xml and in the configuration of the start-up of the RCP I have added the following -Dlogging.configuation=/path/to/log4j.xml.

Then I started to explore webstart. I want my user to access the client via webstart. However, when I do this, the logging fails. I do not know where to add the configuration -Dlogging.configuation=/path/to/log4j.xml. And correct me if I am wrong also that using the configuation method, it is unable to access the signed jars that is wanted by the web start....

Help.... thank you!!!!!!
Re: RCP, log4j and webstart [message #466611 is a reply to message #466415] Mon, 23 April 2007 05:25 Go to previous messageGo to next message
Antony Saba is currently offline Antony SabaFriend
Messages: 4
Registered: July 2009
Junior Member
Seah Sherley wrote:
> Hi all,
>
> I am trying to get these 3 to work together. Initially log4j and RCP works well together. I have create a log4j.xml and in the configuration of the start-up of the RCP I have added the following -Dlogging.configuation=/path/to/log4j.xml.
If you haven't already, you should probably start with this article to
get the basic classloading issues dealt with:
http://www.eclipsezone.com/articles/franey-logging/?source=a rchives

On top of that, JWS adds a whole new level of classloading pain. In
particular, watch out for things that use the thread context
classloader. You may have to set the log4j.ignoreTCL system property to
tell log4j to ignore it when loading appenders. If you have to include
real commons-logging (not the replacement given in the article), you
will probably also need a commons-logging.properties with the following:
use_tccl=false

>
> Then I started to explore webstart. I want my user to access the client via webstart. However, when I do this, the logging fails.
What kind of errors are you getting? ClassCastExceptions or the log4j
error about not finding a valid configuration? The latter would appear
in the Java console that you can force to open by setting a Java Web
Start preference.

> I do not know where to add the configuration
-Dlogging.configuation=/path/to/log4j.xml.
Anything that would normally end up in config.ini or in the applications
..ini file should go in the main jnlp file, according to the example from
the RCP docs:
http://help.eclipse.org/help32/topic/org.eclipse.platform.do c.isv/guide/java_web_start.htm

Where do you really expect the log4j.xml file to exist on the disk of
the client machines? Every user will have to a log configuration file
in the same place for the above to work with an absolute path.

> And correct me if I am wrong also that using the configuation method,
it is unable to access the signed jars that is wanted by the web start....
>
I'm not sure what you meant here, other then general class loading
issues as mentioned above.

> Help.... thank you!!!!!!

This is what I ended up doing:
1. Built the logging jars according to the article.
2. In the plugin that contains my applications:
a) Registered it as a buddy of log4j (and commons-logging)
b) Put the log4j config for the app in the default package of that
jar (and commons-logging.properties)
c) Used an absolute path like ${user.home}/.appworkspace/app.log as
the path for a FileAppender, where @user.home/.appworkspace is what I
have defined in the main .jnlp file for osgi.instance.area.

This works for us because our app doesn't really use a workspace, so the
user won't have multiple ones. We also don't expect to make changes to
the logging config once the app is running on a user's machine, so it
doesn't matter that the log4j config is in a jar.

-Tony
Re: RCP, log4j and webstart [message #466622 is a reply to message #466611] Mon, 23 April 2007 08:29 Go to previous message
Eclipse UserFriend
Originally posted by: seah.sherley.gmail.com

Thanks for your reply!!! I will try it now!!!
Previous Topic:some question about the rcp database application
Next Topic:Exported product does not include my own plugin's binaries
Goto Forum:
  


Current Time: Fri Apr 26 12:33:10 GMT 2024

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

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

Back to the top