tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Huang" <danih...@cisco.com>
Subject RE: JNDI Datasource receives AccessControlException with Security Manager
Date Mon, 05 Apr 2004 05:15:10 GMT
Debugging with Security manager can be challenging. You probably want to
take a look at Tomcat Security Manager HowTo.

Regards,
Daniel

-----Original Message-----
From: Juergen Weber [mailto:weberjn@yahoo.com]
Sent: Saturday, April 03, 2004 2:55 AM
To: tomcat-user@jakarta.apache.org
Subject: JNDI Datasource receives AccessControlException with Security
Manager

I got database connection up and running as described
in tomcat-docs/jndi-datasource-examples-howto.html

But it does not run with the Security Manager enabled.

The mysql driver and commons-dbcp are in common/lib,
so

grant codeBase "file:${catalina.home}/common/-" {
        permission java.security.AllPermission;
};

should trigger.

What permissions are needed, too?

BTW, I test with Windows.

Thanks,
J|rgen



org.apache.commons.dbcp.SQLNestedException: Cannot
create PoolableConnectionFact
ory, cause:
java.sql.SQLException: Server connection failure
during transaction. Due to unde
rlying exception:
'java.security.AccessControlException: access denied
(java.net
.SocketPermission 127.0.0.1:3306 connect,resolve)'.
Attempted reconnect 3 times. Giving up.
        at
com.mysql.jdbc.Connection.createNewIO(Connection.java:1811)
        at
com.mysql.jdbc.Connection.<init>(Connection.java:432)
        at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
:400)
        at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(Driv
erConnectionFactory.java:82)
        at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(Poolable
ConnectionFactory.java:300)
        at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas
icDataSource.java:838)
        at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:821)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:518)
        at
de.jwi.jgallery.db.DBManager.getAndIncFolderCounter(DBManager.java:47
)
        at
de.jwi.jgallery.Folder.getCounter(Folder.java:975)
        at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at
java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.commons.el.ArraySuffix.evaluate(ArraySuffix.java:314)
        at
org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
        at
org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEval
uatorImpl.java:263)
        at
org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEval
uatorImpl.java:190)
        at
org.apache.jasper.runtime.PageContextImpl$13.run(PageContextImpl.java
:926)
        at
java.security.AccessController.doPrivileged(Native
Method)
        at
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageCon
textImpl.java:922)
        at
org.apache.jsp.skins.Standard.slide_jsp._jspx_meth_jg_if_6(slide_jsp.
java:846)
        at
org.apache.jsp.skins.Standard.slide_jsp._jspService(slide_jsp.java:17
7)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:311)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
01)
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at
java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:284
)
        at
java.security.AccessController.doPrivileged(Native
Method)
        at
javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
        at
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:3
06)
        at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.
java:200)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:278)
        at
org.apache.catalina.core.ApplicationFilterChain.access$000(Applicatio
nFilterChain.java:97)
        at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilt
erChain.java:187)
        at
java.security.AccessController.doPrivileged(Native
Method)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:183)
        at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
atcher.java:750)
        at
org.apache.catalina.core.ApplicationDispatcher.processRequest(Applica
tionDispatcher.java:510)
        at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD
ispatcher.java:445)
        at
org.apache.catalina.core.ApplicationDispatcher.access$000(Application
Dispatcher.java:118)
        at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(
ApplicationDispatcher.java:133)
        at
java.security.AccessController.doPrivileged(Native
Method)
        at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis
patcher.java:351)
        at
de.jwi.jgallery.servlets.Controller.doGet(Controller.java:470)
        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at
java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:284
)
        at
java.security.AccessController.doPrivileged(Native
Method)
        at
javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
        at
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:3
06)
        at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.
java:200)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:278)
        at
org.apache.catalina.core.ApplicationFilterChain.access$000(Applicatio
nFilterChain.java:97)
        at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilt
erChain.java:187)
        at
java.security.AccessController.doPrivileged(Native
Method)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:183)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:257)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(Standard
ContextValve.java:245)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:199)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:184)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:164)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:149)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:156)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)

        at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:20
6)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:833)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:732)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:619)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:688)
        at java.lang.Thread.run(Thread.java:534)


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
http://promotions.yahoo.com/design_giveaway/

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message