JBoss AS 7.1.0 Mail

Since version 7.1.0 JBoss AS includes a mail subsystem by default and it seems to work with a local postfix installation out of the box. Here is a simple mailer bean: import javax.annotation.security.RolesAllowed; import javax.enterprise.inject.Model; import javax.inject.Inject; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import org.jboss.logging.Logger; /** * * @author […]

JBoss AS 7.1.0 Mail Read More »

JEE6 Schedulers

Creating a scheduler in JEE6 is very simple. Just use @Schedule annotation. Here is an example of a simple bean logging all 30 seconds. import javax.ejb.Schedule; import javax.ejb.Stateless; import javax.inject.Inject; import org.jboss.logging.Logger; /** * @author manuel * */ @Stateless public class ApplicationScheduler { @Inject private Logger log; /** * Do something when fired. @Schedule can

JEE6 Schedulers Read More »

JBoss AS 7.1 Eclipse Startup Warning

Since 7.1 the following warning appears during server startup: WARNING: -logmodule is deprecated. Please use the system property ‘java.util.logging.manager’ or the ‘java.util.logging.LogManager’ service loader. This can be fixed be removing the following part from the launch configuration in the “Program arguments” section: -logmodule org.jboss.logmanager

JBoss AS 7.1 Eclipse Startup Warning Read More »

include wsimport into maven build process

to include the source-code-generation wsimport does for you into your maven build you can use the cxf-codegen-plugin as follows: <plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>2.5.2</version> <executions> <execution> <id>generate-sources</id> <phase>generate-sources</phase> <configuration> <sourceRoot>src/main/java</sourceRoot> <wsdlOptions> <wsdlOption> <wsdl>http://localhost:8080/SoapService?wsdl</wsdl> <extraargs> <extraarg>-client</extraarg> </extraargs> </wsdlOption> </wsdlOptions> </configuration> <goals> <goal>wsdl2java</goal> </goals> </execution> </executions> </plugin> This adds the generated resources to your maven source folder. Eclipse

include wsimport into maven build process Read More »

JAX-WS + Apache CXF + Maven

to use apache CXF to consume webservices in a maven project you have to inlcude the following dependencies – of course you can change the logging part if you don’t use log4j like me. <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> <version>2.5.2</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http</artifactId> <version>2.5.2</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.6.4</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId>

JAX-WS + Apache CXF + Maven Read More »

Install Tomcat under Debian

Download Tomcat. Create /etc/init.d/tomcat as listed below and change properties in it as needed. Execute the following commands as root. cd /opt tar -xf apache-tomcat-7.0.25.tar.gz ln -s apache-tomcat-7.0.25 tomcat groupadd tomcat useradd -g tomcat -d /opt/tomcat tomcat usermod -G www-data tomcat chown tomcat:tomcat /opt/apache-tomcat-7.0.25 -R chmod +x /etc/init.d/tomcat update-rc.d tomcat defaults /etc/init.d/tomcat #!/bin/sh CATALINA_HOME=/opt/tomcat export

Install Tomcat under Debian Read More »