Solved

Problem with Log4J & Tomcat

Posted on 2009-07-14
12
553 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
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 will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

777 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