Camel-Blueprint Unable to convert value org.springframework.orm.hibernate4.LocalSessionFactoryBean to type org.hibernate.SessionFactory - camel-blueprint

I am using camel-blueprint and facing issues with hibernate component.
This example works fine in Spring but not in blueprint JBoss Fuse 6.3 V
The provided example is in spring and works fine but any example in blueprint will be helpful
http://camel.apache.org/hibernate-example.html
Error:
org.osgi.service.blueprint.container.ComponentDefinitionException: Error setting property: PropertyDescriptor Caused by: java.lang.Exception: Unable to convert value org.springframework.orm.hibernate4.LocalSessionFactoryBean#46797063 to type org.hibernate.SessionFactory
at org.apache.aries.blueprint.container.AggregateConverter.convert(AggregateConverter.java:184)
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<bean class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close" id="dataSource">
<property name="url"
value="jdbc:sqlserver://x:1433;DatabaseName=x" />
<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<property name="username" value="" />
<property name="password" value="" />
<property name="removeAbandoned" value="true" />
<property name="initialSize" value="20" />
<property name="maxActive" value="30" />
</bean>
<bean class="com.x.dto.ReferenceTable" id="refBean" />
<!-- <bean class="com.x.dao.ReferenceDAOImpl" id="MyBean">
<property name="sessionFactory" ref="mysessionFactory" />
</bean> -->
<!-- setup the Camel hibernate component -->
<bean class="org.apacheextras.camel.component.hibernate.HibernateComponent"
id="hibernate">
<property name="sessionFactory" ref="mysessionFactory" />
</bean>
<bean class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
id="mysessionFactory">
<property name="dataSource" ref="dataSource" />
<!-- here we define the hibernate mapping files we use -->
<property name="packagesToScan">
<list>
<value>com.x.dto</value>
</list>
</property>
<property name="annotatedClasses">
<list>
<value>com.x.dto.ReferenceTable</value>
</list>
</property>
<!-- and here we have additional hibernate options -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<camelContext id="_context1"
xmlns="http://camel.apache.org/schema/blueprint">
<route id="_route1">
<from id="from" uri="hibernate://com.x.dto.ReferenceTable?consumer.query=select x.data from com.x.dto.ReferenceTable x where x.id='id3'"/>
<!-- <bean id="_bean1" method="save(com.x.dto.ReferenceTable)" ref="MyBean"/>
<bean id="_bean2" method="getByID('id2')" ref="MyBean"/>
<convertBodyTo id="_convertBodyTo1" type="com.x.dto.ReferenceTable"/> -->
<to id="_to1" uri="log: ${body}"/>
</route>
</camelContext>
</blueprint>
Pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>camel-blueprint</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Camel Blueprint Quickstart</name>
<description>Empty Camel Blueprint Example</description>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<camel.version>2.17.0.redhat-630187</camel.version>
<version.maven-bundle-plugin>3.2.0</version.maven-bundle-plugin>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<jboss.fuse.bom.version>6.3.0.redhat-187</jboss.fuse.bom.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.fuse.bom</groupId>
<artifactId>jboss-fuse-parent</artifactId>
<version>${jboss.fuse.bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-blueprint</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-blueprint</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.1.0.jre8</version>
</dependency>
<dependency>
<groupId>org.apache-extras.camel-extra</groupId>
<artifactId>camel-hibernate</artifactId>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
</dependency>
</dependencies>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>fuse-public-repository</id>
<name>FuseSource Community Release Repository</name>
<url>https://repo.fusesource.com/nexus/content/groups/public</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>red-hat-ga-repository</id>
<name>Red Hat GA Repository</name>
<url>https://maven.repository.redhat.com/ga</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>fuse-public-repository</id>
<name>FuseSource Community Release Repository</name>
<url>https://repo.fusesource.com/nexus/content/groups/public</url>
</pluginRepository>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>red-hat-ga-repository</id>
<name>Red Hat GA Repository</name>
<url>https://maven.repository.redhat.com/ga</url>
</pluginRepository>
</pluginRepositories>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${version.maven-bundle-plugin}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>keyvalue</Bundle-SymbolicName>
<Bundle-Name>Empty Camel Blueprint Example [keyvalue]</Bundle-Name>
</instructions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>${camel.version}</version>
<configuration>
<useBlueprint>true</useBlueprint>
</configuration>
</plugin>
</plugins>
</build>
</project>

Remember one thing. org.springframework.orm.hibernate4.LocalSessionFactoryBean is Spring's factory bean which, when used as <bean> gives you a kind of indirection - instead of using the class as bean directly, getObject() is called and the returned object is your <bean>.
Another thing is that Spring automatically calls afterPropertiesSet() for all beans (or factory beans) that implement InitializingBean.
So instead of:
<bean class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
id="mysessionFactory">
use:
<bean id="mysessionFactory" factory-ref="mysessionFactoryFactory"
factory-method="getObject" />
<bean class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
id="mysessionFactoryFactory" init-method="afterPropertiesSet">
...

Related

Webapp runs correctly with jetty 9 maven plugin, but not with jetty runner

Being new to Maven, I'm trying to make an executable jar of my webapp with an embedded jetty. Unfortunately, I'm having many difficulties achieving this, and decided to follow a step-by-step progression: first using jetty-maven-plugin (OK, with a lot of pain), then using jetty-runner (KO, the matter of this SO question), and finally using embedded jetty (KO).
I've spent so much time doing this, having different exceptions depending on the jetty version and pulled so much hair out, that I finally decided to ask the community for some help.
I hope this question won't be marked as a duplicate of SO #12241989 (or any other similar), because I have the same kind of problem, but clearly not the same root cause since I'm using the same version of jetty-maven-plugin and jetty-runner.
Context
webapp uses JSF2 (mojarra 2.2.8) + CDI (weld) + Primefaces + Websockets
Configuration
1. Jetty plugin
excerpt from pom.xml
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.7</java.version>
<jetty.groupId>org.eclipse.jetty</jetty.groupId>
<jetty.version>9.0.4.v20130625</jetty.version>
<jetty.descriptor>${project.basedir}/src/main/webapp/WEB-INF/web.xml</jetty.descriptor>
<jetty.env>${project.basedir}/src/main/webapp/WEB-INF/jetty-env.xml</jetty.env>
<jetty.contextPath>/</jetty.contextPath>
<jetty.overrideDescriptor>${project.basedir}/src/main/webapp/WEB-INF/jetty-web-override.xml</jetty.overrideDescriptor>
<myfaces.version>2.2.5</myfaces.version>
<mojarra.version>2.2.8</mojarra.version>
</properties>
...
<plugin>
<groupId>${jetty.groupId}</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<webApp>
<contextPath>${jetty.contextPath}</contextPath>
<descriptor>${jetty.descriptor}</descriptor>
<jettyEnvXml>${jetty.env}</jettyEnvXml>
<overrideDescriptor>${jetty.overrideDescriptor}</overrideDescriptor>
</webApp>
<contextXml>
${project.basedir}/src/main/webapp/WEB-INF/jetty-context.xml
</contextXml>
</configuration>
</plugin>
jetty-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="serverClasses">
<Array type="java.lang.String">
<Item>
-org.eclipse.jetty.servlet.ServletContextHandler.Decorator
</Item>
</Array>
</Set>
</Configure>
jetty-env.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="webAppCtx" class="org.eclipse.jetty.webapp.WebAppContext">
<New id="appManager" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>
<Ref id="webAppCtx" />
</Arg>
<Arg>BeanManager</Arg>
<Arg>
<New class="javax.naming.Reference">
<Arg>javax.enterprise.inject.spi.BeanManager</Arg>
<Arg>org.jboss.weld.resources.ManagerObjectFactory</Arg>
<Arg />
</New>
</Arg>
</New>
</Configure>
jetty-web-override.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<!-- CDI-->
<listener>
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>
<resource-env-ref>
<resource-env-ref-name>BeanManager</resource-env-ref-name>
<resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
</resource-env-ref>
<!-- mojarra -->
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
With this configuration, the application runs correctly. sigh of relief
2. Jetty runner
I believe the easiest way to reproduce the above configuration with jetty runner is using a jetty context xml file that describes my webapp. So I ended up with the following context file :
context.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/</Set>
<Set name="war">target/myapp.war</Set>
<Set name="descriptor">src/main/webapp/WEB-INF/web.xml</Set>
<Set name="overrideDescriptor">src/main/webapp/WEB-INF/jetty-web-override.xml</Set>
<Set name="serverClasses">
<Array type="java.lang.String">
<Item>
-org.eclipse.jetty.servlet.ServletContextHandler.Decorator
</Item>
</Array>
</Set>
<New id="appManager" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>BeanManager</Arg>
<Arg>
<New class="javax.naming.Reference">
<Arg>javax.enterprise.inject.spi.BeanManager</Arg>
<Arg>org.jboss.weld.resources.ManagerObjectFactory</Arg>
<Arg />
</New>
</Arg>
</New>
</Configure>
Then when I run the jetty runner (with the same version):
java -jar jetty-runner-9.0.4.v20130625.jar context.xml
...everything seems OK, except the (annoying) fact that the startup listener of my app (annotated with Servlet 3.0 #WebListener) does not start.
And if I try to navigate to http://localhost:8080/, I get the following stack trace:
HTTP ERROR 500
Problem accessing /. Reason:
Server Error
Caused by:
javax.faces.view.facelets.TagAttributeException: /index.xhtml #119,66 src="/WEB-INF/include/#{applicationManager.layout}.xhtml" /index.xhtml #119,66 src="/WEB-INF/include/#{appli
cationManager.layout}.xhtml": java.lang.NullPointerException
at com.sun.faces.facelets.tag.TagAttributeImpl.getObject(TagAttributeImpl.java:358)
at com.sun.faces.facelets.tag.TagAttributeImpl.getValue(TagAttributeImpl.java:322)
at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:112)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:161)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:990)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698)
...
Caused by: javax.el.ELException: /index.xhtml #119,66 src="/WEB-INF/include/#{applicationManager.layout}.xhtml": java.lang.NullPointerException
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114)
at com.sun.faces.facelets.tag.TagAttributeImpl.getObject(TagAttributeImpl.java:356)
... 60 more
Caused by: javax.el.ELException: java.lang.NullPointerException
at javax.el.BeanELResolver.getValue(BeanELResolver.java:368)
If I try to enforce the listening of my StartupListener class by specifying in web.xml:
<listener>
<listener-class>fr.mygroup.myapp.listeners.StartupListener</listener-class>
</listener>
...I get the same error.
Anyway, the fact that my StartupListener is not listened is clearly not the cause of the error but a consequence. But I can't figure out what's wrong with my jetty-runner configuration.
I desperately feel like it's a long way to go to an executable überjar of my webapp :(
Appendix
pom.xml
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.mygroupid</groupId>
<artifactId>myapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.7</java.version>
<jetty.groupId>org.eclipse.jetty</jetty.groupId>
<jetty.version>9.0.4.v20130625</jetty.version>
<jetty.descriptor>${project.basedir}/src/main/webapp/WEB-INF/web.xml</jetty.descriptor>
<jetty.env>${project.basedir}/src/main/webapp/WEB-INF/jetty-env.xml</jetty.env>
<jetty.contextPath>/</jetty.contextPath>
<jetty.overrideDescriptor>${project.basedir}/src/main/webapp/WEB-INF/jetty-web-override.xml</jetty.overrideDescriptor>
<myfaces.version>2.2.5</myfaces.version>
<mojarra.version>2.2.8</mojarra.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>${jetty.groupId}</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<webApp>
<contextPath>${jetty.contextPath}</contextPath>
<descriptor>${jetty.descriptor}</descriptor>
<jettyEnvXml>${jetty.env}</jettyEnvXml>
<overrideDescriptor>${jetty.overrideDescriptor}</overrideDescriptor>
</webApp>
<contextXml>
${project.basedir}/src/main/webapp/WEB-INF/jetty-context.xml
</contextXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
<repositories>
<repository>
<id>ebi-repo</id>
<name>The EBI internal repository</name>
<url>http://www.ebi.ac.uk/~maven/m2repo</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>${mojarra.version}</version>
<scope>compile</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>${mojarra.version}</version>
<scope>compile</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
<version>2.1.2.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<!-- Primefaces 5.1 -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.1</version>
</dependency>
<!-- Primefaces Themes -->
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>all-themes</artifactId>
<version>1.0.10</version>
</dependency>
<!-- Biomodels API -->
<dependency>
<groupId>uk.ac.ebi.biomodels</groupId>
<artifactId>biomodels-wslib</artifactId>
<version>1.21</version>
</dependency>
<!-- Ganymed SSH -->
<dependency>
<groupId>ch.ethz.ganymed</groupId>
<artifactId>ganymed-ssh2</artifactId>
<version>262</version>
</dependency>
<!-- Atmosphere -->
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>2.2.3</version>
</dependency>
<!-- Logback -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.1.2</version>
</dependency>
<!-- slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
</dependency>
<!-- GSON -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.4</version>
</dependency>
<!-- Apache commons -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
</dependency>
</dependencies>
</project>

