Issue by attache activejdbc to my spring-boot project - spring

I will attache activejdbc to my spring boot project, and this is part of my pom.xml file:
<plugin>
<groupId>org.javalite</groupId>
<artifactId>db-migrator-maven-plugin</artifactId>
<version>${activejdbc.version}</version>
<configuration>
<configFile>${project.basedir}/src/main/resources/database.properties</configFile>
<environments>${environments}</environments>
</configuration>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4-1206-jdbc42</version>
</dependency>
</dependencies>
</plugin>
But I got the following exception by executing the project.
java.lang.ClassNotFoundException: org.postgresql.Drive

Related

How to use a Vaadin 14 Application as a Dependency?

I try to use a Vaadin 14 application as a dependency for a Spring Boot Project. The Vaadin project uses a single View and an embedded Tomcat and runs fine. pom.xml of the project:
...
<groupId>my.package</groupId>
<artifactId>my-artifact</artifactId>
...
...
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
...
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring-boot-starter</artifactId>
<exclusions>
<!-- Excluding so that webjars are not included. -->
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>2.6.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>2.6.6</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.6.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench</artifactId>
<scope>test</scope>
</dependency>
...
<build>
<defaultGoal>spring-boot:run</defaultGoal>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- Clean build and startup time for Vaadin apps sometimes may exceed
the default Spring Boot's 30sec timeout. -->
<configuration>
<wait>500</wait>
<maxAttempts>240</maxAttempts>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>exec</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
So I basically tried to add a classifier to the spring-boot-maven-plugin of the application like stated here.
And when I run mvn install I get the two jars as I expect.
Now, I create a new Spring Application and import the dependency in the pom.xml:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>my.package</groupId>
<artifactId>my-artifact</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Now, when I try to run the app I get this error message:
Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'formContentFilter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.filter.OrderedFormContentFilter]: Factory method 'formContentFilter' threw exception; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.fasterxml.jackson.datatype.jsr310.JavaTimeModule]: Unresolvable class definition; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ser/std/ToStringSerializerBase
Is it even possible to have a Vaadin project as a dependency? If yes, what I am missing - can someone help me out?
Spring Boot applications have a different JAR layout and cannot be used as dependencies.

Generating RESTful Webservices from entity classes in a netbeans maven webapp causes app to fail, displaying "Payara Server, deploy, null, false"

I want to make a persistence microservice for my application with jee 8.The resource endpoint works well with a simple PersistenceResource class. I have generated the entities from the mysql database and the app still works fine. Unfortunately, the moment i generate 'RESTful WebServices from entity classes' payara server fails to run. The message in the server log is
Deploying on Payara Server
profile mode: false
debug mode: false
force redeploy: true
In-place deployment at /home/nkengasong/NetBeansProjects/CreatixxPersistence/target/CreatixxPersistence
Payara Server, deploy, null, false
The same error is displayed when i generate Session Beans For Entity Classes. Please what might be the problem? I have been searching the internet for hours now.
The app is a traditional maven-archetype-webapp and i am using:
NetBeans IDE 9.0
Payara Server
Java EE 8
Open JDK 11
Ubuntu 18.04 lts (same problem on windows 10)
Below is my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>com.jee8ng</groupId>
<artifactId>CreatixxPersistence</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>CreatixxPersistence Maven Webapp</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<failOnMissingWebXml>false</failOnMissingWebXml>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.core</artifactId>
<version>2.5.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.asm</artifactId>
<version>2.5.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.antlr</artifactId>
<version>2.5.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId>
<version>2.5.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa.jpql</artifactId>
<version>2.5.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
<version>2.5.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.json.bind</groupId>
<artifactId>javax.json.bind-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.16</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.13</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>CreatixxPersistence</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
This is the structure of the app:
Here is the structure of the application
I seriously need help! Please why is that the app stops running when i generate the webservices or sessions? How can i remedy this? Thanks in advance
Payara server is not yet fully compatible with JDK 11. You still need a JDK 8 version.
I finally solved the problem by switching to NetBeans 8.2 and changing the default #XmlTransient annotation on certain fields of the entity classes to #JsonbTransient
(this avoids stackoverflow error, if you intend to use JSON instead of XML). By default, when you generate entity classes from the database, certain fields get annotated with #XmlTransient. I switched netbeans because apparently NetBeans IDE 9.0 is not stable. I hope this helps someone. Thanks to everyone for you help!

