- This topic has 9 replies, 3 voices, and was last updated 14 years, 3 months ago by RobertGloverJr.
-
AuthorPosts
-
RobertGloverJrMemberI successfully configured DB Browser to connect to an Oracle 10g schema.
Next I successfully configured and generated a Spring MVC crud web app that points to that Oracle 10g schema and generates CRUD for a simple table therein.However, when I try to run it in Tomcat (“Run As MyEclipse Server Application”), I get the initial screen of the web app but when I click on it to display the list of rows in the table I get this error message in the browser:
javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
There was no reason why it should have worked, I figured, being as the Spring MVC scaffolding had not made any database entries in web.xml and there was no reason to think that Tomcat knew about this Oracle database either.
So as a start, I manually created a context.xml file and placed it into WebRoot/META-INF.
This is a tried-and-true technique that I use in non-MyEclipse web apps that use Tomcat via a jndi connection. Here is the relevant part I added to context.xml:<Resource auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver" maxActive="20" maxIdle="10" maxWait="10000" name="yyyyy_ds" password="xxxxx" type="javax.sql.DataSource" url="jdbc:oracle:thin:@aaaaaaaa.vm.ny.eee.yyy:1521bbb1" username="yyyyy"/>
I then started Tomcat within MyEclipse to see what would happen. What happened is the following error message:
010-09-15 17:06:59,365 INFO [main] InjectedDataSourceConnectionProvider - Using provided datasource 2010-09-15 17:06:59,396 WARN [main] SettingsFactory - Could not obtain connection metadata com.atomikos.jdbc.AtomikosSQLException: Driver class not found: 'oracle.jdbc.driver.OracleDriver' - please make sure the spelling is correct. at com.atomikos.jdbc.AtomikosSQLException.throwAtomikosSQLException(AtomikosSQLException.java:19) at com.atomikos.jdbc.AtomikosSQLException.throwAtomikosSQLException(AtomikosSQLException.java:30)
That error message seemed very encouraging. I reasoned that all I had to do was to place the Oracle jar file (ojdbc14-10.2.0.4.0.jar) into the Tomcat lib directory, and I would be all set.
But I could not figure out where the lib directory is that the Tomcat in MyEclipse uses, and hence I could not put ojdbc14-10.2.0.4.0.jar into it.
Please help. Surely I am re-inventing the wheel here and thousands of people (but not me) know how to get this Spring MVC crud app to work using Oracle. I am so close to success that surely someone can advise me how to get this working (hope hope)..
Moving on, once that is working (with the help of the readers of this post), the next problem I have is that I want to generate CRUD for two tables that have absolutely nothing to do with each other. For the purposes of the problem I am asking for above, I only generated crud for one simple table that only has two columns. After that is working, I want to generate crud for a second simple table that only has a few columns, but this 2nd table has nothing whatever to do with the first table.
I simply want to be able to list, edit, delete, and insert into these two tables, completely independently of each other. Can this be done? Does it required me to scaffold twice– once for each table?
davemeurerMemberHello Robert,
There was no reason why it should have worked, I figured, being as the Spring MVC scaffolding had not made any database entries in web.xml and there was no reason to think that Tomcat knew about this Oracle database either.
Actually, it will work with no further manual configuration needed. The appropriate Spring entires are added in the web.xml which point to the DAO context files, which do indeed contain the appropriate oracle information based on the connection you created via the DB Browser.
That error message seemed very encouraging. I reasoned that all I had to do was to place the Oracle jar file (ojdbc14-10.2.0.4.0.jar) into the Tomcat lib directory, and I would be all set.
This was the issue all along. By default, Scaffolding has the option to include the Derby and PostgreSQL libs as part of the build path. That’s why it works out of the box with Derby, but for any other database, you will need to add the db jar to the classpath…
But I could not figure out where the lib directory is that the Tomcat in MyEclipse uses, and hence I could not put ojdbc14-10.2.0.4.0.jar into it.
There are a couple ways to get the db jar in the right place:
1. Tomcat: Since this is the integrated tomcat instance, the best place to add jars is via Window > Preferences > MyEclipse > Servers > Integrated Sandbox > MyEclipse Tomcat > Paths (Append to classpath)2. Add the jar directly to the project’s WEB-INF/lib directory
3. Right-click the project > Properties > Java Build Path > Libraries Tab
I simply want to be able to list, edit, delete, and insert into these two tables, completely independently of each other. Can this be done? Does it required me to scaffold twice– once for each table?
Absolutely can be done! Just select both tables during scaffolding, AND select them both as Parents in the subsequent scaffolding wizard.
Let me know if this info helps.
Kind regards,
=Dave
RobertGloverJrMemberAll of your advice worked perfectly. By simply copying jar file ojdbc14-10.2.0.4.0.jar into WEB-INF/lib the original MVC Crud operation worked correctly.
Then when I followed your instructions and did a re-scaffold of the MVC crud but this time specified two tables (that had nothing to do with each other) and set the “parent” checkbox on both of them, it correctly generated CRUD for each table that was independent of the other, which is exactly what I was looking to do.
I will have to expand on my final point later but I will mention it here and pursue it later.
As I mentioned, I added a new file named context.xml to WebRoot/META-INF because this is a trick I discovered on my own that allows me to use a JNDI connection to a database datasource within Tomcat. This allows me to define the database in the Spring xml context file (and also within web.xml) as a jndi database connection.
Below shows the change to web.xml that I refer to, which I do myself manually in a non-MyEclipse web app:
<resource-ref id="ResourceRef_1184621383329"> <description>UESM</description> <res-ref-name>uess_ds</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref>
The entry above in web.xml matches perfectly to the following entry in context.xml which I place into file META-INF/context.xml of the Web App. I learned this trick by reading Tomcat documentation. Notice I embedded documentation in the context.xml which I show below:
<?xml version=’1.0′ encoding=’utf-8′?>
<Context>
<!–
from http://tomcat.apache.org/tomcat-6.0-doc/config/context.html :Context elements may be explicitly defined:
In the $CATALINA_BASE/conf/context.xml file: the Context element information will be loaded by all webapps.
…snip…
in an individual file at /META-INF/context.xml inside the application files.
If the web application is packaged as a WAR then /META-INF/context.xml will be
copied to $CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to match
the application’s context path. Once this file exists, it will not be replaced
if a new WAR with a newer /META-INF/context.xml is placed in the host’s appBase.Inside a Host element in the main conf/server.xml.
–>
<!–
from http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html :
–><!– see:
http://tomcat.apache.org/tomcat-6.0-doc/config/realm.html
http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#MemoryRealm
R.Glover : Mar 31, 2010 – the realm below seems to be ignored,
superfluous, and not necessary for Tomcat. Oddly, it
does not even seem to be necessary for Tomcat to have that
Realm defined within conf/server.xml
–>
<Realm className=”org.apache.catalina.realm.MemoryRealm” /><!– Default set of monitored resources –>
<WatchedResource>WEB-INF/web.xml</WatchedResource><Resource
auth=”Container”
driverClassName=”oracle.jdbc.driver.OracleDriver”
maxActive=”20″
maxIdle=”10″
maxWait=”10000″
name=”uess_ds”
password=”xxxxxx”
type=”javax.sql.DataSource”
url=”jdbc:oracle:thin:@aaaa.bb.cc.ddd.eee:1521:ZZZ1″
username=”abcd”/></Context>
Finally, I define the database in the Spring xml file as follows:
<bean id="dataSourceUess" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="${jdbc.jndiName.uess}"/> </bean>
Where the ${jdbc.jndiName.uess}” is defined in file jdbc.properties as shown below:
# Properties file with jdbc-related settings for Spring configuration. # Applied by PropertyPlaceholderConfigurer in "ApplicationContext.xml". # WARNING!!! Do not by mistake put a space after these property values!!! # "jdbc/isf" is totally different than "jdbc/isf " !!!! # # Whereas WSADS 5.1 is content to use "jdbc/news2sd", # RAD7 (and Websphere 6.1) generates a warning message # which says the preferred way to specify it is # as shown below. Compare this to web.xml where # "res-ref-name" is defined. It is that "res-ref-name" # which is used below prefixed by "java:comp/env/" # jdbc.jndiName.uess=java:comp/env/uess_ds
By using the above technique, I can deploy this Tomcat/Eclipse app to IBM Websphere without any changes. Webshpere uses it’s own jndi connection pool for the datasource and ignores file context.xml.
It is because of this jndi trick, that I need to specify the Oracle jar file in the Tomcat classpath, not in the lib directory of the web application. By contrast, when I do it “your way”, i.e., by using the entry shown below which MyEclipse for Spring generates, I must put the Oracle jar file into the web app’s lib directory:
<!– ******************************************************************** –>
<!– Setup each data source –>
<!– ******************************************************************** –>
<!– Using Atomikos Data Sources –><bean name="uess_dsDS" class="com.atomikos.jdbc.nonxa.AtomikosNonXADataSourceBean" > <property name="uniqueResourceName" value="uess_ds__CUEIAMGcEd-sG7v3kzmnSw" /> <property name="driverClassName" value="${uess_ds.connection.driver_class}" /> <property name="user" value="${uess_ds.connection.username}" /> <property name="password" value="${uess_ds.connection.password}" /> <property name="url" value="${uess_ds.connection.url}" /> <property name="minPoolSize" value="${uess_ds.minPoolSize}" /> <property name="maxPoolSize" value="${uess_ds.maxPoolSize}" /> </bean>
My final task (in the future) is going to be to try to “graft” this ME4S CRUD into an existing, non-ME4S web application that uses maven and a pom.xml file. I generated all the ME4S crud into it’s own unique package. So when I have time, my plan is to copy that package and all the source it contains into the pre-existing web app, and then similarly copy all the xml configuration files that ME4S generated. This will at first cause terrible “class missing” problems, but after some tortuous “maven heck” of manually changing the pom.xml file, I figure I may eventually get this to work. One problem will be that the existing web app uses Hibernate while the ME4S crud uses JPA. It would have been more straightforward (maybe) for my purposes if the ME4S crud had an option to generate plain hibernate instead of hibernate wrapped in JPA.
Anyway, thank you for your help. I will pursue these other topics further when time permits– and appreciate any advice you can offer between now and then about it
RobertGloverJrMemberAs step one in grafting the ME4S crud into a non-ME4S Spring Web App, I regenerated the crud at home with the “Maven” option turned on. This created a pom.xml file, which I paste below unchanged from its pristine state.
The first thing which is evident in the pom.xml is that a lot of dependencies will need to be manually removed because they are not necessary. For example, all the dependencies with a groupid of “com.adobe.blazeds” are not needed.
Incidentally, the first time when I ran this un-modified, maven-enabled ME4S Crud at home I received the following error message.ava.lang.RuntimeException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/fmt/LocalizationContext
Next, I did a “Run As Config…..” and set it to do a maven clean and package.
This resulted in the following error messages:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project MvcMavenCrud: Compilation failure: Compilation failure: /Users/rdg/Workspaces/MyEclipseforSpring8.6/ws12/MvcMavenCrud/src/main/java/com/rdg/maven/mvc/crud/domain/Employee.java:[18,1] annotations are not supported in -source 1.3 (use -source 5 or higher to enable annotations) @Entity
When there is more time I will revisit this and try to figure out what is going wrong. I have the Compiler compliance level in the project properties set to 1.5. I set the version of Spring to 3. So far I don’t see where Maven is being instructed what version of the compiler to use.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>MvcMavenCrud</groupId> <artifactId>MvcMavenCrud</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name/> <description/> <repositories> <repository> <id>com.springsource.repository.bundles.external</id> <name>SSpringSource Enterprise Bundle Repository - External Bundle Releases</name> <url>http://repository.springsource.com/maven/bundles/external</url> </repository> <repository> <id>skyway-public-site</id> <name>Skyway Public Maven Repository</name> <url>http://downloads.skywayperspectives.org/maven-repo</url> </repository> <repository> <id>com.springsource.repository.bundles.release</id> <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name> <url>http://repository.springsource.com/maven/bundles/release</url> </repository> </repositories> <dependencies> <dependency> <groupId>javax.activation</groupId> <artifactId>activation</artifactId> <version>1.0.2</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.4</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jboss-j2ee</artifactId> <version>4.0.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.xml</groupId> <artifactId>jaxrpc-api</artifactId> <version>1.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jboss-jsr77</artifactId> <version>3.2.3</version> <scope>provided</scope> </dependency> <dependency> <groupId>axis</groupId> <artifactId>axis-saaj</artifactId> <version>1.3</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.3.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.xml</groupId> <artifactId>namespace</artifactId> <version>1.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>xerces</groupId> <artifactId>xmlParserAPIs</artifactId> <version>2.6.2</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-asm</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.15</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>aopalliance</groupId> <artifactId>aopalliance</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>cglib</groupId> <artifactId>cglib-nodep</artifactId> <version>2.2</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.6.8.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-instrument</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-instrument-tomcat</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>3.0.1.RELEASE-A</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.junit</groupId> <artifactId>com.springsource.org.junit</artifactId> <version>4.7.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>easymock</groupId> <artifactId>easymock</artifactId> <version>1.2_Java1.5</version> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>xmlunit</groupId> <artifactId>xmlunit</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>org.codehaus.woodstox</groupId> <artifactId>wstx-asl</artifactId> <version>3.2.7</version> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>5.10</version> <type>pom</type> </dependency> <dependency> <groupId>javax.inject</groupId> <artifactId>com.springsource.javax.inject</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> <version>3.1</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>com.springsource.org.codehaus.jackson.mapper</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-oxm</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc-portlet</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-struts</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>javax.persistence</groupId> <artifactId>persistence-api</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId> <version>0.9.1.2</version> </dependency> <dependency> <groupId>jotm</groupId> <artifactId>jotm</artifactId> <version>2.0.10</version> </dependency> <dependency> <groupId>com.experlog</groupId> <artifactId>xapool</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>commons-pool</groupId> <artifactId>commons-pool</artifactId> <version>1.5.3</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>com.springsource.org.apache.commons.lang</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-acl</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-cas-client</artifactId> <version>3.0.2.RELEASE</version> <exclusions> <exclusion> <artifactId>spring-dao</artifactId> <groupId>org.springframework</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-core</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-ldap</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-openid</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-taglibs</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.ldap</groupId> <artifactId>spring-ldap-core</artifactId> <version>1.3.0.RELEASE</version> </dependency> <dependency> <groupId>ldapsdk</groupId> <artifactId>ldapsdk</artifactId> <version>4.1</version> </dependency> <dependency> <groupId>org.jasig.cas</groupId> <artifactId>cas-client-core</artifactId> <version>3.1.10</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>com.opensymphony.quartz</groupId> <artifactId>com.springsource.org.quartz</artifactId> <version>1.6.2</version> </dependency> <dependency> <groupId>org.beanshell</groupId> <artifactId>bsh</artifactId> <version>2.0b4</version> </dependency> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>1.6.5</version> </dependency> <dependency> <groupId>org.jruby</groupId> <artifactId>jruby</artifactId> <version>1.4.0</version> </dependency> <dependency> <groupId>com.bea.commonj</groupId> <artifactId>com.springsource.commonj</artifactId> <version>1.1.0</version> </dependency> <dependency> <groupId>com.jamonapi</groupId> <artifactId>jamon</artifactId> <version>2.7</version> </dependency> <dependency> <groupId>javax.management</groupId> <artifactId>jmxremote</artifactId> <version>1.0.1_04</version> </dependency> <dependency> <groupId>javax.management</groupId> <artifactId>jmxremote_optional</artifactId> <version>1.0.1_04</version> </dependency> <dependency> <groupId>javax.management</groupId> <artifactId>jmxri</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>backport-util-concurrent</groupId> <artifactId>backport-util-concurrent</artifactId> <version>3.0</version> </dependency> <dependency> <groupId>org.springframework.webflow</groupId> <artifactId>spring-webflow</artifactId> <version>2.0.8.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.webflow</groupId> <artifactId>spring-binding</artifactId> <version>2.0.8.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.webflow</groupId> <artifactId>spring-js</artifactId> <version>2.0.8.RELEASE</version> </dependency> <dependency> <groupId>ognl</groupId> <artifactId>ognl</artifactId> <version>2.6.9</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> <version>3.2.7.ga</version> <exclusions> <exclusion> <artifactId>cglib</artifactId> <groupId>cglib</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>jaxen</groupId> <artifactId>jaxen</artifactId> <version>1.1-beta-7</version> </dependency> <dependency> <groupId>javax.security</groupId> <artifactId>jaas</artifactId> <version>1.0.01</version> </dependency> <dependency> <groupId>javassist</groupId> <artifactId>javassist</artifactId> <version>3.4.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> <version>3.3.1.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.3.2.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>3.0.0.ga</version> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jboss-archive-browsing</artifactId> <version>5.0.0alpha-200607201-119</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-commons-annotations</artifactId> <version>3.0.0.ga</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>ejb3-persistence</artifactId> <version>1.0.1.GA</version> </dependency> <dependency> <groupId>com.atomikos</groupId> <artifactId>transactions-essentials-all</artifactId> <version>3.6.4</version> <type>pom</type> </dependency> <dependency> <groupId>javax.transaction</groupId> <artifactId>jta</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>opensymphony</groupId> <artifactId>sitemesh</artifactId> <version>2.4</version> </dependency> <dependency> <groupId>org.directwebremoting</groupId> <artifactId>dwr</artifactId> <version>2.0.5</version> </dependency> <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version>8.3-603.jdbc3</version> </dependency> <dependency> <groupId>org.skywaysoftware</groupId> <artifactId>skyway-spring-utils</artifactId> <version>7.1.0</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-bundle-minimal</artifactId> <version>2.1.9</version> <exclusions> <exclusion> <artifactId>spring-context</artifactId> <groupId>org.springframework</groupId> </exclusion> <exclusion> <artifactId>spring-core</artifactId> <groupId>org.springframework</groupId> </exclusion> <exclusion> <artifactId>spring-web</artifactId> <groupId>org.springframework</groupId> </exclusion> <exclusion> <artifactId>spring-dao</artifactId> <groupId>org.springframework</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.sun.xml.fastinfoset</groupId> <artifactId>FastInfoset</artifactId> <version>1.2.7</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-activation_1.1_spec</artifactId> <version>1.0.2</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-stax-api_1.0_spec</artifactId> <version>1.0.1</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-ws-metadata_2.0_spec</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity</artifactId> <version>1.6.2</version> </dependency> <dependency> <groupId>org.apache.xmlbeans</groupId> <artifactId>xmlbeans</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.1</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> <version>2.1.9</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-xjc</artifactId> <version>2.1.9</version> </dependency> <dependency> <groupId>jdom</groupId> <artifactId>jdom</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>org.codehaus.jettison</groupId> <artifactId>jettison</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>org.codehaus.jra</groupId> <artifactId>jra</artifactId> <version>1.0-alpha-4</version> </dependency> <dependency> <groupId>org.apache.neethi</groupId> <artifactId>neethi</artifactId> <version>2.0.4</version> </dependency> <dependency> <groupId>javax.xml.soap</groupId> <artifactId>saaj-api</artifactId> <version>1.3</version> </dependency> <dependency> <groupId>com.sun.xml.messaging.saaj</groupId> <artifactId>saaj-impl</artifactId> <version>1.3.2</version> </dependency> <dependency> <groupId>xalan</groupId> <artifactId>serializer</artifactId> <version>2.7.1</version> </dependency> <dependency> <groupId>wsdl4j</groupId> <artifactId>wsdl4j</artifactId> <version>1.6.2</version> </dependency> <dependency> <groupId>org.apache.ws.security</groupId> <artifactId>wss4j</artifactId> <version>1.5.8</version> </dependency> <dependency> <groupId>xalan</groupId> <artifactId>xalan</artifactId> <version>2.7.1</version> </dependency> <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.9.0</version> </dependency> <dependency> <groupId>apache-xerces</groupId> <artifactId>xml-apis</artifactId> <version>2.9.0</version> </dependency> <dependency> <groupId>xml-resolver</groupId> <artifactId>xml-resolver</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>org.apache.ws.commons.schema</groupId> <artifactId>XmlSchema</artifactId> <version>1.4.5</version> </dependency> <dependency> <groupId>org.apache.santuario</groupId> <artifactId>xmlsec</artifactId> <version>1.4.3</version> </dependency> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derbyclient</artifactId> <version>10.1.1.0</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-common</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-core</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-opt</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-proxy</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-remoting</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-asl</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>org.springframework.flex</groupId> <artifactId>spring-flex</artifactId> <version>1.0.3.RELEASE</version> </dependency> <dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-incubator</artifactId> <version>2.0.1</version> </dependency> <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> <version>1.8.3</version> </dependency> </dependencies> <build> <sourceDirectory>${basedir}/src</sourceDirectory> <outputDirectory>${basedir}/WebRoot/WEB-INF/classes</outputDirectory> <resources> <resource> <directory>${basedir}/src</directory> <excludes> <exclude>**/*.java</exclude> </excludes> </resource> </resources> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <configuration> <webappDirectory>${basedir}/WebRoot</webappDirectory> <warSourceDirectory>${basedir}/WebRoot</warSourceDirectory> </configuration> </plugin> </plugins> </build> </project>
RobertGloverJrMemberMy first step in debugging why the maven version of the MVC Crud did not work when I set it to EE 1.4, was to regenerate the maven version of the MVC Crud from scratch but this time take all the defaults except that I specified Spring 3 instead of the default Spring 2.5.
There are really two big differences this time. One, I took the default of EE 5 instead of changing it to EE 1.4 that way I did the first time when I got the fatal errors. The second difference is that this second time I did not uncheck the Spring DSL checkbox.
Well for whatever reason (most likely the only reason that matters is because I let it default to EE 5), the maven MVC crud worked perfectly this second time.
There were not errors.
So, the current theory is that the maven version of the MVC crud will not work if the default of EE 5 is changed to EE 1.4.For the purposes of comparing this pom.xml to the version of the pom.xml that generated errors, below is the new pom.xml using the default of EE 5. Using it to run a “Run As…Maven Config… clean package’ worked perfectly with no errors:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>mavenMvcCrud</groupId> <artifactId>mavenMvcCrud</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name/> <description/> <repositories> <repository> <id>com.springsource.repository.bundles.external</id> <name>SSpringSource Enterprise Bundle Repository - External Bundle Releases</name> <url>http://repository.springsource.com/maven/bundles/external</url> </repository> <repository> <id>com.springsource.repository.bundles.release</id> <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name> <url>http://repository.springsource.com/maven/bundles/release</url> </repository> <repository> <id>skyway-public-site</id> <name>Skyway Public Maven Repository</name> <url>http://downloads.skywayperspectives.org/maven-repo</url> </repository> </repositories> <dependencies> <dependency> <groupId>org.apache.openejb</groupId> <artifactId>javaee-api</artifactId> <version>5.0-1</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.faces</groupId> <artifactId>jsf-api</artifactId> <version>1.2_04</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.faces</groupId> <artifactId>jsf-impl</artifactId> <version>1.2_04</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-asm</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.15</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>aopalliance</groupId> <artifactId>aopalliance</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>cglib</groupId> <artifactId>cglib-nodep</artifactId> <version>2.2</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.6.8.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-instrument</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-instrument-tomcat</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>3.0.1.RELEASE-A</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.junit</groupId> <artifactId>com.springsource.org.junit</artifactId> <version>4.7.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>easymock</groupId> <artifactId>easymock</artifactId> <version>1.2_Java1.5</version> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>xmlunit</groupId> <artifactId>xmlunit</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>org.codehaus.woodstox</groupId> <artifactId>wstx-asl</artifactId> <version>3.2.7</version> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>5.10</version> <type>pom</type> </dependency> <dependency> <groupId>javax.inject</groupId> <artifactId>com.springsource.javax.inject</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> <version>3.1</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>com.springsource.org.codehaus.jackson.mapper</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-oxm</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc-portlet</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-struts</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>javax.persistence</groupId> <artifactId>persistence-api</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId> <version>0.9.1.2</version> </dependency> <dependency> <groupId>jotm</groupId> <artifactId>jotm</artifactId> <version>2.0.10</version> </dependency> <dependency> <groupId>com.experlog</groupId> <artifactId>xapool</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>commons-pool</groupId> <artifactId>commons-pool</artifactId> <version>1.5.3</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>com.springsource.org.apache.commons.lang</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-acl</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-cas-client</artifactId> <version>3.0.2.RELEASE</version> <exclusions> <exclusion> <artifactId>spring-dao</artifactId> <groupId>org.springframework</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-core</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-ldap</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-openid</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-taglibs</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId> <version>3.0.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.ldap</groupId> <artifactId>spring-ldap-core</artifactId> <version>1.3.0.RELEASE</version> </dependency> <dependency> <groupId>ldapsdk</groupId> <artifactId>ldapsdk</artifactId> <version>4.1</version> </dependency> <dependency> <groupId>org.jasig.cas</groupId> <artifactId>cas-client-core</artifactId> <version>3.1.10</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>3.0.1.RELEASE-A</version> </dependency> <dependency> <groupId>com.opensymphony.quartz</groupId> <artifactId>com.springsource.org.quartz</artifactId> <version>1.6.2</version> </dependency> <dependency> <groupId>org.beanshell</groupId> <artifactId>bsh</artifactId> <version>2.0b4</version> </dependency> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>1.6.5</version> </dependency> <dependency> <groupId>org.jruby</groupId> <artifactId>jruby</artifactId> <version>1.4.0</version> </dependency> <dependency> <groupId>com.bea.commonj</groupId> <artifactId>com.springsource.commonj</artifactId> <version>1.1.0</version> </dependency> <dependency> <groupId>com.jamonapi</groupId> <artifactId>jamon</artifactId> <version>2.7</version> </dependency> <dependency> <groupId>javax.management</groupId> <artifactId>jmxremote</artifactId> <version>1.0.1_04</version> </dependency> <dependency> <groupId>javax.management</groupId> <artifactId>jmxremote_optional</artifactId> <version>1.0.1_04</version> </dependency> <dependency> <groupId>javax.management</groupId> <artifactId>jmxri</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>backport-util-concurrent</groupId> <artifactId>backport-util-concurrent</artifactId> <version>3.0</version> </dependency> <dependency> <groupId>org.springframework.webflow</groupId> <artifactId>spring-webflow</artifactId> <version>2.0.8.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.webflow</groupId> <artifactId>spring-binding</artifactId> <version>2.0.8.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.webflow</groupId> <artifactId>spring-js</artifactId> <version>2.0.8.RELEASE</version> </dependency> <dependency> <groupId>ognl</groupId> <artifactId>ognl</artifactId> <version>2.6.9</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> <version>3.2.7.ga</version> <exclusions> <exclusion> <artifactId>cglib</artifactId> <groupId>cglib</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>jaxen</groupId> <artifactId>jaxen</artifactId> <version>1.1-beta-7</version> </dependency> <dependency> <groupId>javax.security</groupId> <artifactId>jaas</artifactId> <version>1.0.01</version> </dependency> <dependency> <groupId>javassist</groupId> <artifactId>javassist</artifactId> <version>3.4.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> <version>3.3.1.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.3.2.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>3.0.0.ga</version> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jboss-archive-browsing</artifactId> <version>5.0.0alpha-200607201-119</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-commons-annotations</artifactId> <version>3.0.0.ga</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>ejb3-persistence</artifactId> <version>1.0.1.GA</version> </dependency> <dependency> <groupId>com.atomikos</groupId> <artifactId>transactions-essentials-all</artifactId> <version>3.6.4</version> <type>pom</type> </dependency> <dependency> <groupId>javax.transaction</groupId> <artifactId>jta</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>opensymphony</groupId> <artifactId>sitemesh</artifactId> <version>2.4</version> </dependency> <dependency> <groupId>org.directwebremoting</groupId> <artifactId>dwr</artifactId> <version>2.0.5</version> </dependency> <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version>8.3-603.jdbc3</version> </dependency> <dependency> <groupId>org.skywaysoftware</groupId> <artifactId>skyway-spring-utils</artifactId> <version>7.1.0</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-bundle-minimal</artifactId> <version>2.1.9</version> <exclusions> <exclusion> <artifactId>spring-context</artifactId> <groupId>org.springframework</groupId> </exclusion> <exclusion> <artifactId>spring-core</artifactId> <groupId>org.springframework</groupId> </exclusion> <exclusion> <artifactId>spring-web</artifactId> <groupId>org.springframework</groupId> </exclusion> <exclusion> <artifactId>spring-dao</artifactId> <groupId>org.springframework</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.sun.xml.fastinfoset</groupId> <artifactId>FastInfoset</artifactId> <version>1.2.7</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-activation_1.1_spec</artifactId> <version>1.0.2</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-stax-api_1.0_spec</artifactId> <version>1.0.1</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-ws-metadata_2.0_spec</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity</artifactId> <version>1.6.2</version> </dependency> <dependency> <groupId>org.apache.xmlbeans</groupId> <artifactId>xmlbeans</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.1</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> <version>2.1.9</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-xjc</artifactId> <version>2.1.9</version> </dependency> <dependency> <groupId>jdom</groupId> <artifactId>jdom</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>org.codehaus.jettison</groupId> <artifactId>jettison</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>org.codehaus.jra</groupId> <artifactId>jra</artifactId> <version>1.0-alpha-4</version> </dependency> <dependency> <groupId>org.apache.neethi</groupId> <artifactId>neethi</artifactId> <version>2.0.4</version> </dependency> <dependency> <groupId>javax.xml.soap</groupId> <artifactId>saaj-api</artifactId> <version>1.3</version> </dependency> <dependency> <groupId>com.sun.xml.messaging.saaj</groupId> <artifactId>saaj-impl</artifactId> <version>1.3.2</version> </dependency> <dependency> <groupId>xalan</groupId> <artifactId>serializer</artifactId> <version>2.7.1</version> </dependency> <dependency> <groupId>wsdl4j</groupId> <artifactId>wsdl4j</artifactId> <version>1.6.2</version> </dependency> <dependency> <groupId>org.apache.ws.security</groupId> <artifactId>wss4j</artifactId> <version>1.5.8</version> </dependency> <dependency> <groupId>xalan</groupId> <artifactId>xalan</artifactId> <version>2.7.1</version> </dependency> <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.9.0</version> </dependency> <dependency> <groupId>apache-xerces</groupId> <artifactId>xml-apis</artifactId> <version>2.9.0</version> </dependency> <dependency> <groupId>xml-resolver</groupId> <artifactId>xml-resolver</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>org.apache.ws.commons.schema</groupId> <artifactId>XmlSchema</artifactId> <version>1.4.5</version> </dependency> <dependency> <groupId>org.apache.santuario</groupId> <artifactId>xmlsec</artifactId> <version>1.4.3</version> </dependency> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derbyclient</artifactId> <version>10.1.1.0</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-common</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-core</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-opt</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-proxy</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-remoting</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-asl</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>org.springframework.flex</groupId> <artifactId>spring-flex</artifactId> <version>1.0.3.RELEASE</version> </dependency> <dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-incubator</artifactId> <version>2.0.1</version> </dependency> <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> <version>1.8.3</version> </dependency> </dependencies> <build> <sourceDirectory>${basedir}/src</sourceDirectory> <outputDirectory>${basedir}/WebRoot/WEB-INF/classes</outputDirectory> <resources> <resource> <directory>${basedir}/src</directory> <excludes> <exclude>**/*.java</exclude> </excludes> </resource> </resources> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <configuration> <webappDirectory>${basedir}/WebRoot</webappDirectory> <warSourceDirectory>${basedir}/WebRoot</warSourceDirectory> </configuration> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> </plugins> </build> </project>
RobertGloverJrMemberComparing the two pom.xml files, it can be seen that the first (failing pom.xml) does not contain the following, which is present in the second (successful) pom.xml:
<plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin>
When I add the element shown above to the failing pom.xml and then issue “Run As….Maven Config….clean package”, it fixes the problem in the maven “clean package”. Below shows the updated portion of the pom.xml with the code above inserted:
</dependencies> <build> <sourceDirectory>${basedir}/src</sourceDirectory> <outputDirectory>${basedir}/WebRoot/WEB-INF/classes</outputDirectory> <resources> <resource> <directory>${basedir}/src</directory> <excludes> <exclude>**/*.java</exclude> </excludes> </resource> </resources> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <configuration> <webappDirectory>${basedir}/WebRoot</webappDirectory> <warSourceDirectory>${basedir}/WebRoot</warSourceDirectory> </configuration> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </build>
Next, I re-try “Run As MyEclipse Server Application” on the first project (the EE 1.4 version that formerly failed with a message about a missing class). The problem still occurs. Below shows the error message:
description The server encountered an internal error () that prevented it from fulfilling this request. exception java.lang.RuntimeException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/fmt/LocalizationContext com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator.render(BaseWebAppDecorator.java:40) com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:84) org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:113) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
RobertGloverJrMemberThe solution, whatever it is, probably involves changes that will be need to be made to the first pom.xml (the one that specifies EE 1.4).
As long as I’m looking at it carefully, this is good time to start removing unneeded dependencies.
I remove the following:<dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-incubator</artifactId> <version>2.0.1</version> </dependency>
And I also remove the following:
<dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-common</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-core</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-opt</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-proxy</artifactId> <version>3.0.0.544</version> </dependency> <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-remoting</artifactId> <version>3.0.0.544</version> </dependency>
There are many dependencies that I don’t now if it is okay to remove. For example:
<dependency> <groupId>org.jruby</groupId> <artifactId>jruby</artifactId> <version>1.4.0</version> </dependency>
RobertGloverJrMemberIt looks like maybe SiteMesh is the culprit. The error message shows SiteMesh in the stack trace:
java.lang.RuntimeException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/fmt/LocalizationContext com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator.render(BaseWebAppDecorator.java:40) com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:84)
Both pom.xml refer to the same version of SiteMesh:
<dependency> <groupId>opensymphony</groupId> <artifactId>sitemesh</artifactId> <version>2.4</version> </dependency>
Searching for SiteMesh in the Mavan Repository ( http://mvnrepository.com/artifact/opensymphony/sitemesh )
Shows there are SiteMesh version 2.4, 2.3, 2.2.1, and 2.0.1.
Maybe the first pom.xml should use SiteMesh 2.3 instead of SiteMesh 2.4.
Just a theory at this point. Have to break off this investigation and head off to my day job.
To be continued…..
neydeMemberRobert,
We’re doing a lot of work in 8.6.1 to reduce the Maven pom file to the bare essentials. As you pointed out, there are currently a lot of dependencies in the POM files that we generate. The reports we’ve received from the field are that it results in very large WAR files and issues with Maven tooling.
It sound like you’re going through a similar exercise that we went through in trimming the fat from the POM file. Although 8.6.1 won’t be out for a few weeks, if you want I can provide you with a generated POM file from 8.6.1.
Regards,
Niel
RobertGloverJrMemberI was aware that ME4S was going to be improved with regard to the maven pom generation, and was reluctant to post my problems because I realized in future versions my issues will go away.
What forced me to post was the discovery that when I changed a maven crud
MVC scaffolding generation to use “EE 1.4” instead of the default “EE 5”, I could not successfully run the generated program due to a class not found error. I no longer think it is related to Sitemesh version I used, it must be some other dependency.So, I would like to take you up on your offier. Could you provide me with two pom’s that do a simple, one table MVC Crud scaffold. One pom for EE 5 and Spring 3 but more importantly for my needs a pom for EE 1.4 and Spring 3 and java 5 or java 6 (just not for java 1.4). In a perfect world the pom’s would be for Oracle 10g but that is pie in the sky. I can easily remove the Derby dependency and replace it with an Oracle dependency.
On the subject of maven, I have decided that the best way to responsibly keep projects in subversion is for me to make the subversion “tag” consist of three subversion folders. The first is the normal maven project directory that has pom.xml and src in it. The second is an artifacts subversion directory to contain DDL, etc., The third would be a subversion directory that contains the local maven repository that is created when I do a maven clean/project into a new, empty, never used maven local repository.
The reason for this third subversion directory to be included in the subversion “tag” is to guard against any of the remote repositories changing in the future such that I cannot at a future time download a dependency needed to rebuild the project.
Wow that was quite a digression.
Anyway, thanks for your offer of poms, which I gratefully accept. I would also appreciate suggestions into why building with maven and EE 1.4 had the class not found problem I posted about.
-
AuthorPosts