OHDSI Home | Forums | Wiki | Github

Problems building WebAPI on mac

I’m having troubles building webapi on my local mac (10.13.6). Maven error:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.qmino:miredot-plugin:1.5.1:restdoc (default) on project WebAPI: Execution default of goal com.qmino:miredot-plugin:1.5.1:restdoc failed: Plugin com.qmino:miredot-plugin:1.5.1 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.6.0 at specified path /Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home/../lib/tools.jar

I tried a few things, such as adding com.sun.tools to pom.xml; downloading the tools.jar manually, but was starting to get into hack mode. I did see some comments about the mac java setup being problematic, but have had no problems with other (trivial) java apps.

My command line:

> mvn clean package -e -X -U -s WebAPIConfig/settings.xml -P webapi-postgresql >me.log 2>me.log2

I appreciate any pointers or links to doco to look at for things to try.

Thanks,
Don

I got past the error by commenting out the restdoc goal for the miredot plugin, for now. WebApi builds now, but I get a fatal error deploying the war to tomcat. Something with the jersey Resource Configuration?

2018-12-01 23:35:25.229 WARN http-nio-8080-exec-6 org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext -  - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration$$EnhancerBySpringCGLIB$$60272d93]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceConfigCustomizer' defined in class path resource [org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration$JacksonResourceConfigCustomizer.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jersey.ResourceConfigCustomizer]: Factory method 'resourceConfigCustomizer' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
2018-12-01 23:35:25.237 ERROR http-nio-8080-exec-6 org.springframework.boot.SpringApplication -  - Application startup failed
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration$$EnhancerBySpringCGLIB$$60272d93]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceConfigCustomizer' defined in class path resource [org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration$JacksonResourceConfigCustomizer.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jersey.ResourceConfigCustomizer]: Factory method 'resourceConfigCustomizer' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement

01-Dec-2018 23:35:25.245 SEVERE [http-nio-8080-exec-6] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/usr/local/Cellar/tomcat/9.0.13/libexec/webapps/webapi.war]
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/webapi]]
	at org.apache.cat

Working now, when I run entirely within IntelliJ IDEA. I was running tomcat separately and deploying the war each time I rebuilt. Will keep learning the framework and track down what I was doing wrong that way.

fwiw I am getting this error too, macOS 13.4.1,
openjdk 11.0.19 2023-04-18 LTS
OpenJDK Runtime Environment Corretto-11.0.19.7.1 (build 11.0.19+7-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.19.7.1 (build 11.0.19+7-LTS, mixed mode)
mvn clean package -DskipUnitTests -DskipITtests -s WebAPIConfig/settings.xml

if possible, get an install of JDK 8. We’re still bound to this, although we are thinking about strategies to get us up to JDK 17+ while maintaining compatability/interop with other aspects of the community which are tied to JDK 8.

Broadsea (if you can run Docker) offers a pathway for standing up WebAPI/Atlas on different OSs. We’ve been able to deploy it on Linux and Mac.

t