-1

I'm trying to compile a simple Java application with Swing. It shows a jList from a sql query. That works.

I have a button to export a selection to a report, using a .jrmxl I've already did. That file works with the connection.

The problem is I need to include Jasperreports funcionality.

I got the message

log4j:ERROR Could not read configuration file [log4j-jms.properties]. java.io.FileNotFoundException: log4j-jms.properties (No such file or > directory)

The closest answered question I found was this:

How to set log4j.properties in Eclipse?

But I can't find where log4j-jms.properties is.

I'm using Xubuntu 11.04 and Eclipse 3.7.2.

Any help?

Community
  • 1
  • 1
Mark A.
  • 193
  • 1
  • 3
  • 14
  • I do not understand, why is the log4j-jms.properties being looked for in the first place ? Is JMS used by Jasper-reports ? – Ashutosh Jindal Aug 17 '12 at 12:15
  • @AshutoshJindal No, it does not used – Alex K Aug 17 '12 at 12:24
  • I got "log4j:WARN No appenders could be found for logger" when trying to use jasperreports. I found that including the line "PropertyConfigurator.configure("log4j-jms.properties");" that message disappeared, but then I got this new problem. – Mark A. Aug 17 '12 at 14:45

1 Answers1

1

Try putting the following in a file called log4j-jms.properties in the root of your src folder :

# Root logger option
log4j.rootLogger=FATAL


#configuring the JMS appender
log4j.appender.JMS=org.apache.log4j.net.JMSAppender

Optionally, try creating the same file as above with no contents ?

Another suggestion : I would suggest setting an exception breakpoint for java.io.FileNotFoundException. Then when it is hit, you can see the call trace in the debug view and just before where the exception break point is hit, you can see the path where log4j-jms.properties is being looked for.

Community
  • 1
  • 1
Ashutosh Jindal
  • 18,501
  • 4
  • 62
  • 91