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 29, 2011 13:31:44
Last update: December 29, 2011 14:29:13
Tomcat allows you to create multiple server instances for the same installation. The installation directory is identified as CATALINA_HOME , the instance directory is identified as CATALINA_BASE . Here are the steps: Create a base directory for the new instance, for example: /home/nogeek/tomcat1 . Create the subdirectories:
mkdir -p /home/nogeek/tomcat/{bin,conf,logs,temp,w... Copy web.xml from the installation directory: cp $CATALINA_HOME/conf/web.xml /home/nogeek/tomcat... Copy logging.properties from the installation directory: cp $CATALINA_HOME/conf/logging.properties /home/no... Create server.xml under tomcat1/conf : <?xml version='1.0' encoding='utf-8'?> <Server ... Create script setenv.sh under tomcat1/bin : # Edit this file to set custom options # Tomcat... Copy startup.sh and shutdown.sh from the installation directory. Add the following two lines to the beginning of each: CATALINA_BASE=/home/nogeek/tomcat1 export CATAL... Create a soft link for catalina.sh in tomcat1/bin : $ ln -s ~/apache-tomcat-7.0.22/bin/catalina.sh cat...
Created by nogeek on November 17, 2011 14:30:28
Last update: November 17, 2011 14:30:28
CATALINA_HOME is the root directory where Tomcat is installed.
CATALINA_BASE is the same as CATALINA_HOME for single instance Tomcat configuration. For multiple instance configurations CATALINA_BASE is the root of that instance.
The startup script prints out the values of CATALINA_HOME and CATALINA_BASE at startup:
Using CATALINA_BASE: "C:\Apps\tomcat-7.0.22"
...
Created by nogeek on March 21, 2011 15:31:26
Last update: March 21, 2011 15:32:35
Inventory list for configuring a JDBC data source in JBoss:
Put *-ds.xml configuration file in server/yourServer/deploy , e.g., hsqldb-ds.xml
Other needed files in server/yourServer/deploy : jboss-local-jdbc.rar , jboss-xa-jdbc.rar , jca-jboss-beans.xml , transaction-jboss-beans.xml
Copy jboss-jca.deployer directory to server/yourServer/deployers
Copy standardjbosscmp-jdbc.xml to server/yourServer/conf
Make sure the following lines appear in server/yourServer/conf/jboss-service.xml
<mbean code="org.jboss.ejb.plugins.cmp.jdbc.metada...
Created by nogeek on December 31, 2010 13:02:23
Last update: December 31, 2010 13:03:27
The JBoss Microcontainer provides three StructureDeployer implementations out-of-the-box, with relativeOrder values defined for each:
DeclaredStructure: relativeOrder 0
JARStructure: relativeOrder 10000
FileStructure: relativeOrder Integer.MAX_VALUE
At deployment time, the StructureDeployer with lower relativeOrder will be consulted first to determine the structure of a deployment. This means that DeclaredStructure is always called first followed by JARStructure and finally FileStructure .
DeclaredStructure allows you to specify the structure of a deployment, including any nested deployments, using an XML file named jboss-structure.xml placed in the deployment's META-INF directory. For example, the following is jboss-structure.xml for jbossweb.sar , the JBoss Tomcat service:
<?xml version="1.0" encoding="UTF-8"?>
<structu...
Created by nogeek on December 31, 2010 12:41:05
Last update: December 31, 2010 12:41:05
The JBoss JARStructure class determines whether a deployment, in the form of a file or a directory, represents a packaged or unpackaged JAR archive. If the deployment is a single file then the filename suffix is checked against the following list. If the deployment is a directory then the same check is performed using the directory name. If a match is found in either case, then the deployment is considered a JAR archive. A top level directory is always considered an unpackaged JAR archive, even when the suffix does not match. .zip - a standard archive .jar - a java archive (defined by the Java SE specification) .ear - an enterprise archive (defined by the Java EE specification) .rar - a resource archive (defined by...
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 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...
Created by nogeek on July 30, 2010 23:00:06
Last update: July 30, 2010 23:01:24
It happened on Windows XP with JBoss 5.1.0.GA. This is the stack trace:
2010-07-30 16:39:52,177 ERROR [org.jboss.kernel.pl... According to " (SOLVED) JBAS-7674 solution for JBoss 5.1?? (Windows lock on jnp-service.url) ", the problem seemed to be solved for JBoss 6. In the meanwhile for JBoss 5, disabling Windows Indexing Service seemed to solve the problem. Quote from aforementioned link: It seemed that a file was being locked for some reason, and that file was obviously necessary for JBoss to start. Some further investigation (ok, I admit, I just tried to delete all of JBoss with the faith that it would fail on the locked file), it turns out that file was some file called jnp-service.url in the data directory of the default server. After downloading...