HiromuHota / webspoon-docker

Dockerfile for webSpoon
https://hub.docker.com/r/hiromuhota/webspoon/
Apache License 2.0
103 stars 61 forks source link

Webspoon with PDI GIS plugin #11

Closed PovilasKud closed 6 years ago

PovilasKud commented 6 years ago

After installing PDI GIS plugin from marketplace I was getting error: java.lang.NoClassDefFoundError: org/apache/commons/vfs/FileSystemException

Looking at Pentaho GIS plugin profiles file I can see that they don't support PDI 8.1

Based on Issue info I still tried to solve the error by shipping https://github.com/atolcd/pentaho-gis-plugins/releases/download/v1.2.1/pentaho-gis-plugins-1.2.1-bin-7.zip together with commons-vfs2-2.0.jar in dockerfile and this seem to make error go away, but still there is an error on other dependencies. java.lang.NoClassDefFoundError: org/codehaus/jackson/type/JavaType

Trying to ship jackson-mapper-asl-1.9.2.jar doesn't seem to help.

GIS plugin is crucial for the project so i'm looking in to these options:

  1. Downgrading Webspoon with PDI 7.0.
  2. Trying to solve the dependencies problems.

Any ideas on dependencies? How could I downgrade Webspoon ?

HiromuHota commented 6 years ago

I compiled it with 8.1 dependencies. Can you try this? pentaho-gis-plugins-1.2.1-bin-8.zip

PovilasKud commented 6 years ago

HiromuHota, thanks for quick response!

Unfortunately, I'm still getting same error java.lang.NoClassDefFoundError: org/codehaus/jackson/type/JavaType

My Dockerfile-full looks like this: `FROM hiromuhota/webspoon:0.8.1-base MAINTAINER Hiromu Hota hiromu.hota@hal.hitachi.com ENV JAVA_OPTS="-Xms1024m -Xmx2048m" ARG base=8.1 ARG patch=16 ARG version=0.$base.$patch ARG dist=8.1.0.0-365

RUN apt-get update && apt-get install -y python python-dev python-pip RUN apt-get install -y aptitude RUN apt-get install -y libxft-dev RUN apt-get install -y libfreetype6 RUN apt-get install -y libfreetype6-dev RUN pip install "pandas" RUN pip install "numpy" RUN pip install "scipy" RUN pip install "matplotlib" RUN pip install "sklearn" RUN pip install "pyshp" RUN pip install requests RUN apt-get install -y python-tk ENV PATH="$PATH:/usr/bin/python2.7/" ENV PYTHONPATH="$PYTHONPATH:/usr/bin/python2.7/"

COPY install.sh /tmp/install.sh RUN sh /tmp/install.sh

COPY java-xmlbuilder-0.6.jar ${CATALINA_HOME}/lib/java-xmlbuilder-0.6.jar COPY commons-vfs-1.0.jar ${CATALINA_HOME}/lib/commons-vfs-1.0.jar COPY commons-vfs2-2.0.jar ${CATALINA_HOME}/lib/commons-vfs2-2.0.jar COPY jackson-mapper-asl-1.9.2.jar ${CATALINA_HOME}/lib/jackson-mapper-asl-1.9.2.jar

COPY pentaho-gis-plugins2 ${CATALINA_HOME}/plugins/pentaho-gis-plugins

COPY web.xml $CATALINA_HOME/webapps/spoon/WEB-INF/web.xml COPY security.xml $CATALINA_HOME/webapps/spoon/WEB-INF/spring/security.xml

ADD https://github.com/HiromuHota/pentaho-kettle/releases/download/webspoon%2F$version/webspoon-security-$dist-$patch.jar ${CATALINA_HOME}/lib/ RUN echo "CLASSPATH="$CATALINA_HOME"/lib/webspoon-security-$dist-$patch.jar" | tee ${CATALINA_HOME}/bin/setenv.sh COPY catalina.policy ${CATALINA_HOME}/conf/ RUN mkdir -p $HOME/.kettle/users && mkdir -p $HOME/.pentaho/users`

And full error:

