Solved

Problem with Log4J & Tomcat

Posted on 2009-07-14
12
573 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
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
 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to implement Singleton Design Pattern in Java.

726 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