JBoss7, 20.07.2011#

I downloaded Version 7.0.0.Final, Lightning, Web Profile Only. You may also try the nighly builds

Installation on Win7, 64bit#

set JBOSS_HOME and PATH as described
JBOSS_HOME=<jboss>
PATH=[...];<jboss>/bin
Start JBoss from a MS-Dos Box! When you double click the run.bat nothing happens.
Tip: To analyse the log you need to redirect output stream like this:
standalone.bat > test001.txt

Bug: correct standalone.bat:

"%JAVA%" %JAVA_OPTS% ^
 "-Dorg.jboss.boot.log.file=%JBOSS_HOME%\standalone\log\boot.log" ^
 "-Dlogging.configuration=file:%JBOSS_HOME%/standalone/configuration/logging.properties" ^
(---)  -jar "%JBOSS_HOME%\jboss-modules.jar" ^
(+++)  -jar %JBOSS_HOME%\jboss-modules.jar ^
    -mp "%JBOSS_HOME%\modules" ^
    -logmodule "org.jboss.logmanager" ^
    -jaxpmodule "javax.xml.jaxp-provider" ^
     org.jboss.as.standalone ^
    -Djboss.home.dir="%JBOSS_HOME%" ^
     %*
NO BUG! => You must define JBOSS_HOME WITHOUT ending backslash !!

Logging in JBoss7 and especially for Hibernate 3.6#

I tried to change it to make Hibernate show me all SQL parameter bindings.

Generell Information:
Java Logging API > logging.properties, used in JBoss
Apache Commons Logging (JCL) > wrapper for other implementations
SLF4J successor of log4j and used in Hibernate

Documentation:
(1) See JBoss7 Getting Started Guide > chapter "Configure Logging in JBoss Application Server 7"
(2) See JBoss7 Developer Guide > JBoss Logging
(3) See Hibernate (core 3.6) Configuration

    <property name="hibernate.show_sql" value="true"/>
To configure logging you have these destinations:
  1. $JBOSS_HOME/standalone/configuration/standalone.xml
  2. $JBOSS_HOME/standalone/configuration/logging.properties
  3. persistence.xml > Hibernate properties (show_sql)

In (1) it is stated that you should use the standalone.xml file to configure additional logging needs in this way:

<logger category="org.hibernate.type">
    <level name="TRACE"/>
</logger>
The root-logger defines the base settings for the other loggers to inherit by default.
For the log types see $JBOSS_HOME/docs/schema/jboss-logging.xsd.
I did not make it work, at startup you get a message like "disable bootstraps mode".
Maybe these settings are trashed after start (?).

I make it work just with just changing logging.properties:

# Additional logger names to configure (root logger is always configured)
# Markus Added:
loggers=org.jboss.as.config,org.hibernate.type

# Dump system environment at boot by default
logger.org.jboss.as.config.level=DEBUG

# Markus Added:
logger.org.hibernate.type.level=TRACE
logger.org.hibernate.type.handlers=org.hibernate.type

# Root logger level
logger.level=${jboss.boot.server.log.level:INFO}
# Root logger handlers
logger.handlers=FILE,CONSOLE

# Markus Added: Console handler configuration
handler.org.hibernate.type=org.jboss.logmanager.handlers.ConsoleHandler
handler.org.hibernate.type.properties=autoFlush
handler.org.hibernate.type.autoFlush=true
handler.org.hibernate.type.formatter=PATTERN

# Console handler configuration
handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler
handler.CONSOLE.properties=autoFlush
handler.CONSOLE.level=${jboss.boot.server.log.console.level:INFO}
handler.CONSOLE.autoFlush=true
handler.CONSOLE.formatter=PATTERN

# File handler configuration
handler.FILE=org.jboss.logmanager.handlers.FileHandler
handler.FILE.level=DEBUG
handler.FILE.properties=autoFlush,fileName
handler.FILE.autoFlush=true
handler.FILE.fileName=${org.jboss.boot.log.file:boot.log}
handler.FILE.formatter=PATTERN

# Formatter pattern configuration
formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter
formatter.PATTERN.properties=pattern
formatter.PATTERN.pattern=%d{HH:mm:ss,SSS} %-5p [%c] %s%E%n

Hibernate @GeneratedValue#

In JBoss 6 I used
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int tableLogId;
to get a key ID automatically.
With JBoss 7 I get the following error
17:19:31,609 ERROR [org.hibernate.id.enhanced.TableStructure] (http--127.0.0.1-8080-2) could not read a hi value: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'dp.hibernate_sequence' doesn't exist
After some research I found out, that it will work with
@GeneratedValue(strategy=GenerationType.IDENTITY)
So, obviously in JBoss 6 Hibernate has chosen IDENTITY by default for my MYSQL 5.0.27
and in JBoss 7 Hiberante choses SEQUENCE for MySQL.