Unable to open dialog for this step java.lang.NoClassDefFoundError: org/codehaus/jackson/type/JavaType at com.atolcd.pentaho.di.gis.io.GeoJSONReader.<init>(GeoJSONReader.java:67) at com.atolcd.pentaho.di.trans.steps.gisfileinput.GisFileInputMeta.getFields(GisFileInputMeta.java:213) at org.pentaho.di.trans.TransMeta.compatibleGetStepFields(TransMeta.java:2061) at org.pentaho.di.trans.TransMeta.getThisStepFields(TransMeta.java:2047) at org.pentaho.di.trans.TransMeta.getStepFields(TransMeta.java:1868) at org.pentaho.di.trans.TransMeta.getPrevStepFields(TransMeta.java:1947) at org.pentaho.di.trans.TransMeta.getPrevStepFields(TransMeta.java:1917) at org.pentaho.di.trans.TransMeta.getPrevStepFields(TransMeta.java:1900) at org.pentaho.di.trans.TransMeta.getPrevStepFields(TransMeta.java:1887) at com.atolcd.pentaho.di.ui.trans.steps.gisfileoutput.GisFileOutputDialog.getFieldsFromType(GisFileOutputDialog.java:682) at com.atolcd.pentaho.di.ui.trans.steps.gisfileoutput.GisFileOutputDialog.open(GisFileOutputDialog.java:495) at org.pentaho.di.ui.spoon.delegates.SpoonStepsDelegate.editStep(SpoonStepsDelegate.java:120) at org.pentaho.di.ui.spoon.Spoon.editStep(Spoon.java:8995) at org.pentaho.di.ui.spoon.trans.TransGraph.editStep(TransGraph.java:3433) at org.pentaho.di.ui.spoon.trans.TransGraph.mouseDoubleClick(TransGraph.java:819) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:218) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:109) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:687) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:594) at org.eclipse.swt.widgets.Display.executeNextEvent(Display.java:1217) at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1198) at org.eclipse.swt.widgets.Display.safeReadAndDispatch(Display.java:1181) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1173) at org.eclipse.rap.rwt.application.AbstractEntryPoint.createUI(AbstractEntryPoint.java:69) at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177) at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:290) at java.lang.Thread.run(Thread.java:748) at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:107) Caused by: java.lang.ClassNotFoundException: org.codehaus.jackson.type.JavaType at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1309) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1137) at org.pentaho.di.core.plugins.KettleURLClassLoader.loadClassFromParent(KettleURLClassLoader.java:94) at org.pentaho.di.core.plugins.KettleURLClassLoader.loadClass(KettleURLClassLoader.java:114) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 28 more

PovilasKud commented 6 years ago

I also tried to copy pentaho-gis-plugin/lib folder content to ${CATALINA_HOME}/lib, but that didn't improve anything.

PovilasKud commented 6 years ago

I managed to fix this by including additional dependencies found in pom.xml

required *.jars was:

  1. jts-core
  2. jackson-core-asl
  3. jackson-jaxrs
  4. jackson-mapper-asl

I've added them to ${CATALINA_HOME}/lib in addition with the ones you sent in pentaho-gis-plugins-1.2.1-bin-8.zip

The error is gone and it looks like plugin works, tho I'm getting another error on Running transformation GIS File input.0 - Error initialize reader : only FeatureCollection is supported, looking at root of exception I guess that's something to do with my Input GeoJson format.

HiromuHota commented 6 years ago

I'm happy to hear that. For future reference, the changes I made to the plugin are as follows:

My-MBP:pentaho-gis-plugins hiromu$ git log -1
commit 32fa9955e9021375e344832dd9309ff6354a20cb (HEAD -> feature/pentaho8, tag: v1.2.1, origin/master, origin/HEAD, master)
Author: Charles-Henry Vagner <cva@atolcd.com>
Date:   Mon Jul 24 16:18:20 2017 +0200

    Updade JTS 1.14.0
My-MBP:pentaho-gis-plugins hiromu$ git diff
diff --git a/pentaho-gis-plugins/pom.xml b/pentaho-gis-plugins/pom.xml
index 83c566a..96dfe70 100644
--- a/pentaho-gis-plugins/pom.xml
+++ b/pentaho-gis-plugins/pom.xml
@@ -12,9 +12,21 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs

   <profiles>
     <profile>
-      <id>pentaho-7</id>
+      <id>pentaho-8</id>
       <activation>
         <activeByDefault>true</activeByDefault>
+        <property>
+          <name>pentaho</name>
+          <value>8</value>
+        </property>
+      </activation>
+      <properties>
+        <pentaho.version>8.1.0.0-365</pentaho.version>
+      </properties>
+    </profile>
+    <profile>
+      <id>pentaho-7</id>
+      <activation>
         <property>
           <name>pentaho</name>
           <value>7</value>
@@ -205,7 +217,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
     <dependency>
       <groupId>com.oracle</groupId>
       <artifactId>ojdbc6</artifactId>
-      <version>11.2.0.1.0</version>
+      <version>11.2.0.3</version>
     </dependency>

     <!-- Plugin specific -->