I got a new project which I wanted to work with in Intellij. As local server we use Tomcat 7.0.68 and JDK 1.8.
This is my configuration in tomcat.
lib/catalina/org/apache/catalina/startup/Authenticators.properties:
NIGHTSHIFT=com.glit.swidA9O.v1.authenticator.NightShiftAuthenticator
conf/catalina.properties:
common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,/Users/Administrator/dev/server/apache-tomcat-7.0.68/shared/nightShift/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
conf/context:
<Valve className="com.glit.swidA9O.v1.authenticator.NightShiftAuthenticator" changeSessionIdOnAuthentication="true"/>
<Loader className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath="/Users/Administrator/dev/PROJECT/config;/Users/Administrator/dev/PROJECT/data"/>
conf/server.xml
<Engine name="Catalina" defaultHost="localhost">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<Realm className="com.glit.swidA7U.v1.realm.NightShiftRealm" roleClassNames="com.glit.swidBS0.v1.shared.principals.NightShiftGroup" userClassNames="com.glit.swidBS0.v1.shared.principals.NightShiftUser"/>
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
Our problem
Inside our local tomcat server we want to use a specific library called "NightShift". Unfortunately every time we try to build our application with intellij/tomcat we get this error somehow:
Which is funny because if we try to build the application with eclipse tomcat runs smoothly and can actually build the project properly.
Those are the settings for Intellij/Tomcat we made:
These are my vm-options (actually I don't even know if you need this but just in case):
-DLOG4J2-ROOT=/Users/Administrator/dev/PROJECT/data/logs
-Djava.security.auth.login.config=/Users/Administrator/dev/PROJECT/config/NightShift-config/common/NightShiftJAAS.conf
-Dpu8.config.path=/Users/Administrator/dev/PROJECT/config/NightShift-config
-Dpu8.configuration.id=A7U
-Dpu8.environment=ide
-Djava.util.logging.config.file=/Users/Administrator/dev/PROJECT/config/NightShift-config/log-config.properties
-Djava.security.manager
-Djava.security.policy="/Users/Administrator/dev/server/apache-tomcat-7.0.68/conf/catalina.policy"
This is what our tomcat looks like:
Inside "shared" is a folder called "nightshift" and there are all the neccessary .jar files which we mentioned in the catalina.properties file.
Inside our artifacts we didn't include the "nightshift" jars, cause we want it installed in tomcat and not in our application.