Notes by nogeek
Displaying keyword search results 1 - 9
Created by nogeek on December 30, 2011 13:25:28
Last update: December 30, 2011 13:57:37
By default, tomcat uses an enhanced java.util.logging implementation called JULI, which can be configured at two different levels: Globally, with the ${catalina.base}/conf/logging.properties file. Per web application, with WEB-INF/classes/logging.properties . The configuration file is a normal Java properties file: Logging handlers are specified with the handlers property.
handlers = 1catalina.org.apache.juli.FileHandler, ... The root logger can define its set of handlers using the .handlers property. .handlers = 1catalina.org.apache.juli.FileHandler,... A prefix may be added to handler names. The prefix starts with a digit and ends with a dot ( . ), for example: # 1catalina. is a prefix 1catalina.org.apache.j... System property replacement is performed for property values which contain ${systemPropertyName} . Each handler can have its own specific properties: 3manager.org.apache.juli.FileHandler.level = FINE ... Loggers can define their own...
Created by nogeek on December 30, 2011 13:54:04
Last update: December 30, 2011 13:54:04
Tomcat 7.0 failed with a SEVERE error without printing a stack trace:
Dec 30, 2011 1:21:09 PM org.apache.catalina.core.S...
Now it's hard to figure out what's wrong without knowing where things went wrong. Why is Tomcat not logging anything?
Tomcat logging is configured by class loader. Logging behaves differently depending on which class loader loaded the logger. You'll need to look at both $CATALINA_BASE/conf/logging.properties and WEB-INF/classes/logging.properties to figure out why the stack trace is not logged.
In my case, the web app specific WEB-INF/classes/logging.properties overshadowed the system $CATALINA_BASE/conf/logging.properties and suppressed the stack trace.
Created by nogeek on November 27, 2011 12:24:27
Last update: November 27, 2011 12:24:27
There is no XSLT 2.0 support in the JDK as of 7.0. According to Stackoverflow , there are three Java packages that support XSLT 2.0: Saxon IBM WebSphere XML Feature Pack Oracle XDK There are no known support for XSLT in browsers. According to Wikipedia : XSLT is developed by the World Wide Web Consortium (W3C). The most recent version is XSLT 2.0, which reached W3C recommendation status on 23 January 2007. As of 2010, however, XSLT 1.0 is still widely used, as there are no products that support XSLT 2.0 running in the browser, nor on some important server environments such as LAMP. Expressions like this:
format-date(xs:date('1999-12-31'), '[D01] [MNn] ... where format-date is a XSLT 2.0 function and date is a XPath 2.0 constructor...
Created by nogeek on February 03, 2011 13:08:38
Last update: February 03, 2011 13:14:10
The log line was like this:
2011-01-19 15:16:34,842 INFO [STDOUT] (HDScanne... Note that INFO and timestamp were printed twice. Based on my configuration, I was expecting something like this: 2011-01-19 15:16:34,842 INFO [XmlWebApplicationC... i.e., the logger name should have been XmlWebApplicationContext , not STDOUT ! What was the problem? I found this error message in server.log : 2011-01-19 14:34:38,107 ERROR [STDERR] (main) lo... It turned out that org.apache.log4j.Appender was loaded by my web application class loader, whereas org.jboss.logging.appender.FileAppender was loaded by the JBoss bootstrap class loader. Removing the log4j jar from my web application archive fixed the problem (sine log4j is already available in JBoss). Why was the logger changed to STDOUT? JBoss detects that there's a problem with the log4j configuration and routes all...
Created by nogeek on December 31, 2010 11:56:25
Last update: December 31, 2010 11:56:25
These are the steps to create a JBoss 5.1.0 configuration with Tomcat from the built-in minimal configuration. Change directory to $JBOSS_HOME/server . Make a copy of the minimal configuration.
cp -R minimal tomcatonly Copy bindingservice.beans from the default configuration. cp -R default/conf/bindingservice.beans tomcatonly... Copy login-config.xml from the default configuration. cp default/conf/login-config.xml tomcatonly/conf/ Edit tomcatonly/conf/jboss-service.xml : Add jars from the common/lib directory: <!-- Load all jars from the JBOSS_DIST/serv... Add the JAAS security manager section (copy from the default profile, and yes, JBoss tomcat can't live without the JBoss JAAS manager). <!-- JAAS security manager and realm mappin... Copy the Tomcat (JBoss web) deployer from the default configuration. cp -R default/deployers/jbossweb.deployer tomcaton... Copy metadata-deployer-jboss-beans.xml and security-deployer-jboss-beans.xml from the default profile. cp default/deployers/metadata-deployer-jboss-b... Copy...
Created by nogeek on November 11, 2010 22:48:50
Last update: December 27, 2010 08:28:42
I need to create a Tomcat only configuration for JBoss 3.2.7. These are the steps:
Copy the minimal configuration to new configuration:
cd $JBOSS_HOME/server
cp -R minimal tomcatonly
...
Copy tomcat service from the default configuration to the new configuration:
cp -R default/deploy/jbossweb-tomcat50.sar tomcato...
Edit jboss-tomcat50.sar/META-INF/jboss-service.xml , comment out SecurityManagerService :
<!-- A mapping to the server security manager serv...
and TransactionManager :
<!--
<depends>jboss:service=TransactionManager<...
Copy jbosssx.jar , jboss-j2ee.jar and jboss.jar from default/lib to tomcatonly/lib .
Edit tomcatonly/conf/jboss-service.xml , change port 1098, 1099 to 1100, 1101.
Edit tomcatonly/deploy/jbossweb-tomcat50.sar/server.xml , change port 8080 to 8081; change port 8009 to 8010.
Start new configuration with:
bin/run.sh -c tomcatonly
Created by nogeek on November 11, 2010 23:58:24
Last update: November 11, 2010 23:59:24
After all I needed basic authentication for my Tomcat service running in JBoss. These are the steps to add the JBoss authentication service.
Edit jboss-tomcat50.sar/WETA-INF/jboss-service.xml , make sure SecurityManagerService is not commented out:
<!-- A mapping to the server security manager ...
Copy jboss-jaas.jar from the default config:
cp server/default/lib/jboss-jaas.jar server/myserv...
Add this section to server/myserver/conf/jboss-service.xml
<!-- ======================================...
Created by nogeek on November 11, 2010 00:26:08
Last update: November 11, 2010 00:29:43
This one is even more weird: it worked on Windows but failed on Linux, using default tools JDK1.6.0_20 on both. The exception thrown was:
java.lang.RuntimeException: Invalid conversion fro...
And the stack trace:
java.lang.RuntimeException: Invalid conversion fro...
This was the XSL used:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs...
The problem was , DateUtil.java had two getDate methods, one taking long parameter, the other taking a String parameter. And Java's XSLT get confused about which one to use:
import java.util.Date;
import java.text.SimpleD...
Created by nogeek on September 30, 2010 21:58:46
Last update: September 30, 2010 22:00:00
I had a lot of trouble adding a host to the known_hosts file with JSch . The readme says that if the property StrictHostKeyChecking is set to "no", JSch will automatically add the host to the known_hosts file. Or, if it is set to "ask", it will add the host after confirmation. However, it did not mention which program to run the get that behavior. I tried Exec first. It did exhibit the behavior mentioned in the README, but it did not add to the known_hosts file. Then I tried KnownHosts , which did add the host to the known_hosts file. However, the only way to exit from the program is to hit CTRL-C, which also killed the cmd window. It would have been a...