Web interface neo4j embedded remote not working

I am running Neo4j in embedded mode on a remote Linux server... everything works well except the ability to connect to the web interface /host:7474/webadmin/
Using Neo4j 1.8.2 Major Stable Version
Relevant POM artifacts:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>2.2.0.RELEASE</version>
<exclusions>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>1.8.2</version>
<exclusions>
<exclusion>
<artifactId>logback-classic</artifactId>
<groupId>ch.qos.logback</groupId>
</exclusion>
<exclusion>
<artifactId>servlet-api</artifactId>
<groupId>org.mortbay.jetty</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>1.8.2</version>
<exclusions>
<exclusion>
<artifactId>logback-classic</artifactId>
<groupId>ch.qos.logback</groupId>
</exclusion>
</exclusions>
<classifier>static-web</classifier>
</dependency>
Neo4j config XML file:
<context:annotation-config />
<context:spring-configured />
<bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase">
<constructor-arg value="#{props['neo4j.location']}" />
<constructor-arg>
<map>
<entry key="enable_remote_shell" value="true" />
</map>
</constructor-arg>
</bean>
<neo4j:config graphDatabaseService="graphDatabaseService" />
<bean id="serverWrapper" class="org.neo4j.server.WrappingNeoServerBootstrapper"
init-method="start" destroy-method="stop">
<constructor-arg ref="graphDatabaseService" />
</bean>
<tx:annotation-driven mode="aspectj"
transaction-manager="transactionManager" />
<neo4j:repositories base-package="com.writelife.server.graph.repository"
repository-impl-postfix="CustomImpl" />
neo4j-server.properties file:
# location of the database directory
org.neo4j.server.database.location=data/graph.db
org.neo4j.server.webserver.address=0.0.0.0
org.neo4j.server.webserver.port=7474
# Turn https-support on/off
org.neo4j.server.webserver.https.enabled=true
# https port (for all data, administrative, and UI access)
org.neo4j.server.webserver.https.port=7473
# Certificate location (auto generated if the file does not exist)
org.neo4j.server.webserver.https.cert.location=conf/ssl/snakeoil.cert
# Private key location (auto generated if the file does not exist)
org.neo4j.server.webserver.https.key.location=conf/ssl/snakeoil.key
org.neo4j.server.webserver.https.keystore.location=data/keystore
org.neo4j.server.webadmin.rrdb.location=data/rrd
org.neo4j.server.webadmin.data.uri=/db/data/
# REST endpoint of the administration API (used by Webadmin)
org.neo4j.server.webadmin.management.uri=/db/manage/
# Low-level graph engine tuning file
org.neo4j.server.db.tuning.properties=conf/neo4j.properties
org.neo4j.server.http.log.enabled=false
org.neo4j.server.http.log.config=conf/neo4j-http-logging.xml
DB location on the file system:
/opt/neo4j-community-1.8.2/data/graph.db
Can someone explain me what am I doing wrong? How can I monitor the web interface in that consultation?
Thanks
Did you follow the instructions here?
http://docs.neo4j.org/chunked/stable/server-embedded.html
I think the neo4j-server.properties are not used. The properties you pass in to the graphdatabase are used for the database only not for the web-ui / http-server on top of that.
I think you can pass them in to the WrappingNeoServerBootstrapper
Seems to be working with a Server-Configurator. There is a also a property-file based Server configurator PropertyFileConfigurator which is passed the neo4j-server.properties file as a File object in its constructor.
I think your maven config misses the static resources too.
<dependencies>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>1.8.1</version>
</dependency>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<classifier>static-web</classifier>
<version>1.8.1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>neo4j-snapshot-repository</id>
<name>Neo4j Maven 2 snapshot repository</name>
<url>http://m2.neo4j.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

