Re: Tomcat 5.5: java.io.FilePermission read access denied to logging.properties

2010-09-26 Thread Rainer Jung

On 15.09.2010 11:02, Pid wrote:

On 14/09/2010 23:35, André Warnier wrote:

Pid wrote:

On 14/09/2010 16:17, Steve Ryder wrote:

java.security.AccessControlException: access denied
(java.io.FilePermission
/home/sryder/JsrSystems.info/ROOT/WEB-INF/classes/logging.properties
read)

When I first noticed this I added the java.io.FilePermission to
catalina.policy under WEB APP PERMISSIONS
grant { // Added by JSR 2010-09-13:
  permission java.io.FilePermission *, read,write;
 // Added by JSR 2010-02-08:
  permission java.util.PropertyPermission *, read,write;
 permission java.net.SocketPermission*, connect,resolve;

I still get the error at startup!

I have no logging.properties file under either the classes or under
common/classes.
Do I need to add one?  Can it be just a blank line?


Silly question: does the file have the appropriate user permissions for
Tomcat to access it?


Considering that the OP writes, just above there, that he does not have
a file there, that does indeed sound like a silly question.


Yeah.  I completely misread that.  Maybe I need specs.


The method in the stack indicates it might be a missing permission on 
the directories. The code wants to check whether the logging.properties 
in the webapp exists, and it seems it can't read the necessary directory 
information. So


- check directory permissions for 
/home/sryder/JsrSystems.info/ROOT/WEB-INF/classes/ and above


and if that doesn't suffice

- try adding read permissions for the directories to the policy file

Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 5.5: java.io.FilePermission read access denied to logging.properties

2010-09-26 Thread Steve Ryder
Thanks.  It turns out the root cause of the error was not permissions at 
all, but another error caused by a left over web.xml reference to a class 
that did not exist.  When I discovered, and removed, that statement in the 
web.xml, the logging properties error went away as well.



- Original Message - 
From: Rainer Jung rainer.j...@kippdata.de

To: users@tomcat.apache.org
Sent: Sunday, September 26, 2010 6:50 AM
Subject: Re: Tomcat 5.5: java.io.FilePermission read access denied to 
logging.properties




On 15.09.2010 11:02, Pid wrote:

On 14/09/2010 23:35, André Warnier wrote:

Pid wrote:

On 14/09/2010 16:17, Steve Ryder wrote:

java.security.AccessControlException: access denied
(java.io.FilePermission
/home/sryder/JsrSystems.info/ROOT/WEB-INF/classes/logging.properties
read)

When I first noticed this I added the java.io.FilePermission to
catalina.policy under WEB APP PERMISSIONS
grant { // Added by JSR 2010-09-13:
  permission java.io.FilePermission *, read,write;
 // Added by JSR 2010-02-08:
  permission java.util.PropertyPermission *, read,write;
 permission java.net.SocketPermission*, connect,resolve;

I still get the error at startup!

I have no logging.properties file under either the classes or under
common/classes.
Do I need to add one?  Can it be just a blank line?


Silly question: does the file have the appropriate user permissions for
Tomcat to access it?


Considering that the OP writes, just above there, that he does not have
a file there, that does indeed sound like a silly question.


Yeah.  I completely misread that.  Maybe I need specs.


The method in the stack indicates it might be a missing permission on the 
directories. The code wants to check whether the logging.properties in the 
webapp exists, and it seems it can't read the necessary directory 
information. So


- check directory permissions for 
/home/sryder/JsrSystems.info/ROOT/WEB-INF/classes/ and above


and if that doesn't suffice

- try adding read permissions for the directories to the policy file

Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 5.5: java.io.FilePermission read access denied to logging.properties

2010-09-15 Thread Pid
On 14/09/2010 23:35, André Warnier wrote:
 Pid wrote:
 On 14/09/2010 16:17, Steve Ryder wrote:
 java.security.AccessControlException: access denied
 (java.io.FilePermission
 /home/sryder/JsrSystems.info/ROOT/WEB-INF/classes/logging.properties
 read)

 When I first noticed this I added the java.io.FilePermission to
 catalina.policy under WEB APP PERMISSIONS
 grant { // Added by JSR 2010-09-13:
  permission java.io.FilePermission *, read,write;
 // Added by JSR 2010-02-08:
  permission java.util.PropertyPermission *, read,write;
 permission java.net.SocketPermission*, connect,resolve;
  
 I still get the error at startup!

 I have no logging.properties file under either the classes or under
 common/classes.
 Do I need to add one?  Can it be just a blank line?  

 Silly question: does the file have the appropriate user permissions for
 Tomcat to access it?

 Considering that the OP writes, just above there, that he does not have
 a file there, that does indeed sound like a silly question.

Yeah.  I completely misread that.  Maybe I need specs.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Tomcat 5.5: java.io.FilePermission read access denied to logging.properties

2010-09-14 Thread Steve Ryder
java.security.AccessControlException: access denied (java.io.FilePermission 
/home/sryder/JsrSystems.info/ROOT/WEB-INF/classes/logging.properties read)

When I first noticed this I added the java.io.FilePermission 
to catalina.policy under WEB APP PERMISSIONS
grant { 
// Added by JSR 2010-09-13:
 permission java.io.FilePermission *, read,write;
// Added by JSR 2010-02-08:
 permission java.util.PropertyPermission *, read,write;
permission java.net.SocketPermission*, connect,resolve;
 
I still get the error at startup!

I have no logging.properties file under either the classes or under 
common/classes.
Do I need to add one?  Can it be just a blank line?  

Full trace follows;
Sep 13, 2010 11:17:44 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5
Sep 13, 2010 11:17:44 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Sep 13, 2010 11:17:45 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Sep 13, 2010 11:17:46 PM org.apache.commons.modeler.Registry registerComponent
SEVERE: Error registering 
Catalina:type=Valve,name=StandardContextValve,path=/,host=la.jsrsystems.info
javax.management.MBeanException: Cannot instantiate ModelMBean of class 
org.apache.commons.modeler.BaseModelMBean
 at org.apache.commons.modeler.ManagedBean.createMBean(ManagedBean.java:385)
 at org.apache.commons.modeler.Registry.registerComponent(Registry.java:835)
 at 
org.apache.catalina.core.StandardPipeline.registerValve(StandardPipeline.java:302)
 at org.apache.catalina.core.StandardPipeline.start(StandardPipeline.java:234)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4140)
 at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
 at org.apache.catalina.core.ContainerBase.access$0(ContainerBase.java:744)
 at 
org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:144)
 at java.security.AccessController.doPrivileged(Native Method)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:738)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
 at 
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
 at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(StandardService.java:448)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177)
