- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 rhel 机器上使用 TomEE plus 1.7.1。我已经为持久性存储设置了 jdbc 存储,以将 session 数据存储在 mysql 数据库中。 jdbc 存储在 rhel 机器上不工作。甚至文件中的持久性也不起作用。以下是我所做的设置。
在/conf/context.xml 中添加了这个
<Manager className="org.apache.catalina.session.PersistentManager"
maxIdleBackup="0">
<Store className="org.apache.catalina.session.JDBCStore"
connectionURL="jdbc:mysql://dbservername:3306/someName?user=[user]&password=[pass]"
driverName="com.mysql.jdbc.Driver"
sessionAppCol="app_name"
sessionDataCol="session_data"
sessionIdCol="session_id"
sessionLastAccessedCol="last_access"
sessionMaxInactiveCol="max_inactive"
sessionTable="TOMCAT_SESSIONS"
sessionValidCol="valid_session"/>
</Manager>
我有一个包含以下内容的 TomEE 启动脚本。第2行与jdbc store相关
export JAVA_OPTS="-Djava.awt.headless=true -Dawt.toolkit=sun.awt.HToolkit"
export CATALINA_OPTS="-Dorg.apache.catalina.session.StandardSession.ACTIVITY_CHECK=true"
sh catalina.sh start
在mysql中创建了如下表
created following table
create table tomcat_sessions (
session_id varchar(100) not null primary key,
valid_session char(1) not null,
max_inactive int not null,
last_access bigint not null,
app_name varchar(255),
session_data mediumblob,
KEY kapp_name(app_name)
);
在/lib 中添加了 mysql-connector-java.jar观察到以下错误
观察到的错误-
对于部署在 apache 中的每个应用程序,我都会收到这些错误
SEVERE: Error manager.start()
org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.session.PersistentManager[/tomee]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5499)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.session.JDBCStore[org.apache.catalina.session.PersistentManager[/tomee]]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.session.PersistentManagerBase.startInternal(PersistentManagerBase.java:864)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 12 more
Caused by: java.lang.NullPointerException
at org.apache.catalina.session.JDBCStore.open(JDBCStore.java:961)
at org.apache.catalina.session.JDBCStore.getConnection(JDBCStore.java:893)
at org.apache.catalina.session.JDBCStore.startInternal(JDBCStore.java:1064)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 14 more
SEVERE: Error manager.start()
org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.session.PersistentManager[/myAppname1]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5499)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.session.JDBCStore[org.apache.catalina.session.PersistentManager[/myAppname1]]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.session.PersistentManagerBase.startInternal(PersistentManagerBase.java:864)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 12 more
Caused by: java.lang.NullPointerException
at org.apache.catalina.session.JDBCStore.open(JDBCStore.java:961)
at org.apache.catalina.session.JDBCStore.getConnection(JDBCStore.java:893)
at org.apache.catalina.session.JDBCStore.startInternal(JDBCStore.java:1064)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 14 more
SEVERE: Error manager.start()
org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.session.PersistentManager[/myAppname2]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5499)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.session.JDBCStore[org.apache.catalina.session.PersistentManager[/myAppname2]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.session.PersistentManagerBase.startInternal(PersistentManagerBase.java:864)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 12 more
Caused by: java.lang.NullPointerException
at org.apache.catalina.session.JDBCStore.open(JDBCStore.java:961)
at org.apache.catalina.session.JDBCStore.getConnection(JDBCStore.java:893)
at org.apache.catalina.session.JDBCStore.startInternal(JDBCStore.java:1064)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 14 more
SEVERE: Error manager.start()
org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.session.PersistentManager[/myAppname3]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5499)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.session.JDBCStore[org.apache.catalina.session.PersistentManager[/myAppname3]]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.session.PersistentManagerBase.startInternal(PersistentManagerBase.java:864)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 12 more
Caused by: java.lang.NullPointerException
at org.apache.catalina.session.JDBCStore.open(JDBCStore.java:961)
at org.apache.catalina.session.JDBCStore.getConnection(JDBCStore.java:893)
at org.apache.catalina.session.JDBCStore.startInternal(JDBCStore.java:1064)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 14 more
最佳答案
我不推荐使用 JDBC session 持久性。甚至 Tomcat 手册也不建议这样做。它不稳定、缓慢且容易出错。
我会首先确保它在您的类路径中。之后,在调试器中设置一个断点并查看实际为 null 的内容。
关于java - TommEE session 持久存储不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36645887/
我在 rhel 机器上使用 TomEE plus 1.7.1。我已经为持久性存储设置了 jdbc 存储,以将 session 数据存储在 mysql 数据库中。 jdbc 存储在 rhel 机器上不工
我正在尝试将 apache-tomee-1.0.0 与我的 JSF 2.0 网络应用程序一起使用...但我做不到 :(。 我的问题是当我运行服务器时记录了这个错误: 30-ago-2012 18:49
我是一名优秀的程序员,十分优秀!