Swagger Codegen (with maven plugin) for OpenAPI 3.0

I want to use Swagger Codegen for OpenAPI 3.0 YAML file. And I see Swagger Codegen 3.0.0-rc0 is available. But when I try to use that I run into issues. Following are the details:
My pom.xml file with swagger-codegen plugin:
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>3.0.0-rc0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${basedir}/src/main/resources/mySpec.yaml</inputSpec>
<output>target/generated-sources</output>
<language>spring</language>
<generateApis>false</generateApis>
<modelPackage>com.kj.model</modelPackage>
<apiPackage>com.kj</apiPackage>
<configOptions>
<sourceFolder>swagger</sourceFolder>
<library>spring-mvc</library>
<interfaceOnly>true</interfaceOnly>
<useBeanValidation>true</useBeanValidation>
<dateLibrary>java8</dateLibrary>
<java8>true</java8>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
With the above plugin when I run the maven build, I got this ServiceConfigurationError, here is the stack trace:
Exception in thread "main" java.util.ServiceConfigurationError: io.swagger.codegen.CodegenConfig: Provider io.swagger.codegen.languages.java.JavaClientCodegen not found
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at io.swagger.codegen.CodegenConfigLoader.forName(CodegenConfigLoader.java:19)
at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:392)
at io.swagger.codegen.plugin.CodeGenMojo.execute(CodeGenMojo.java:512)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
In order to fix this I added swagger-codegen-generators dependency within the maven plugin section of pom file:
<dependencies>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-generators</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
So with this earlier mentioned issue got resolved but now I see this NPE
java.lang.NullPointerException
at io.swagger.codegen.languages.SpringCodegen.preprocessOpenAPI(SpringCodegen.java:429)
at io.swagger.codegen.DefaultGenerator.configureGeneratorProperties(DefaultGenerator.java:199)
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:716)
at io.swagger.codegen.plugin.CodeGenMojo.execute(CodeGenMojo.java:534)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
As you would have noted already that I am using <language>spring</language> and <library>spring-mvc</library>. Please let me know if codegen has worked for someone for 3.0.0-rc0 with these configurations.
Note: I looked at this old post which is similar but at that time 3.0.0-rc0 was not available.
To use Swagger Codegen with Maven plug-in for OpenAPI 3.0.0 spec, you may consider using OpenAPI Generator instead (which is a community-driven version of Swagger Codegen).
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>3.3.4</version>
</dependency>
Ref: https://github.com/OpenAPITools/openapi-generator#12---artifacts-on-maven-central
(please refer to the Q&A on why we forked Swagger Codegen)
The v3 swagger codegen maven plugin released April 2019 generates working Java client libraries from an OpenAPI 3.0 spec, I'm using this Maven pom.xml plugin config:
<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>3.0.8</version>
<executions>
..
All the rest of the configuration and configOptions entries are unchanged from version 2.4.5. I had to replace the old annotation dependency with the following so the client code would compile:
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.0.8</version>
</dependency>
Per request from #kozla13 below I added a complete POM example.
<?xml version="1.0" encoding="UTF-8"?>
<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>
<!-- This groupId will NOT allow deployment in LF -->
<groupId>org.example.swaggerapi.client</groupId>
<artifactId>swagger-client</artifactId>
<name>Example</name>
<version>0.0.1-SNAPSHOT</version>
<properties>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<client.base.package.name>org.example.so</client.base.package.name>
</properties>
<dependencies>
<!-- Required for Java 9 and later -->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.0.8</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.10.RELEASE</version>
</dependency>
<!-- HTTP client: Spring RestTemplate -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.1.10.RELEASE</version>
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.9.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.9.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.9.9</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.3.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<!-- This 2019 version is required for OpenAPI 3 -->
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>3.0.8</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/ric-plt-a1/a1/openapi.yaml</inputSpec>
<language>java</language>
<packageName>${client.base.package.name}</packageName>
<modelPackage>${client.base.package.name}.model</modelPackage>
<apiPackage>${client.base.package.name}.api</apiPackage>
<invokerPackage>${client.base.package.name}.invoker</invokerPackage>
<configOptions>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<artifactVersion>${project.version}</artifactVersion>
<library>resttemplate</library>
<java8>true</java8>
<dateLibrary>java8</dateLibrary>
<licenseName>Apache 2.0</licenseName>
<licenseUrl>https://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

