[Resolved] Error log4j:WARN during startup

Do you have some idea how to make ArgoUML better and want to discuss it? Post here!

Please note that the only official place to request enhancements is the issue tracking system on the main ArgoUML site at http://argouml.tigris.org.

[Resolved] Error log4j:WARN during startup

Postby casertap on 19 Oct 2009, 16:22

The error:
log4j:WARN No such property [follow] in org.apache.log4j.ConsoleAppender.
which appear on startup of argouml since the version 0.26 is problematic for me because it makes crash my javaagent.

log4j:WARN No such property [follow] in org.apache.log4j.ConsoleAppender.
Fatal error on startup. ArgoUML failed to start.
java.lang.NullPointerException
at java.util.ResourceBundle.getBundle(Unknown Source)
at org.tigris.gef.util.Localizer.addResource(Unknown Source)
at org.tigris.gef.util.Localizer.addResource(Unknown Source)
at org.tigris.gef.util.Localizer.addResource(Unknown Source)
at org.argouml.i18n.Translator.init(Unknown Source)
at org.argouml.application.Main.initTranslator(Unknown Source)
at org.argouml.application.Main.initPreinitialize(Unknown Source)
at org.argouml.application.Main.main(Unknown Source)

I use this command: java -Xms1G -Xmx4G -Xss1G -javaagent:myagent.jar -jar argouml.jar

What does the warning means ?
Maybe my exception can help developper of the projet to find the problem and correct it.
Last edited by casertap on 22 Oct 2009, 12:23, edited 1 time in total.
casertap
 
Posts: 5
Joined: 19 Oct 2009, 15:59

Re: Error log4j:WARN during startup

Postby ThomasNeustupny on 19 Oct 2009, 20:39

Which version do you use? Does this also occurs when you launch ArgoUML in the normal way (using the start script) or with you command line without the "-javaagent:myagent.jar" part?
--
Thomas Neustupny
Developer
ThomasNeustupny
 
Posts: 344
Joined: 08 May 2008, 12:59
Location: Berlin, Germany

Re: Error log4j:WARN during startup

Postby casertap on 20 Oct 2009, 13:16

Effectively I get the same warning if I start without the agent.
so I found that the ressources is not found by the program (maybe the classpath).

So I tried some experiment without my agent.
The Argouml 0.28.1 is composed of a root directory with all the Jars it needs
and a /ext/ directory with additional Jars files.

The only way, for me, to correct the error is to move the
anarres-cpp-no-dependencies-1.2.3.jar FROM /ext/ to the root.
I didn't succed with the java -cp option (this is very strange).
Moreover I didn't succed to remove the error using my agent.
I change the Manifest etc ... but nothing works.

I took a look into the anarres-cpp-no-dependencies-1.2.3.jar and I think that
the log4j.properties file is problematic.
maybe these lines:

# Set root logger level to DEBUG and its only appender to stdout.
log4j.rootLogger=INFO, stdout

# stdout is set to be a ConsoleAppender.
log4j.appender.stdout=org.apache.log4j.ConsoleAppender

I check and the file log4j-1.2.6.jar is declared in my manifest (so it would be ok)

I havn't found the solution yet.
casertap
 
Posts: 5
Joined: 19 Oct 2009, 15:59

Re: Error log4j:WARN during startup

Postby ThomasNeustupny on 21 Oct 2009, 08:40

The file anarres-cpp-no-dependencies-1.2.3.jar is used for C++ import and generation. If you don't need support for C++, then maybe a solution for you would be to (re)move the following two files from your ext directory:

anarres-cpp-no-dependencies-1.2.3.jar
argo_cpp.jar

BTW, I got used to clean up the ext directory to keep ArgoUML a little bit lighter. But don't remove the argouml-diagrams-sequence.jar file, because this contains the new sequence diagram implementation. With just this file in the ext dir, ArgoUML would still be a full UML design application, because only code generation, reverse engineering and other GUI languages would be missing.

