Solved

Problem with Log4J & Tomcat

Posted on 2009-07-14
12
547 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
copyEndy  challenge 15 58
How Complex Is This Java Course ? 9 63
Java - Why doesn't this JFrame work 3 18
Java Loop 4 22
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…
Verbose logging is used to diagnose garbage collector problems. By default, -verbose:gc output is written to either native_stderr.log or native_stdout.log.   It is also possible to redirect the logs to a user-specified file. This article will de…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

746 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