开发者

Placing MySQL connector JAR in WEB-INF/lib of my WAR instead of in tomcat lib making j_security_check fail

开发者 https://www.devze.com 2023-02-19 22:38 出处:网络
I want my webapp to use the MySQL connector JAR present in web-inf/lib . But j-security_check dosen\'t work when i do it. When I place the jar in tomcat lib开发者_开发问答 folder it works fine. But I

I want my webapp to use the MySQL connector JAR present in web-inf/lib . But j-security_check dosen't work when i do it. When I place the jar in tomcat lib开发者_开发问答 folder it works fine. But I have purchased a shared tomcat hosting and they wouldn't let me put a jar in tomcat lib. Is it possible to use j_security_check and connection pool without the jar in tomcat lib.

Following is my META-INF/context.xml

<Resource name="jdbc/myDB" auth="Container" type="javax.sql.DataSource"
          maxActive="600" maxIdle="30" maxWait="20000" removeAbandoned="true" logAbandoned="false"
          username="usr_1" password="password1" driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/daname?autoReconnect=true"/>


<Realm name="myRealm" className="org.apache.catalina.realm.DataSourceRealm" debug="99"
       dataSourceName="jdbc/myDB" localDataSource="true"
       userTable="user" userNameCol="username" userCredCol="pass"
       userRoleTable="user_roles" roleNameCol="role_name"/>


you can, for example it is possible to configure Hibernate to create and manage its own connection pool, but if you want the container to manage resources (including database connections) then it needs to be able to see the class and hence needs the classes in the common folder and not attached to a single web application

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号