Caused by: java.security.AccessControlException: access denied 
(java.io.FilePermission 
/home/sryder/JsrSystems.info/ROOT/WEB-INF/classes/logging.properties read)
 at 
java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
 at java.security.AccessController.checkPermission(AccessController.java:427)
 at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
 at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
 at java.io.File.exists(File.java:700)
 at org.apache.naming.resources.FileDirContext.file(FileDirContext.java:828)
 at org.apache.naming.resources.FileDirContext.lookup(FileDirContext.java:211)
 at org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:294)
 at 
org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1924)
 at 
org.apache.catalina.loader.WebappClassLoader.findResource(WebappClassLoader.java:936)
 at 
org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:299)
 at 

Re: Tomcat 5.5: java.io.FilePermission read access denied to logging.properties

2010-09-14 Thread Pid
On 14/09/2010 16:17, Steve Ryder wrote:
 java.security.AccessControlException: access denied (java.io.FilePermission 
 /home/sryder/JsrSystems.info/ROOT/WEB-INF/classes/logging.properties read)
 
 When I first noticed this I added the java.io.FilePermission 
 to catalina.policy under WEB APP PERMISSIONS
 grant { 
 // Added by JSR 2010-09-13:
  permission java.io.FilePermission *, read,write;
 // Added by JSR 2010-02-08:
  permission java.util.PropertyPermission *, read,write;
 permission java.net.SocketPermission*, connect,resolve;
  
 I still get the error at startup!
 
 I have no logging.properties file under either the classes or under 
 common/classes.
 Do I need to add one?  Can it be just a blank line?  

Silly question: does the file have the appropriate user permissions for
Tomcat to access it?


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Tomcat 5.5: java.io.FilePermission read access denied to logging.properties

2010-09-14 Thread Steve Ryder
Thanks for your response, I really do need some help.  After lots of testing 
(when mail was working), I migrated my production workload to a new server. 
Yesterday, Java Mail stopped working, I suspect because I added the wrong 
permission in the wrong place.  (see #2).

I have tried removing that, but the error still happens.HELP.

1)  There is no logging.properties file under any ROOT/WEB-INF/ classes, it
is the security check that is failing.
2)   permission java.io.FilePermission *, read,write;   was in
catalina.policy.I have been experimenting all day with alternate
permission statements.  I did notice that I should not be updating
catalina.policy so have since move the permission stuff down into policy.d
folder as recommended.  What I need to know is to WHAT DO I GIVE PERMISSION?

From the stack

com.jsrsys.web.JsrSendMail.sendMail(JsrSendMail.java:507)--- my code
gets to:
javax.activation.MailcapCommandMap.init(MailcapCommandMap.java:153)
 failing here because:
java.security.AccessControlException: access denied (java.io.FilePermission
/home/sryder/JsrSystems.info/ROOT/WEB-INF/classes/logging.properties read)
java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)3)application code in JsrSendMail has 
been working for years under Tomcat5.0and was working under Tomcat 5.5  until I apparently startedaddingpermissions 
because of a bunch of mBean failures at startup.  AfterthatMail started to fail.  Removing those permissions does not 
help.The codesnippet that fails is: msg.setSentDate(new Date());if(!connectionIsOpen) result = setTransport(); 
   if(!result.equals(OK)) return result;sysout.display(JsrSendMail--line 509: 
keepOpen=+keepOpen+ connectionIsOpen=+connectionIsOpen  +result=+result  
);msg.saveChanges();  // don'tforget this this is the linethat fails.
tr.sendMessage(msg,msg.getAllRecipients());here is the whole stack from my call to the 
securityfailurejava.security.AccessControlException: access 
denied(java.io.FilePermission/home/sryder/JsrSystems.info/ROOT/WEB-IN
F/classes/logging.properties 
read)java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)java.security.AccessController.checkPermission(AccessController.java:427)java.lang.SecurityManager.checkPermission(SecurityManager.java:532)java.lang.SecurityManager.checkRead(SecurityManager.java:871)java.io.File.exists(File.java:700)org.apache.naming.resources.FileDirContext.file(FileDirContext.java:828)org.apache.naming.resources.FileDirContext.lookup(FileDirContext.java:211)org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:294)org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1924)org.apache.catalina.loader.WebappClassLoader.findResource(WebappClassLoader.java:936)org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:299)org.apache.juli.ClassLoaderLogManager$2.run(ClassLoaderLogManager.java:273)java.security.AccessController.doPrivileged(Native
 Method)org.apache.juli.Cl
assLoaderLogManager.getClassLoaderInfo(ClassLoaderLogManager.java:270)org.apache.juli.ClassLoaderLogManager.getLogger(ClassLoaderLogManager.java:175)
 
java.util.logging.Logger.getLogger(Logger.java:255)com.sun.activation.registries.LogSupport.clinit(LogSupport.java:60)javax.activation.MailcapCommandMap.init(MailcapCommandMap.java:153)failing
 
herejavax.activation.CommandMap.getDefaultCommandMap(CommandMap.java:74)javax.activation.DataHandler.getCommandMap(DataHandler.java:167)javax.activation.DataHandler.getDataContentHandler(DataHandler.java:625)javax.activation.DataHandler.writeTo(DataHandler.java:329)javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:264)javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1301)javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1008)javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:415)javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1287)javax.mail.internet.MimeM
essage.updateHeaders(MimeMessage.java:2072)javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2040)com.jsrsys.web.JsrSendMail.sendMail(JsrSendMail.java:507)--- mycode- Original Message 
-From: Pid p...@pidster.comTo: TomcatUsers List users@tomcat.apache.orgSent: Tuesday, September 14, 2010 3:33PMSubject: Re: Tomcat 5.5: java.io.FilePermission read 
access deniedtologging.propertiesOn 14/09/2010 16:17, Steve Ryder wrote:java.security.AccessControlException: 
accessdenied(java.io.FilePermission/home/sryder/JsrSystems.info/ROOT/WEB-INF/classes/logging.properties read) When I first noticed this I added thejava.io.FilePermission to catalina.policy under WEB 
APP PERMISSIONS grant{ // Added by JSR 2010-09-13:  permission java.io.FilePermission *,read,write; // Added by JSR 2010-02-08:  
permissionjava.util.PropertyPermission *, read,write;  

Re: Tomcat 5.5: java.io.FilePermission read access denied to logging.properties

2010-09-14 Thread Pid
On 14/09/2010 22:01, Steve Ryder wrote:
 Thanks for your response, I really do need some help.  After lots of
 testing (when mail was working), I migrated my production workload to a
 new server. Yesterday, Java Mail stopped working, I suspect because I
 added the wrong permission in the wrong place.  (see #2).
 I have tried removing that, but the error still happens.HELP.

Are you sure you've reverted all of the changes?

If not, can you?  Better to work up again, one at a time...

You could grab a fresh Tomcat and copy the file from there if yours is
mangled badly.

 1)  There is no logging.properties file under any ROOT/WEB-INF/ classes, it
 is the security check that is failing.


 2)   permission java.io.FilePermission *, read,write;   was in
 catalina.policy.I have been experimenting all day with alternate
 permission statements.  I did notice that I should not be updating
 catalina.policy so have since move the permission stuff down into policy.d
 folder as recommended.  