A universal match pattern ('/**') is defined before other patterns in the filter chain, causing them to be ignored

I am running into this issue with Spring 3.1.3 release and with the following application context file. I am not quite sure why does this occur. Have looked into most of the posts related to this. I dont think I have a version mismatch.
Application Context file:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<security:http auto-config='true' entry-point-ref="casEntryPoint" >
<security:intercept-url pattern="/panelpipeline/**" access="ROLE_USER"/>
<security:intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
</security:http>
<bean id="serviceProperties" class="org.springframework.security.cas.ServiceProperties">
<property name="service"
value="https://seqdws1/cas/j_spring_cas_security_check" />
<property name="sendRenew" value="false" />
</bean>
<security:http entry-point-ref="casEntryPoint">
<security:custom-filter position="CAS_FILTER"
ref="casFilter" />
</security:http>
<bean id="casFilter"
class="org.springframework.security.cas.web.CasAuthenticationFilter">
<property name="authenticationManager" ref="authenticationManager" />
</bean>
<bean id="casEntryPoint"
class="org.springframework.security.cas.web.CasAuthenticationEntryPoint">
<property name="loginUrl" value="https://seqdws1/cas/login" />
<property name="serviceProperties" ref="serviceProperties" />
</bean>
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider
ref="casAuthenticationProvider" />
</security:authentication-manager>
<bean id="casAuthenticationProvider"
class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
<property name="userDetailsService" ref="userService" />
<property name="serviceProperties" ref="serviceProperties" />
<property name="ticketValidator">
<bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
<constructor-arg index="0" value="https://seqdws1/cas" />
</bean>
</property>
<property name="key" value="an_id_for_this_auth_provider_only" />
</bean>
<security:user-service id="userService">
<security:user name="joe" password="joe" authorities="ROLE_USER" />
</security:user-service>
<!-- <security:authentication-manager> <security:authentication-provider>
<security:user-service> <security:user name="jimi" password="jimispassword"
authorities="ROLE_USER, ROLE_ADMIN" /> <security:user name="bob" password="bobspassword"
authorities="ROLE_USER" /> </security:user-service> </security:authentication-provider>
</security:authentication-manager> -->
POM dependencies
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwtVersion}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<classifier>sources</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-asm</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-cas</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
</dependencies>
The configuration you've posted has two <http> elements, neither of which has a pattern attribute so both are implicitly defined to match all requests. The second one will overwrite the first.
That doesn't necessarily explain why you are seeing this message (since it should normally apply to filters within a single chain), but it is definitely a mistake.
You should also probably remove auto-config='true' unless you know for sure that you want the extra filters which it implicitly adds.

