Recent Notes

Displaying keyword search results 1 - 4
Created by Fang on September 07, 2009 20:44:15    Last update: November 03, 2011 14:43:19
Step 1: Repackage a web app as EAR A Java EE application is a multimodule Maven project. At the very least you'll need to package a WAR and an EAR. To get started, I'll simply re-package the simple webapp as an EAR. Create a directory named javaee-app Copy the webapp from here to javaee-app . Rename struts1app to webapp . Create pom.xml under javaee-app : <project> <modelVersion>4.0.0</modelVersion>... Create a directory named ear under javaee-app . Create pom.xml under ear : <project> <modelVersion>4.0.0</modelVersion>... Modify pom.xml in the webapp directory so that it looks like this: <project> <modelVersion>4.0.0</modelVersion> ... Build with " mvn package " in the javaee-app directory. You can see that ear-1.0.ear is successfully generated in javaee-app/ear/target . Maven successfully resolves dependencies between the sub-projects....
Created by Fang on March 22, 2010 02:55:04    Last update: March 22, 2010 03:48:55
If you followed the steps in Start a Java EE application with Maven , you'll arrive at an EAR file that's ready to be deployed. However, if you look carefully, you'll find that the ejb-1.0.jar file is included in the EAR file twice : once as the ejb module of the EAR, another time under the WEB-INF/lib folder of webapp-1.0.war . The second is brought about by specifying the ejb project as a dependency in the webapp POM. Actually, the webapp project is dependent on the ejb project as an EJB client. So we should have been more accurate by specifying the type of dependency as ejb-client , not ejb : Edit webapp/pom.xml , change the ejb dependency to ejb-client : <project> <modelVersion>4.0.0</modelVersion... Update ejb/pom.xml...
Created by Fang on August 26, 2009 02:50:20    Last update: January 10, 2010 00:22:44
You can use the Maven archetype plugin to quickly start a new Maven project from scratch: C:\work\maven>mvn archetype:generate [INFO] S...
Created by Dr. Xi on August 15, 2007 18:08:34    Last update: November 08, 2007 22:00:01
I had this problem when deploying a J2EE application into Oracle app server. It worked fine with an OC4J container configured in the default group. But it failed to start with an OC4J container I created. Here's a sample stack trace of the initialization exception: 07/08/14 13:32:46.34 10.1.3.3.0 Started 07/08/1... The problem was, the struts ActionServlet loads commons logging LogFactory, the log factory somehow knows that it needs log4j, but it can't load log4j since it's loaded by a different class loader. The solution for Oracle is to omit commons logging from the list of inherited libraries. Add this to META-INF/orion-application.xml solves the problem: <imported-shared-libraries> <remove-inhe... Actually, this is a quite common problem with commons-logging. If you search the web, you'll find that people have...