Ubuntu 9.04, 32bit#

Memory settings:
JBOSS_HOME/bin/standalone.conf

if [ "x$JAVA_OPTS" = "x" ]; then
   JAVA_OPTS="-Xms196m -Xmx640m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
   JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.byteman"
fi
  1. set HOSTNAME
  2. edit file /etc/hostname
  3. edit file /etc/hosts

Start:

./standalone.sh > test001.txt & 
Stop:
ps -ef
kill <pid of java server>
Replace standalone.xml, public interface:
<interface name="public">
    <inet-address value="127.0.0.1"/>
</interface>
with
<interface name="public">
    <any-address />
</interface>

Mail Bug still in JBoss 7.0.1#

The class loader is somehow not loading all classes, you get this error:

javax.mail.MessagingException: IOException while sending message;
nested exception is:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; 

To correct it, follow AS7-1375 and add <dependencies> tag in
JBOSS_HOME/modules/javax/activation/api/main/module.xml:

<module xmlns="urn:jboss:module:1.0" name="javax.activation.api">
  <dependencies>
    <module name="javax.api" />
    <module name="javax.mail.api" >
    	<imports><include path="META-INF"/></imports>
    </module>	
  </dependencies>
  <resources>
    <resource-root path="activation-1.1.1.jar"/>
    <!-- Insert resources here -->
  </resources>
</module>	

JSP-Wiki#

By default JSPWiki is not working with JBoss 7. You need to make three corrections:
1. JSPWiki.war\WEB-INF\jspwiki.tld, delete following tag (this class is not defined in JSPWiki.jar):
  <tag>
    <name>RSSUserlandLink</name>
    <tagclass>com.ecyrd.jspwiki.tags.RSSCoffeeCupLinkTag</tagclass>
    <bodycontent>empty</bodycontent>
    <attribute>
       <name>title</name>
       <rtexprvalue>true</rtexprvalue>
    </attribute>
  </tag>

2. JSPWiki.war\WEB-INF\oscache.tld, remove 3x ".module" (there is no "module" in the oscache.jar)

  <tagclass>com.opensymphony.module.oscache.web.tag.CacheTag</tagclass>
  <tagclass>com.opensymphony.module.oscache.web.tag.UseCachedTag</tagclass>
  <tagclass>com.opensymphony.module.oscache.web.tag.FlushTag</tagclass>

3. Copy <JRE>\lib\rt.jar to JSPWiki.war\WEB-INF\lib\
Otherwise you get "java.lang.NoClassDefFoundError: Could not initialize class javax.security.auth.SubjectDomainCombiner". rt.jar contains SubjectDomainCombiner.

Prerequisites (Installation):
As of 03.08.2011 the latest version is still 2.8.4 though you can find discussions about a version 3.0 release. 1. Download JSPWiki 2.8.4
2. Extract (mkdir + cp + unzip/gunzig/tar xvf)
3. Copy JSPWiki.war to <JBOSS_HOME>\standalone\deployments
4. Unzip JSPWiki.war to a folder "JSPWiki.war" and remove file JSPWiki.war"
5. Adjust following properties in JSPWiki.war\WEB-INF\jspwiki.properties:

jspwiki.baseURL=http://localhost:8080/JSPWiki/
jspwiki.fileSystemProvider.pageDir =D:/lang/WebAppServer/jboss7/jspDataTest/
jspwiki.basicAttachmentProvider.storageDir =D:/lang/WebAppServer/jboss7/jspDataTest/
jspwiki.workDir = D:/lang/WebAppServer/jboss7/jspDataTmp/
jspwiki.security = jaas
log4j.appender.FileLog.File = D:/lang/WebAppServer/jboss7/jspDataTmp/jspwiki_log4j.log
log4j.rootCategory=INFO,FileLog

I raised a ticket at the developers JSPWIKI-699. But the class loading and validation has changed in JBoss 7. Anyway, I guess the first two are really bugs. I guess also that the rt.jar can be registered with JBoss 7 somehow differently.

Add to WEB-INF\Lib folder:
log4j-1.2.15.jar

JSPWiki security JBoss 7 Config FAQ

Struts 2#

JBoss 7 changes the jsessionid after each response due to a strange cookie path. This happens in Firefox 5, IE 9, but not in Chrome and not in Safari 5. So you cannot store any parameter in the session object anymore. To keep the session ID, which is called "sticky session" you need to add this parameter 2x to JBOSS_HOME/bin/standalone.sh

-Dorg.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR=false
Additionally I added this in the web.xml:
<context-param>
  <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
  <param-value>server</param-value>
</context-param>
Annother option would be this
-Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=false