Jim Patrick

Ranch Hand
+ Follow
since Dec 27, 2005
Jim likes ...
Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jim Patrick

Hi Tim,

First of all, thank you for the reply.
Probably the folks new to log4j FileAppenders find your reply very useful..

and all I did was, added "logs" folder in c: drive as suggested and it worked.


Regards,
Jim
11 years ago
Hi

In my sample java web application, I have configured log4j.

I have this in my log4j.properties:



In the RollingFileAppender section above, I have below line.
log4j.appender.myDebug.File=/logs/VPRJ_DEBUG.log

I can see the log in eclipse console window but there is no VPRJ_DEBUG.log file created anywhere.
could someone tell me where exactly the VPRJ_DEBUG.log file willl be created?
will it be created under C:\apache-tomcat-6.0.18\logs or somewhere in the WebContent folder in my application(I am using eclipse IDE)?

This is the exception in console:

INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: \logs\VPRJ_DEBUG.log (The system cannot find the path specified)


Regards,
Jim
11 years ago
Hi

I am new to using log4j. I am just trying out a sample Java web application using tomcat6.0.18, log4j(log4j1.2.11.jar), Struts, and Eclipse Juno IDE on Windows

My Issue - I can see the DEBUG and INFO logs in eclipse console window but somehow they are not logged to a file. Not sure if I have missed something.
Could someone please help me?

Below is the log4j configuration in my sample application for reference:


1) log4j.properties:
I have this file under src folder in my application in eclipse IDE


log4j.rootLogger=DEBUG, myDebug, myConsole

# Configure the myConsoleappender
log4j.appender.myConsole=org.apache.log4j.ConsoleAppender
log4j.appender.myConsole.layout=org.apache.log4j.PatternLayout
log4j.appender.myConsole.layout.ConversionPattern=%d{yyyy-MMM-dd HH:mm:ss,SSS} - %p %c - %m%n

# Configure the myDebug appender
log4j.appender.myDebug=org.apache.log4j.RollingFileAppender
log4j.appender.myDebug.File=/logs/mylog.log
log4j.appender.myDebug.MaxFileSize=100000KB
log4j.appender.myDebug.MaxBackupIndex=1
log4j.appender.myDebug.Threshold=DEBUG
log4j.appender.myDebug.layout=org.apache.log4j.PatternLayout
log4j.appender.myDebug.layout.ConversionPattern=%d{yyyy-MMM-dd HH:mm:ss,SSS} - %p %c - %m%n


2) web.xml:

<servlet>
<servlet-name>action</servlet-name>
<servlet-class>com.vprapplication.struts.VPRActionServlet</servlet-class>
<init-param>
<param-name>log4j-properties-location</param-name>
<param-value>WEB-INF/log4j.properties</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>


Please let me know if any other details are needed.

Thanks in advance,

-Jim Patrick
hi,

I know what a singleton pattern means. but when do we need to use this pattern(in what situations)?

Regards,
Jim
Hi,

I have the following errors in my sample struts web application. The application works fine without any errors. only thing is that, it shows errors in the files i mentioned below:

1)
error:
The errors below were detected when validating the file "validator_1_1_3.dtd" via the file "validation.xml". In most cases these errors can be detected by validating "validator_1_1_3.dtd" directly. However it is possible that errors will only occur when validator_1_1_3.dtd is validated in the context of validation.xml.

It shows this error in the very first line in validation.xml file:
<?xml version="1.0" encoding="ISO-8859-1" ?>


2) and I have this error in validator-rules.xml file
error:
The errors below were detected when validating the file "validator_1_1_3.dtd" via the file "validator-rules.xml". In most cases these errors can be detected by validating "validator_1_1_3.dtd" directly. However it is possible that errors will only occur when validator_1_1_3.dtd is validated in the context of validator-rules.xml.

It shows this error in the very first line in validator-rules.xml file:

<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">


3) Similarly, i have an error in this first line of hibernate.cfg.xml:
<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">

error:
The errors below were detected when validating the file "hibernate-configuration-3.0.dtd" via the file "hibernate.cfg.xml". In most cases these errors can be detected by validating "hibernate-configuration-3.0.dtd" directly. However it is possible that errors will only occur when hibernate-configuration-3.0.dtd is validated in the context of hibernate.cfg.xml.


4) and have an error in this first line of my empdata.hbm.xml:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

error:
The errors below were detected when validating the file "hibernate-mapping-3.0.dtd" via the file "empdata.hbm.xml". In most cases these errors can be detected by validating "hibernate-mapping-3.0.dtd" directly. However it is possible that errors will only occur when hibernate-mapping-3.0.dtd is validated in the context of empdata.hbm.xml

Please let me know what is causing these errors.


Thanks.
13 years ago
Thanks Bharat..checked the link, but it only shows how to do the client side validation..my question was, how we can perform client-side as well as server-side validation at the same time using validator framework in struts.

13 years ago
Hi,

Using the Validator framework in Struts, can we do client-side javascript validation(before submitting the form) and server-side validation(after submitting the form) to validate the fields in a form(eg: jsp)? If yes, then how? also please suggest an article/tutorial if possible.


Thanks.

13 years ago
Hi,

What is the role of PlatformTransactionManager interface in spring?

Rgds,
Jim.

14 years ago
Hi

How is a request processed in Struts 2 after a form is submitted?
please explain in detail steps with complete flow.
appreciate if any links are posted..

Rgds,
Jim.
14 years ago
Hi

I have a Tomcat web application which was created using Eclipse 3.1.
Now I need to run the same application on Eclipse Europa.
what additional configuration do i have to make for it to run on Eclipse Europa?

thanks,
Jim.

Originally posted by Merrill Higginson:
What version of Eclipse are you using? Do you have the WTP plugin installed? Have you configured a server within WTP? If so, which server did you configure?



I am using Eclipse Europa..do we have to install the WTP Plugin separately? i mean..isn't it there by default in the plug-in's? and how do i know if the WTP plugin is installed/not ? because in the Help>About Eclipse Platform>Plug-in details, it doesnt show the plugin with name "WTP Plug-in". It has these plugins==>
WTP UI Plug-in,WTP EJB UI Plug-in,WTP J2EE UI Plug-in,WTP JCA UI Plug-in,WTP Servlet UI Plug-in and WTP Webservice UI Plug-in.


thanks,
Jim.
[ April 02, 2008: Message edited by: Jim Patrick ]
16 years ago
ok Anand, thats fine..
Isn't there a better way to uninstall Eclipse than to delete the eclipse folder?
isn't theer a better approach than to delete the plugin from the file system?