IPF Basic Tutorial

105 views
Skip to first unread message

Rica

unread,
May 27, 2017, 3:54:03 AM5/27/17
to ipf-user
Hi,

I'm trying to follow the Tutorial: http://www.openehealth.org/display/ipf2/IPF+Tutorials and create a basic application. I followed the instructions and just changed the DarchetypeVersion to 3.2.1.
Running
mvn install

I get the exception 
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

So I did add the commons-logging-dependency to the pom.xml and tried again
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
   
<groupId>commons-logging</groupId>
   
<artifactId>commons-logging</artifactId>
   
<version>1.2</version>
</dependency>

But after running mvn install again I got the exception:
Caused by: java.lang.NoClassDefFoundError: com/sun/xml/bind/v2/model/annotation/AnnotationReader

Did I miss something?

Thanks a lot!

Rica

unread,
May 27, 2017, 3:54:04 AM5/27/17
to ipf-user
Hello,

I'm trying to make the IPF-Basic-Tutorial: http://www.openehealth.org/display/ipf2/IPF+Tutorials

I changed the DarchetypeVersion to 3.2.1. But the result of mvn install was 
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

I did add the commons-logging-edependency
<dependency>
   
<groupId>commons-logging</groupId>
   
<artifactId>commons-logging</artifactId>
   
<version>1.2</version>
</dependency>

But now I get the exception 
java.lang.NoClassDefFoundError: com/sun/xml/bind/v2/model/annotation/AnnotationReader

Did I miss something?

Thanks a lot for your help!

Dmytro Rud

unread,
May 28, 2017, 5:48:22 PM5/28/17
to ipf-...@googlegroups.com
Hello Rica,

This class is defined here:

<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>2.2.11</version>
</dependency>

Note also that the tutorial you are making is a little bit outdated.  In particular, you should use the artifact

<groupId>org.openehealth.ipf</groupId>
<artifactId>ipf-dependencies</artifactId>
<version>${ipf-version}</version>

as the parent of your project -- in this case, relevant dependencies will be automatically (transitively) pre-configured.

Best regards
Dmytro


--
You received this message because you are subscribed to the Google Groups "ipf-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ipf-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rica

unread,
May 30, 2017, 4:00:13 AM5/30/17
to ipf-user
Hi Dmytro,
thanks a lot for your help!

I changed my pom.xml as you said. A lot of failures disapeared, but while I run SampleServer.java I got the Exception: 
Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://openehealth.org/schema/ipf-commons-core

Here is my 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/maven-v4_0_0.xsd">


 
<modelVersion>4.0.0</modelVersion>
 
<groupId>hd</groupId>
 
<artifactId>NewBasic</artifactId>
 
<name>NewBasic</name>
 
<packaging>jar</packaging>


 
<properties>
 
<!-- libraries -->
 
<ipf-version>3.3-20170504</ipf-version>
 
<lombok-version>1.14.8</lombok-version>


 
<!-- plugins -->
 
<assembly-plugin-version>2.4</assembly-plugin-version>
 
<compiler-plugin-version>3.2</compiler-plugin-version>
 
<eclipse-plugin-version>2.9</eclipse-plugin-version>
 
<groovy-eclipse-batch-version>2.3.7-01</groovy-eclipse-batch-version>
 
<groovy-eclipse-compiler-version>2.9.0-01</groovy-eclipse-compiler-version>
 
</properties>
<parent>
<groupId>org.openehealth.ipf</groupId>
<artifactId>ipf-dependencies</artifactId>
<version>3.3-20170504</version>
</parent>

 
<dependencyManagement>
 
<dependencies>
 
<dependency>
 
<groupId>org.openehealth.ipf</groupId>
 
<artifactId>ipf</artifactId>
 
<version>${ipf-version}</version>
 
<type>pom</type>
 
<scope>import</scope>
 
</dependency>
 
</dependencies>
 
</dependencyManagement>


 
<dependencies>

 
<!-- dependencies for production -->
 
<dependency>
 
<groupId>org.openehealth.ipf.platform-camel</groupId>
 
<artifactId>ipf-platform-camel-core</artifactId>
 
</dependency>
 
<dependency>
 
<groupId>org.openehealth.ipf.commons</groupId>
 
<artifactId>ipf-commons-core</artifactId>
 
</dependency>


 
<dependency>
 
<groupId>org.slf4j</groupId>
 
<artifactId>slf4j-api</artifactId>
 
</dependency>


 
<!-- dependencies for test -->
 
<dependency>
 
<groupId>org.springframework</groupId>
 
<artifactId>spring-test</artifactId>
 
<scope>test</scope>
 
</dependency>


 
<dependency>
 
<groupId>org.springframework</groupId>
 
<artifactId>spring-context</artifactId>
 
</dependency>
 
<dependency>
 
<groupId>org.apache.camel</groupId>
 
<artifactId>camel-spring</artifactId>
 
</dependency>
 <dependency>

 
<groupId>org.glassfish.jaxb</groupId>
 
<artifactId>jaxb-runtime</artifactId>

 
<version>2.3.0-b170127.1453</version>
 
</dependency>

 
<dependency>
 
<groupId>junit</groupId>
 