Maven Open JPA Plugin Enhance: Seems to be working but It did not enhance my entity

When I compiled my Maven Project it says that my entity is enhanced. However when I start a database connection through EntityManagerFactory, Error happend on the code here: em = factory.createEntityManager(); I believe that I had followed all the steps in the net.. however I encountered this error. Please help.. Any advice regarding this? Thank you very much.
Error part of the code that causes the error.
factory = Persistence.createEntityManagerFactory("LotMovementPU");
em = factory.createEntityManager();
Tihs is the logs when compilied.
nothing to compile - all classes are up to date
[openjpa:enhance]
52 LotMovementPU INFO [main] openjpa.Tool - Enhancer running on type "class lotmovement.business.entity.UserProfile".
[resources:testResources]
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory C:\Users\god-gavedmework\Documents\NetBeansProjects\lotmovementMaven\src\test\resources
[compiler:testCompile]
No sources to compile
[surefire:test]
No tests to run.
Surefire report directory: C:\Users\god-gavedmework\Documents\NetBeansProjects\lotmovementMaven\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[war:war]
Packaging webapp
Warning: selected war files include a WEB-INF/web.xml which will be ignored
(webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 8.386s
Finished at: Thu Nov 29 14:21:58 NZDT 2012
Final Memory: 22M/437M
------------------------------------------------------------------------
NetBeans: Deploying on Apache Tomcat 7.0.27.0
profile mode: false
debug mode: true
force redeploy: true
Error when step to em.factory.createEntityManager();
<openjpa-2.2.0-r422266:1244990 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent: "
lotmovement.business.entity.UserProfile".
POM.XML
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>LotMovement</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>LotMovement</name>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<netbeans.hint.deploy.server>Tomcat</netbeans.hint.deploy.server>
</properties>
<repositories>
<repository>
<id>JBoss Repo</id>
<url>http://repository.jboss.com/maven2</url>
<name>JBoss Repo</name>
</repository>
<repository>
<id>ibiblio mirror</id>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</repository>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<url>http://ftp.ing.umu.se/mirror/eclipse/rt/eclipselink/maven.repo</url>
<id>eclipselink</id>
<layout>default</layout>
<name>Repository for library Library[eclipselink]</name>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>2.3.4</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<!-- set the version to be the same as the level in your runtime -->
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-all</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<!-- set the version to be the same as the level in your runtime -->
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.1.GA</version>
</dependency>
<!-- Spring framework -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6.SEC03</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>2.5.6.SEC03</version>
</dependency>
<!-- Struts 2 + Spring plugins -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.3.7</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.9.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.9.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbynet</artifactId>
<version>10.9.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<version>10.9.1.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory> src/main/java </directory>
<includes>
<include> **/*.xml </include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>2.2.0</version>
<configuration>
<includes>lotmovement/business/entity/*.class</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
<!-- Pass additional properties to the Plugin here -->
<toolProperties>
<property>
<name>directory</name>
<value>otherdirectoryvalue</value>
</property>
</toolProperties>
</configuration>
<executions>
<execution>
<id>enhancer</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>6.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="LotMovementPU" transaction-type="RESOURCE_LOCAL">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<jta-data-source>openjpa</jta-data-source>
<class>lotmovement.business.entity.UserProfile</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:derby://localhost:1527/sample"/>
<property name="javax.persistence.jdbc.password" value="app"/>
<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
<property name="javax.persistence.jdbc.user" value="app"/>
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
</properties>
</persistence-unit>
</persistence>
On the ANT style of building this, This is what is found in the BUILD.XML Maybe my enhancer did not post compile enhance it? if yes, how can you do a post compile enhance in maven?
build.xml to enhance entity in ant.
<target name="-post-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
<echo message="begin openJPAC"/>
<path id="openjpa.path.id">
<pathelement location="${build.classes.dir}"/>
<!-- Adding the OpenJPA jars into the classpath -->
<fileset dir="D:\openjpa\apache-openjpa-2.2.0\" includes="*.jar"/>
<!-- or if you create a OpenJPA Library you can use that instead -->
<!--<pathelement path="${libs.OpenJPA.classpath}"/>-->
</path>
<taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
<classpath refid="openjpa.path.id"/>
</taskdef>
<openjpac>
<classpath refid="openjpa.path.id"/>
</openjpac>
<echo message="end openJPAC"/>
I found the solution. I removed the plugin "openjpa-maven-plugin" and replace it with this (please see plugin below.) in the POM.XML -- Plugin element. When you compile it, you will see this message below. Please see the compile message. By the way, I am using Netbeans 7.2.1, Maven and struts2-spring plugin.
Compile message.
[antrun:run]
Executing tasks
[java] 63 LotMovementPU INFO [main] openjpa.Tool - Enhancer running on type "lotmovement.business.entity.UserProfile".
Executed tasks
POM.xml
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-classes</phase>
<configuration>
<tasks>
<java classname="org.apache.openjpa.enhance.PCEnhancer"
classpathref="maven.runtime.classpath"
dir="target/classes" fork="true" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

Grails acegi plugin classes not added to maven

I created a grails 1.2.0 project using the acegi plugin 0.5.2 which works very well.
To integrate the project into our companies build infrastructure I need to build it via maven. So I converted it to a maven project using the grails maven integration which worked quite well too.
There is one problem: I have a Java class CustomUserDetails that implements the GrailsUser interface. When maven tries to compile the project it can not find the GrailsUser interface class which is part of the acegi plugin.
Am I missing something or is there a problem with the grails maven integration that causes plugin classes missing from the classpath?
UPDATE: here is the pom.xml of my project:
<?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>
<groupId>com.troii</groupId>
<artifactId>testapp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-crud</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-gorm</artifactId>
<version>1.2.0</version>
</dependency>
<!-- Grails defaults to Ehache for the second-level Hibernate cache. -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<version>3.3.1.GA</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.11.0.GA</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>1.7.1</version>
<exclusions>
<exclusion>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<artifactId>servlet-api</artifactId>
</exclusion>
<!-- We have JCL-over-SLF4J instead. -->
<exclusion>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- For ease of development and testing, we include the HSQLDB database. -->
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.10</version>
</dependency>
<!-- Use Log4J for logging. This artifact also pulls in the Log4J JAR. -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.8</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<repositories>
<!-- Required to get hold of JTA -->
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
<repository>
<id>Codehaus Snapshots</id>
<url>http://snapshots.repository.codehaus.org</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>Codehaus Snapshots</id>
<url>http://snapshots.repository.codehaus.org</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<build>
<pluginManagement />
<plugins>
<plugin>
<groupId>org.grails</groupId>
<artifactId>grails-maven-plugin</artifactId>
<version>1.2.0</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>init</goal>
<goal>maven-clean</goal>
<goal>validate</goal>
<goal>config-directories</goal>
<goal>maven-compile</goal>
<goal>maven-test</goal>
<goal>maven-war</goal>
<goal>maven-functional-test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>tools</id>
<activation>
<property>
<name>java.vendor</name>
<value>Sun Microsystems Inc.</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>${java.version}</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
I think what is going on is you are expecting the plugin classpath to be available to when compiling you project source code. Plugins have their own classloader, so your classes won't see stuff in there.
Instead define a project dependency to a library which contains the GrailsUser interface and make sure the scope of that dependency is compile (the default).

Resources