OHDSI Home | Forums | Wiki | Github

Problems building WebAPI on mac

webapi

(Don O'Hara) #1

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


(Don O'Hara) #2

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

(Don O'Hara) #3

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.


t