Executing Spring Boot Application using Spark

I am new to Apache Spark. I am trying to execute simple spring boot application using Spark but I am getting the exception.
ERROR ApplicationMaster: User class threw exception:
java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication
However, i am able to execute this project perfectly file from my Eclipse IDE.It is executing the soul which I have kept.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency> <!-- Spark -->
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>1.4.0</version>
</dependency>
<dependency> <!-- Spark SQL -->
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.10</artifactId>
<version>1.4.0</version>
</dependency>
<dependency> <!-- Spark SQL -->
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-scala_2.10</artifactId>
<version>2.6.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
And my main spring boot class is
#SpringBootApplication
public class SparkS3Application {
public static void main(String[] args) {
SpringApplication.run(SparkS3Application.class, args);
System.out.println(" *************************** called *******************");
}
}
I added the required dependency in my spark submit command only using --jars "jar path,another jar path". You need to provide all the jars comma separated after
--jars.
Second thing is try to execute this in spark 2.0 I was using park 1.6 and i was facing issue but it is working perfectly fine with spark 2.0.
Hope this will help you guys..

GWT using ActiveMQ through Spring problems

I have a standalone Spring command and control application that broadcasts system status using ActiveMQ through the Spring JMS API. This works fine, I have tested it and have a test client program that can register to listen to the topic.
I also have a Spring based GWT application and I am trying to have it register to one of the ActiveMQ topics so it can receive status messages from the C&C application. In the GWT project, I have an applicationContext.xml under WEB-INF:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:amq="http://activemq.apache.org/schema/core"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core-5.2.0.xsd">
<amq:topic id="embedded.sysModel" physicalName="org.apache.activemq.spring.embedded.sysmodel" />
</beans>
When I run the GWT application from Eclipse I get the following error(s).
15:16:20,067 ERROR [org.springframework.web.context.ContextLoader] -
Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for
XML schema namespace [http://activemq.apache.org/schema/core]
Offending resource: ServletContext resource
[/WEB-INF/applicationContext.xml]
Now at this point I do not even have any code in the GWT app that is referencing ActiveMQ or the Spring JMS Template. I did at first, but I backed everything out to find the first point of failure. And it appears to be the amq:topic line. If I comment that line out of the applicationContext.xml file, my GWT app initializes and runs just fine.
Here is my pom.xml for GWT
<?xml version="1.0" encoding="UTF-8"?>
<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">
<!-- POM generated by gwt-maven-plugin archetype -->
<modelVersion>4.0.0</modelVersion>
<groupId>gui-spring-gwt</groupId>
<artifactId>ourappgui</artifactId>
<packaging>war</packaging>
<version>2.0</version>
<properties>
<!-- convenience to define GWT version in one place -->
<gwt.version>2.4.0</gwt.version>
<spring.version>3.0.6.RELEASE</spring.version>
<!-- tell the compiler we can use 1.5 -->
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<dependencies>
<!-- GWT dependencies (from central repo) -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<!-- test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.5.3.0_1</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.5.3.0_1</version>
</dependency>
</dependencies>
<build>
<outputDirectory>war/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.3.0-1</version>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>generateAsync</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<runTarget>pevcogui.html</runTarget>
</configuration>
</plugin>
<!-- If you want to use the target/web.xml file mergewebxml produces,
tell the war plugin to use it. Also, exclude what you want from the final
artifact here. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId>
<configuration> <webXml>target/web.xml</webXml> <warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
</configuration> </plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-beta-1</version>
<configuration>
<warSourceDirectory>war</warSourceDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>
The problem is that the xsd for http://activemq.apache.org/schema/core can't be found. activemq.xsd is part of the activemq-core-xxx.jar, and will be found when this jar is in your classpath. But you don't have a dependency on that.
So add the dependency to activemq-core if you use xmlns:amq:
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>5.5.0</version><!-- or whatever version you use -->
</dependency>
It seems that this problem is rooted in the Eclipse GWT plugin. I found this post : Spring NamespaceHandler issue when launching Maven-based GWT App from Eclipse IDE after migration to Spring 3 which discussed a similar problem. This post on the Spring forum is talks about a similar problem with spring-security.
My workaround is to run the GWT app from the command line using "mvn gwt:run". Launching this way keeps the classpath intact. I get a successful build using maven at the cmd line and I can deploy to Glassfish. Its only when launching from within Eclipse that I get the error.

Resources