However, I still can't reproduce your problem.
--
Thomas Neustupny
Developer
ThomasNeustupny
 
Posts: 344
Joined: 08 May 2008, 12:59
Location: Berlin, Germany

Re: Error log4j:WARN during startup

Postby casertap on 22 Oct 2009, 10:18

thanks you very much ThomasNeustupny, you solve the problem of the "log4j:WARN No such property [follow] in org.apache.log4j.ConsoleAppender."

But the exception is still here so the exception have no relation with the warning :(

Even if I start my program with a empty agent (empty premain, empty transform) the exception bellow appear:

Fatal error on startup. ArgoUML failed to start.
java.lang.NullPointerException
at java.util.ResourceBundle.getBundle(ResourceBundle.java:960)
at org.tigris.gef.util.Localizer.addResource(Localizer.java:199)
at org.tigris.gef.util.Localizer.addResource(Localizer.java:183)
at org.tigris.gef.util.Localizer.addResource(Localizer.java:171)
at org.argouml.i18n.Translator.init(Translator.java:124)
at org.argouml.application.Main.initTranslator(Main.java:280)
at org.argouml.application.Main.initPreinitialize(Main.java:270)
at org.argouml.application.Main.main(Main.java:147)

Somebody have an idea why this exception appear with an agent and not in the usual runtime.
casertap
 
Posts: 5
Joined: 19 Oct 2009, 15:59

Re: Error log4j:WARN during startup

Postby ThomasNeustupny on 22 Oct 2009, 12:16

After inspecting the code I'm pretty sure that in the agent case the call Localizer.class.getClassLoader() returns null. So class loading is different then. The class (org.tigris.gef.util.)Localizer is located in gef-<version>.jar in the ArgoUML directory btw. Try to provide a similar classpath environment when running with that (to me unknown) agent. I don't know how to do that though.
--
Thomas Neustupny
Developer
ThomasNeustupny
 
Posts: 344
Joined: 08 May 2008, 12:59
Location: Berlin, Germany

Re: Error log4j:WARN during startup

Postby casertap on 22 Oct 2009, 12:18

I found my error.

It seems that you must not write all the jar file of the argouml software in the Manifest of the agent.
First my manisfest was :

Manifest-Version: 1.0
Premain-Class: MyAgent
Can-Retransform-Classes: true
Can-Redefine-Classes: true
Boot-Class-Path: antlr-2.7.7.jar argouml.jar argouml-mdr.jar argouml-model.jar
asm-3.2.jar asm-commons-3.2.jar asm-util-3.2.jar commons-cli.jar commons-logging-1.0.2.jar dt.jar gef-0.13.jar java-interfaces.jar
jedit.jar jmi.jar jmiutils.jar log4j-1.2.6.jar mdrapi.jar mof.jar nbmdr.jar ocl-argo-1.1.jar openide-util.jar swidgets-0.1.4.jar
toolbar-1.4.1-20071227.jar MyAgent.jar Azureus2.jar apple-extensions.jar commons-cli.jar log4j.jar swt.jar

Finally I change it to:

Manifest-Version: 1.0
Premain-Class: MyAgent
Can-Retransform-Classes: true
Can-Redefine-Classes: true
Boot-Class-Path: asm-3.2.jar asm-analysis-3.2.jar asm-commons-3.2.jar MyAgent.jar

And now it works.

Thanks everybody
sorry for the inconvenience
casertap
 
Posts: 5
Joined: 19 Oct 2009, 15:59

Re: Error log4j:WARN during startup

Postby casertap on 22 Oct 2009, 12:21

Sorry thanks ThomasNeustupn your the only one who helped me.
casertap
 
Posts: 5
Joined: 19 Oct 2009, 15:59


Return to Suggestions and enhancements

Who is online

Users browsing this forum: No registered users and 1 guest

cron