Hello,
thanks that worked like a charm!
Just one more question maybe. The tomee maven plugin now loads the
WAR file and starts the app properly. I wonder if I could use it to load
from the target/ folder where I compile to, without having to package a
war? Besides allowing for a faster startup time, I would like to use
this way of launching the app, then edit the HTML & JS files and just
reload the app for rapid development. Is that possible?
Regards,
Emmanuel
PS: If that'll help someone who'll find this in the archives someday, it's:
<libs>
<lib>org.postgresql:postgresql:9.4-1201-jdbc41</lib>
</libs>
under the configuration tag.
On 24/11/15 19:43, Romain Manni-Bucau wrote:
the authenticator uses container classloader, just remove postgre from your
app and add it in <libs> of the plugin
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-11-24 19:41 GMT+01:00 Emmanuel Touzery <[email protected]>
:
Hello,
When I start the application normally with a tomee copy on my disk,
it
works fine. I'm now trying to configure a startup using the tomee maven
plugin. The login screen comes up but I can't login with this error.
Since
it's the tomee maven plugin, I can pass java system properties but I
can't
edit the tomee configuration files.
What do you mean? you can provide them in src/main/tomee/conf.
Wow thank you! I had no idea. Ok, so now I got my error, and I'm
confused...
It says it cannot find the postgresql driver, but the rest of the
application writes to postgresql fine (for instance I have an
authication_log table in which I write that the login failed??). I specify
the postgresql dependency using the dependencies xml tag in the profile. So
how come the authentication part cannot find it?
I paste the relevant bits of the pom.xml (some other part is in my
original email) and the stacktrace I just got now thank to your help.
<profile>
<id>tomee-test</id>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId> <---------------------
<version>9.4-1201-jdbc41</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.2.15.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.2.15.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.3.1.Final</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.18.1-GA</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.openejb.maven</groupId>
<artifactId>tomee-maven-plugin</artifactId>
[...]
Nov 24, 2015 6:37:14 PM org.apache.catalina.realm.JDBCRealm authenticate
SEVERE: Exception performing authentication
java.sql.SQLException: org.postgresql.Driver
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:692)
at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:350)
at
org.apache.catalina.realm.CombinedRealm.authenticate(CombinedRealm.java:146)
at
org.apache.tomee.catalina.TomEERealm.authenticate(TomEERealm.java:43)
at
org.apache.catalina.authenticator.AuthenticatorBase.doLogin(AuthenticatorBase.java:848)
at
org.apache.catalina.authenticator.AuthenticatorBase.login(AuthenticatorBase.java:830)
at org.apache.catalina.connector.Request.login(Request.java:2637)
at
org.apache.catalina.connector.RequestFacade.login(RequestFacade.java:1064)
at
javax.servlet.http.HttpServletRequestWrapper.login(HttpServletRequestWrapper.java:307)
at
com.lecip.core.authentication.Authentication.setNextLoginStep(Authentication.java:609)
at
com.lecip.core.authentication.Authentication.authenticate(Authentication.java:214)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.el.parser.AstValue.invoke(AstValue.java:278)
at
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:273)
at
org.apache.myfaces.view.facelets.el.ContextAwareTagMethodExpression.invoke(ContextAwareTagMethodExpression.java:96)
at
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:68)
at javax.faces.component.UICommand.broadcast(UICommand.java:120)
at javax.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:1041)
at
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:289)
at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1415)
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:765)
at
org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:38)
at
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:198)
at
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:176)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
com.lecip.tms.tms_core.application.MyHeadersFilter.doFilter(MyHeadersFilter.java:21)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:610)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net
.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:260)
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:688)
... 55 more