Solved

Problem with Log4J & Tomcat

Posted on 2009-07-14
12
551 Views
Last Modified: 2013-12-02
HI,

I have a web application which is using :
1. Apache Tomcat 6
2. Hibernate 3.2 with Annotations.
3. Struts 1.2

When I try to start my tomcat (with my web app deployed), The following error/warning messages is being displayed.
Also tomcat hangs for around 5 minutes then.

I have updated my log4j version to 1.2.15, still the problem is not rectified.

Waiting for your suggestions.
Thanks
Sandeep
C:\Tomcat60\bin>tomcat6

Jul 15, 2009 9:53:45 AM org.apache.catalina.core.AprLifecycleListener init

INFO: Loaded APR based Apache Tomcat Native library 1.1.16.

Jul 15, 2009 9:53:45 AM org.apache.catalina.core.AprLifecycleListener init

INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], ra

ndom [true].

Jul 15, 2009 9:53:46 AM org.apache.coyote.http11.Http11AprProtocol init

INFO: Initializing Coyote HTTP/1.1 on http-8080

Jul 15, 2009 9:53:46 AM org.apache.coyote.ajp.AjpAprProtocol init

INFO: Initializing Coyote AJP/1.3 on ajp-8009

Jul 15, 2009 9:53:46 AM org.apache.catalina.startup.Catalina load

INFO: Initialization processed in 1224 ms

Jul 15, 2009 9:53:46 AM org.apache.catalina.core.StandardService start

INFO: Starting service Catalina

Jul 15, 2009 9:53:46 AM org.apache.catalina.core.StandardEngine start

INFO: Starting Servlet Engine: Apache Tomcat/6.0.20

Jul 15, 2009 9:53:47 AM org.apache.catalina.startup.HostConfig deployWAR

INFO: Deploying web application archive e2cwebr3.war

log4j:WARN No appenders could be found for logger (org.apache.struts.util.Proper

tyMessageResources).

log4j:WARN Please initialize the log4j system properly.

Open in new window

0
Comment
Question by:sandeep1984
  • 4
  • 4
  • 2
  • +2
12 Comments
 
LVL 20

Assisted Solution

by:a_b
a_b earned 50 total points
ID: 24856436
0
 
LVL 92

Assisted Solution

by:objects
objects earned 100 total points
ID: 24856496
you're missing the log4j configuration file
and its not the cause of your slow startup
0
 
LVL 6

Expert Comment

by:jwenting
ID: 24856534
It's not an error anyway, it's a warning. Log4J will still work, it just won't do any output redirection and layout you might have wanted.
0
 
LVL 2

Author Comment

by:sandeep1984
ID: 24856539
Then, what might be the reason?
Please suggest me the solution.
0
 
LVL 92

Expert Comment

by:objects
ID: 24856591
you haven't provided sufficient details to determine cause
0
 
LVL 2

Author Comment

by:sandeep1984
ID: 24856596

Can you please specify What are the details required??
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 50 total points
ID: 24857129
You need to configure the log4j config file (which *is* present btw) so that key components (Hibarnate,Struts) are given appenders. This might well reveal the cause of your slow startup. Here's an example of Hibernate log4j config:

http://ideoplex.com/id/386/controlling-hibernate-output-with-log4j
0
 
LVL 92

Expert Comment

by:objects
ID: 24857142
> Can you please specify What are the details required??

check your other tomcat logs (eg. localhost log)
0
 
LVL 2

Author Comment

by:sandeep1984
ID: 24858040
In my struts-config.xml
I have given
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
                               "http://struts.apache.org/dtds/struts-config_1_2.dtd">

Id I remove DOCTYPE, tomcat works fine.
Is DOCTYPE necessary? Why it is used?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 24858095
I would imagine the cause is different. The DOCTYPE should be there. It's there in all mine and i have no problems
0
 
LVL 2

Accepted Solution

by:
sandeep1984 earned 0 total points
ID: 24858197
The problem is solved.
Thanks to all.

I have downloaded struts-config_1_2.dtd and kept it in web-inf.

Changed DOCTYPE to :

<!DOCTYPE struts-config PUBLIC
                  "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
                  "struts-config_1_2.dtd">

Thanks Again.
0
 
LVL 92

Expert Comment

by:objects
ID: 24858374
good work, it would have been timing out trying to resolve that
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now