Unable to build nanos (Tomcat-based) server

12 views
Skip to first unread message

Mark Dittmer

unread,
Dec 11, 2017, 1:41:32 PM12/11/17
to foam-framework-discuss
I attempted to setup a Dockerfile that will create a clean instance with Tomcat, and FOAM, and then build FOAM according to what the README.md says to do for Java.

I've attached the shell script I use to invoke docker, a helper script for environment variables, and the Dockerfile. The complete output from the command is in the .log file.

Bottom line: I'm seeing:

[ERROR] /home/x/foam2/build/foam/nanos/tomcat/TomcatRouter.java:[8,30] package javax.websocket.server does not exist

My best guess (as someone who knows almost nothing about Maven and Tomcat) is that Tomcat's code (somewhere under /home/x/apache-tomcat-8.5.24) is not in the classpath.

Anyone at Nanopay have insights on what I'm missing?

//Mark
docker-build.log
docker_build.sh
Dockerfile
env.sh

Adam Van Ymeren

unread,
Dec 11, 2017, 2:05:17 PM12/11/17
to Mark Dittmer, foam-framework-discuss
Mark Dittmer <mark.s....@gmail.com> writes:

> I attempted to setup a Dockerfile that will create a clean instance with Tomcat, and FOAM, and then build FOAM according to what the README.md says to do for Java.
>
> I've attached the shell script I use to invoke docker, a helper script for environment variables, and the Dockerfile. The complete output from the command is in the .log file.
>
> Bottom line: I'm seeing:
>
> [ERROR] /home/x/foam2/build/foam/nanos/tomcat/TomcatRouter.java:[8,30]
> package javax.websocket.server does not exist

Add this to your pom.xml

<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>

Adam Van Ymeren

unread,
Dec 11, 2017, 2:14:05 PM12/11/17
to Mark Dittmer, foam-framework-discuss
Actually I just pushed a fix for foam2. Pull and rebuild and it should work.

Mark Dittmer

unread,
Dec 11, 2017, 2:22:10 PM12/11/17
to Adam Van Ymeren, foam-framework-discuss
It's working now. Thanks, Adam!

Mark Dittmer

unread,
Dec 11, 2017, 2:28:55 PM12/11/17
to Adam Van Ymeren, foam-framework-discuss
Next issue: Kevin sent me "run tomcat" instructions that contain the following (after mvn clean install):

cp target/ROOT.war $CATALINA_HOME/webapps

My assumption is that the current working directory is foam2/build. Even after running maven, I don't see any .war files (including target/ROOT.war). Any insights as to what might be missing/broken?

//Mark

Mark Dittmer

unread,
Dec 11, 2017, 2:59:58 PM12/11/17
to Adam Van Ymeren, foam-framework-discuss
Attached: Updated Dockerfile (with a bunch of commands from Kevin's build instructions), and log (with errors; gets through "mvn package" with warnings, but cannot proceed after that).

//Mark
docker-build.log
Dockerfile

Mark Dittmer

unread,
Dec 11, 2017, 3:34:46 PM12/11/17
to Adam Van Ymeren, foam-framework-discuss
So, if I setup <packaging>war</packaging> and replace ROOT.war with foam-1.0-SNAPSHOT.war, I get a bit further in my Dockerfile. However, it appears that the `find.sh` copied from Kevin's instructions (and possibly the various things that he `cp`s manually) are not checked in to foam2.

Nanopay folks, is there some script that was supposed to be copied into foam2 along with the nanos controller that got skipped?

//Mark

Mark Dittmer

unread,
Dec 15, 2017, 8:20:46 AM12/15/17
to Adam Van Ymeren, foam-framework-discuss
**ping**
Reply all
Reply to author
Forward
0 new messages