<artifactId>junit</artifactId>
 
<scope>test</scope>
 
</dependency>
 
<dependency>
 
<groupId>org.slf4j</groupId>
 
<artifactId>slf4j-log4j12</artifactId>
 
<scope>test</scope>
 
</dependency>
 
</dependencies>


 
<build>
 
<pluginManagement>
 
<plugins>
 
<plugin>
 
<groupId>org.apache.maven.plugins</groupId>
 
<artifactId>maven-assembly-plugin</artifactId>
 
<version>${assembly-plugin-version}</version>
 
</plugin>
 
<plugin>
 
<groupId>org.apache.maven.plugins</groupId>
 
<artifactId>maven-compiler-plugin</artifactId>
 
<version>${compiler-plugin-version}</version>
 
<configuration>
 
<compilerId>groovy-eclipse-compiler</compilerId>
 
<source>1.7</source>
 
<target>1.7</target>
 
<fork>true</fork>
 
<verbose>false</verbose>
 
<compilerArguments>
 
<javaAgentClass>lombok.core.Agent</javaAgentClass>
 
</compilerArguments>
 
</configuration>
 
<dependencies>
 
<dependency>
 
<groupId>org.codehaus.groovy</groupId>
 
<artifactId>groovy-eclipse-batch</artifactId>
 
<version>${groovy-eclipse-batch-version}</version>
 
</dependency>
 
<dependency>
 
<groupId>org.codehaus.groovy</groupId>
 
<artifactId>groovy-eclipse-compiler</artifactId>
 
<version>${groovy-eclipse-compiler-version}</version>
 
</dependency>
 
<dependency>
 
<groupId>org.projectlombok</groupId>
 
<artifactId>lombok</artifactId>
 
<version>${lombok-version}</version>
 
</dependency>
 
</dependencies>
 
</plugin>
 
<plugin>
 
<groupId>org.apache.maven.plugins</groupId>
 
<artifactId>maven-eclipse-plugin</artifactId>
 
<version>${eclipse-plugin-version}</version>
 
</plugin>
 
</plugins>
 
</pluginManagement>


 
<resources>
 
<resource>
 
<directory>src/main/resources</directory>
 
</resource>
 
<resource>
 
<!-- This seems to be the only way to add the .groovy source files -->
 
<!-- in src/main/groovy to the Eclipse build path. -->
 
<!-- The source files have to be excluded binaries explicitly (see maven-jar-plugin
 config). -->

 
<directory>src/main/groovy</directory>
 
</resource>
 
<resource>
 
<directory>.</directory>
 
<includes>
 
<include>META-INF/**/*</include>
 
</includes>
 
</resource>
 
</resources>
 
<testResources>
 
<testResource>
 
<directory>src/test/resources</directory>
 
</testResource>
 
</testResources>


 
<plugins>
 
<plugin>
 
<groupId>org.apache.maven.plugins</groupId>
 
<artifactId>maven-compiler-plugin</artifactId>
 
</plugin>
 
<plugin>
 
<artifactId>maven-assembly-plugin</artifactId>
 
<configuration>
 
<descriptors>
 
<descriptor>src/main/assembly/bin.xml</descriptor>
 
</descriptors>
 
</configuration>
 
</plugin>
 
<plugin>
 
<groupId>org.apache.maven.plugins</groupId>
 
<artifactId>maven-eclipse-plugin</artifactId>
 
<configuration>
 
<projectnatures>
 
<projectnature>org.eclipse.jdt.core.javanature</projectnature>
 
<projectnature>org.eclipse.jdt.groovy.core.groovyNature</projectnature>
 
</projectnatures>
 
<downloadSources>true</downloadSources>
 
<ajdtVersion>none</ajdtVersion>
 
<classpathContainers>
 
<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
 
<!-- Add explicitly the groovy libs. Groovy nature alone seems not
 to be enough. -->

 
<classpathContainer>GROOVY_SUPPORT</classpathContainer>
 
</classpathContainers>
 
</configuration>
 
</plugin>
 
</plugins>
 
</build>


</project>

And the part of context.xml I changed (I couldn't find http://openehealth.org/schema/ipf-commons-core.xsd):
Thanks for your professional help!
Greetings Rica

Rica

unread,
Jun 3, 2017, 3:48:05 AM6/3/17
to ipf-user
Hello,

now I'm getting the failure:
 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'template': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camelContext': Invocation of init method failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [SampleRouteBuilder] for bean with name 'routeBuilder' defined in class path resource [context.xml]; nested exception is java.lang.ClassNotFoundException: SampleRouteBuilder

It seems like I'm running into errors every time, so my question: is it possible to get an working eclipse example of the basic-tutorial as a zip? Is it possible, any one send it to me?

Thanks a lot!
Rica

Dmytro Rud

unread,
Jun 3, 2017, 1:24:26 PM6/3/17
to ipf-...@googlegroups.com
Hello Rica,

Please take a look at the sub-project "tutorials" in the IPF sources (https://github.com/oehf/ipf/tree/master/tutorials). 

Best regards
Dmytro
--
You received this message because you are subscribed to the Google Groups "ipf-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ipf-user+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages