Piotr Sobczyk

Greenhorn
+ Follow
since Dec 06, 2009
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Piotr Sobczyk

Chapter 10, question 11.

Answer marked as correct is A that is:

javac -classpath MyJar.jar GetJar.java
java GetJar


But java launcher cannot find myApp.Foo class that resides inside MyJar.jar and MyJar.jar isn't explicitly pointed by -classpath argument in java launcher.
For certainity I prepared the same enviroment as in question:



and invocation of

java GetJar

returns:

Exception in thread "main" java.lang.NoClassDefFoundError: myApp/Foo
at GetJar.main(GetJar.java:3)
Caused by: java.lang.ClassNotFoundException: myApp.Foo
...



For answer A to be correct there should be Foo.class instead of Foo.java in myApp branch OR java part should look like this:

java -classpath .:MyJar.jar GetJar
As in topic. How can I configure logging in Tomcat 6.0.20 so that every log file was truncated (deleted and recreated) everytime I launch application? There would be no problem with it if configuration were still by log4j.xml/properties but I just can't do it now when Juli is logging system .
14 years ago
Ok, some of problem has been partially solved.

It seems that is a real problem only on Linux. Under Windows Tomcat 6.0 logs error messages to one of its log files (localhost.log). I didn't manage to get that on Linux, though.
14 years ago
Of course everything works fine with the same project and the same log4j.properties files on Tomcat 5.5. What's going on with logging system on Tomcat 6?
14 years ago
However I still have a problem with logging on Tomcat 6. Here is my "log4j.properties" file that I placed in WEB-INF/classes directory of my application:



However any messages BELOW info are not logged (for example ERROR). If I set


logged are messages of INFO and above levels but I still can't see what are my errors! And there are certainly errors because my application can't start.
14 years ago
Allright, it seems that I finally solved this problem. For everyone who want to deploy seam application on Tomcat: the solution was to put archive jboss-el.jar from Seam distribution into commons/lib directory of Tomcat 5.5 or into lib directory of Tomcat 6. As Tim already said, there is no need to add anything to web.xml.

Is there any more general rule about what files have to be put in Tomcat's (and not in application's lib) to be visible?
14 years ago

Tomcat6 includes the EL implementation library as part of the core server. Tomcat5 did not, so you had to include it in your WAR.

You shouldn't have to code any EL stuff in web.xml normally.



About wchich specific jar(s) are you writing?

el-api.jar? jsp-api.jar? These are only jars that seems to be connected with ek in Tomcat 6 distribution. Howewer I do not want to use standard implementation, but the one from jboss (jboss-el), packaged with jboss-el.jar that I added to my classpath. How can I specify it if not through web.xml
14 years ago
Ok, I added web.xml entry that exception message suggests to add:



Now I'm explicitly pointing that I want to user jboss EL implementation of expression factory. However this entry seems to be ignored and the exception remains .
14 years ago
I'm JBoss Seam user and I'm trying to migrate from JBoss to Tomcat 5.5. However the issue I've met seems to have nothing to do with Seam but rather JSF libraries. After adding
JSF libaries (jsf-api.jar,jsf-impl.jar,jstl.jar and even standard.jar from tomcat jsp example like Tomcat documentation advises here: http://www.horstmann.com/bigj2/tomcat-jsf.html), I'm stil getting the same exception:



Have anyone come along such problem? I Really don't know what to do.

Probably the newest version of Tomcat (6.0) doesn't have this problem but it uses juli logging system at default and it hides all messages of priority higher than INFO which is juli's default level. Can anyone tell me how to set logging configuration file (log4j.properties?) to log at levels higher than INFO? Thanks in advance.
14 years ago