Recommended where?

What I need to know is to WHAT DO I GIVE
 PERMISSION?

No need to shout.


p

 From the stack
 com.jsrsys.web.JsrSendMail.sendMail(JsrSendMail.java:507)--- my code
 gets to:
 javax.activation.MailcapCommandMap.init(MailcapCommandMap.java:153)
  failing here because:
 java.security.AccessControlException: access denied (java.io.FilePermission
 /home/sryder/JsrSystems.info/ROOT/WEB-INF/classes/logging.properties read)
 java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)3)application
 code in JsrSendMail has been working for years under Tomcat5.0and was
 working under Tomcat 5.5  until I apparently startedaddingpermissions
 because of a bunch of mBean failures at startup.  AfterthatMail started
 to fail.  Removing those permissions does not help.The codesnippet that
 fails is: msg.setSentDate(new Date());if(!connectionIsOpen)
 result = setTransport();if(!result.equals(OK)) return
 result;sysout.display(JsrSendMail--line 509: keepOpen=+keepOpen+
 connectionIsOpen=+connectionIsOpen 
 +result=+result  );msg.saveChanges();  //
 don'tforget this this is the linethat fails.   
 tr.sendMessage(msg,msg.getAllRecipients());here is the whole stack from
 my call to the securityfailurejava.security.AccessControlException:
 access
 denied(java.io.FilePermission/home/sryder/JsrSystems.info/ROOT/WEB-IN
 F/classes/logging.properties
 read)java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)java.security.AccessController.checkPermission(AccessController.java:427)java.lang.SecurityManager.checkPermission(SecurityManager.java:532)java.lang.SecurityManager.checkRead(SecurityManager.java:871)java.io.File.exists(File.java:700)org.apache.naming.resources.FileDirContext.file(FileDirContext.java:828)org.apache.naming.resources.FileDirContext.lookup(FileDirContext.java:211)org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:294)org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1924)org.apache.catalina.loader.WebappClassLoader.findResource(WebappClassLoader.java:936)org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:299)org.apache.juli.ClassLoaderLogManager$2.run(ClassLoaderLogManager.java:273)java.security.AccessController.doPrivileged(Native
 Method)org.apache.juli.Cl
 assLoaderLogManager.getClassLoaderInfo(ClassLoaderLogManager.java:270)org.apache.juli.ClassLoaderLogManager.getLogger(ClassLoaderLogManager.java:175)
 java.util.logging.Logger.getLogger(Logger.java:255)com.sun.activation.registries.LogSupport.clinit(LogSupport.java:60)javax.activation.MailcapCommandMap.init(MailcapCommandMap.java:153)failing
 herejavax.activation.CommandMap.getDefaultCommandMap(CommandMap.java:74)javax.activation.DataHandler.getCommandMap(DataHandler.java:167)javax.activation.DataHandler.getDataContentHandler(DataHandler.java:625)javax.activation.DataHandler.writeTo(DataHandler.java:329)javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:264)javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1301)javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1008)javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:415)javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1287)javax.mail.internet.MimeM
 
 essage.updateHeaders(MimeMessage.java:2072)javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2040)com.jsrsys.web.JsrSendMail.sendMail(JsrSendMail.java:507)

 --- mycode- Original Message -From: Pid p...@pidster.comTo:
 TomcatUsers List users@tomcat.apache.orgSent: Tuesday, September 14,
 2010 3:33PMSubject: Re: Tomcat 5.5: java.io.FilePermission read access
 deniedtologging.propertiesOn 14/09/2010 16:17, Steve Ryder
 wrote:java.security.AccessControlException:
 

Re: Tomcat 5.5: java.io.FilePermission read access denied to logging.properties

2010-09-14 Thread André Warnier

Pid wrote:

On 14/09/2010 16:17, Steve Ryder wrote:

java.security.AccessControlException: access denied (java.io.FilePermission 
/home/sryder/JsrSystems.info/ROOT/WEB-INF/classes/logging.properties read)

When I first noticed this I added the java.io.FilePermission 
to catalina.policy under WEB APP PERMISSIONS
grant { 
// Added by JSR 2010-09-13:

 permission java.io.FilePermission *, read,write;
// Added by JSR 2010-02-08:
 permission java.util.PropertyPermission *, read,write;
permission java.net.SocketPermission*, connect,resolve;
 
I still get the error at startup!


I have no logging.properties file under either the classes or under 
common/classes.
Do I need to add one?  Can it be just a blank line?  


Silly question: does the file have the appropriate user permissions for
Tomcat to access it?

Considering that the OP writes, just above there, that he does not have a file there, that 
does indeed sound like a silly question.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org