War deployment to external container of choice - Tomcat

212 views
Skip to first unread message

Matthew Hannay

unread,
Feb 15, 2018, 12:56:19 AM2/15/18
to CAS Community

We have the latest tomcat 7 servers

In my POM I have set <app.server></app.server>

so that it pulls down the cas-server-webapp overlay
I do a mvn clean compile package then copy the war to 
the webapps directory of the tomcat server. I then get a magnitude of errors
like it thinks its a spring boot application.

I have worked through 

and
thus does not tell me much ....


One of the errors:

2018-02-15 05:37:08,530 ERROR [org.springframework.boot.SpringApplication] - <Application startup failed>
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.apereo.cas.web.CasWebApplication]; nested exception is java.lang.IllegalStateException: Unable to read meta-data for class org.apereo.cas.config.CasEmbeddedContainerTomcatConfiguration
        at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:556) ~[spring-context-4.3.12.RELEASE.jar:4.3.12.RELEASE]
        at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:185) ~[spring-context-4.3.12.RELEASE.jar:4.3.12.RELEASE]
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:308) ~[spring-context-4.3.12.RELEASE.jar:4.3.12.RELEASE]



Caused by: java.io.FileNotFoundException: class path resource [org/apereo/cas/config/CasEmbeddedContainerTomcatConfiguration.class] cannot be opened because it does not exist




MAYBE I AM missing a property?





Simon Bear

unread,
Feb 15, 2018, 1:44:10 AM2/15/18
to cas-...@apereo.org
I assume you're trying to run the WAR in a container?  Do you have the exec profile in your POM?  (See https://github.com/apereo/cas-management-overlay/blob/master/pom.xml#L122)

If so, try deactivating it while running the maven build (eg ./mvnw -P-exec package).  Alternatively you could try adding a classifier to the spring boot repackaged artefact, which will leave the original WAR in tact:

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot.version}</version>
<executions>
<execution>
<goals>
<goal>build-info</goal>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
...
<classifier>exec</classifier>
...
</configuration>
</plugin>


--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/113969a3-0351-4ec6-80d9-1bc36e84c03d%40apereo.org.

Matthew Hannay

unread,
Feb 15, 2018, 6:02:46 PM2/15/18
to CAS Community

This is useful for modifying the POM to build a war for deployment to a tomcat or other container.


--Matt

Richard Frovarp

unread,
Feb 15, 2018, 6:07:44 PM2/15/18
to cas-...@apereo.org
I ran into something not working on Tomcat 7. Can't remember if it was the IdP or the management application. Either way I had to go to Tomcat 8.5. Don't think that's the problem here, but you may want to go to 8.5 anyway.
--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
Reply all
Reply to author
Forward
0 new messages