[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4j-user
Subject:    RE: SMTPAppender problem
From:       "Rakesh Patel" <Rakesh.Patel () sharepeople ! com>
Date:       2005-10-31 11:51:49
Message-ID: F6E2F121756BA94CB99212D650D46AC382B802 () aesp6003 ! sharepeople ! co ! uk
[Download RAW message or body]

Hi,

Still unable to access the exception in my JSP to then call
logger.error. Here's my JSP:

<%@ page import="org.apache.log4j.Logger" %>
<%@ page isErrorPage="true" %>
<%
final Logger logger = Logger.getLogger("Error.jsp");
logger.error("There was an error");
%>
<html>
<head>
<title>Error Page</title>
</head>
<body>


<p>The application encountered an unexpected error.</p>
<p >You can return to the main menu <a
href="secure/main.htm">here</a>.</p>

<br/>
<!-- ${exception.message}</b> -->

    
    An unexcepted error occurred. The name of the exception is:
    
    <%= exception %>
<font color="red">
<%= exception.toString() %><br>
</font>

</body>
</html>

Seeing the exception in HTML works but not in the java code section.

Any ideas?

Rakesh
-----Original Message-----
From: Rakesh Patel 
Sent: 26 October 2005 13:40
To: Log4J Users List
Subject: RE: SMTPAppender problem


Does anyone know how to access the error in a jSP?

I tried this but it throws a ThreadDeath exception:

<%@ page import="org.apache.log4j.Logger" %>
<%
final Logger logger = Logger.getLogger("Error.jsp"); logger.error("There
was an error:",exception); %>

I also tried logger.error("There was an error:"+exception.toString());

Thanks

Rakesh

-----Original Message-----
From: Mangano, Jonathan [mailto:Jonathan.Mangano@team.telstra.com] 
Sent: 26 October 2005 10:38
To: Log4J Users List
Subject: RE: SMTPAppender problem


This is the Sun Appserver 8 security manager blocking access to your
properties files (most likely log4j.properties)

You will need to update your server.policy file in the server instance
config directory with something like:

grant {
	permission java.util.PropertyPermission "*", "read,write";
};

Depending on your needs this may not be suitable as it allows all code
to read and write to property files and hence you may want to tighten up
the security. Read
http://java.sun.com/j2se/1.4.2/docs/guide/security/PolicyFiles.html#File
Syntax for more information on how to do this.

Hope this helps

Jonathan

-----Original Message-----
From: Rakesh Patel [mailto:Rakesh.Patel@sharepeople.com] 
Sent: Wednesday, 26 October 2005 5:21 PM
To: Log4J Users List
Subject: SMTPAppender problem

Hi,

I have configured the SMTPAppender but get an error during app start up:

[#|2005-10-26T10:13:29.046+0100|WARNING|sun-appserver-pe8.1_01|javax.ent
erprise.system.stream.err|_ThreadID=12;|log4j:ERROR Could not create an
Appender. Reported error follows.|#]

[#|2005-10-26T10:13:29.125+0100|WARNING|sun-appserver-pe8.1_01|javax.ent
erprise.system.stream.err|_ThreadID=12;|
java.security.AccessControlException: access denied
(java.util.PropertyPermission * read,write)
        at
java.security.AccessControlContext.checkPermission(AccessControlContext.
java:269)
        at
java.security.AccessController.checkPermission(AccessController.java:401
)
        at
java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
        at
java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:124
3)
        at java.lang.System.getProperties(System.java:501)
        at org.apache.log4j.net.SMTPAppender.activateOptions(Unknown
Source)
        at
org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247)
        at
org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:
227)
        at
org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.
java:157)
        at
org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigur
ator.java:170)
        at
org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMCon
figurator.java:432)
        at
org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:401)
        at
org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:800)
        at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:68
3)
        at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:63
3)
        at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:61
9)
        at
org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConver
ter.java:460)
        at org.apache.log4j.LogManager.<clinit>(LogManager.java:113)
        at org.apache.log4j.Logger.getLogger(Logger.java:94)
        at
org.apache.commons.logging.impl.Log4jFactory.getInstance(Log4jFactory.ja
va:114)
        at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImp
l.java:285)
        at
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:409)
        at
org.apache.commons.digester.Digester.<init>(Digester.java:346)
        at
org.apache.catalina.startup.DigesterFactory.newDigester(DigesterFactory.
java:79)
        at
org.apache.catalina.startup.TldConfig.createTldDigester(TldConfig.java:4
39)
        at
org.apache.catalina.startup.TldConfig.tldScanStream(TldConfig.java:538)
        at
org.apache.catalina.startup.TldConfig.tldScanTld(TldConfig.java:577)
        at
org.apache.catalina.startup.TldConfig.execute(TldConfig.java:332)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4458
)
        at com.sun.enterprise.web.WebModule.start(WebModule.java:241)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja
va:827)
        at
org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:125
)
        at
org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerB
ase.java:147)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:809)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
        at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1279
)
        at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1006
)
        at
com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(We
bModuleDeployEventListener.java:160)
        at
com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(We
bModuleDeployEventListener.java:238)
        at
com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployE
ventListener(AdminEventMulticaster.java:918)
        at
com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployE
vent(AdminEventMulticaster.java:905)
        at
com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminE
ventMulticaster.java:427)
        at
com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(Admi
nEventMulticaster.java:139)
        at
com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multic
astEvent(DeploymentNotificationHelper.java:288)
        at
com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEv
ent(DeploymentServiceUtils.java:155)
        at
com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEv
ent(ServerDeploymentTarget.java:258)
        at
com.sun.enterprise.deployment.phasing.StartPhase.runPhase(StartPhase.jav
a:87)
        at
com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(Deplo
ymentPhase.java:71)
        at
com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(
PEDeploymentService.java:633)
        at
com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploy
mentService.java:361)
        at
com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploy
mentService.java:396)
        at
com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(Applicatio
nsConfigMBean.java:702)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.j
ava:302)
        at
com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.j
ava:357)
        at
com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.j
ava:213)
        at
com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
        at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBea
nServerInterceptor.java:815)
        at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
        at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:54
)
        at $Proxy1.invoke(Unknown Source)
        at
com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(Sunone
Interceptor.java:272)
        at
com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(Inv
okeCaller.java:38)
        at
com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.han
dle(MBeanServerRequestHandler.java:92)
        at
com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorSer
vlet.processRequest(RemoteJmxConnectorServlet.java:69)
        at
com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorSer
vlet.doPost(RemoteJmxConnectorServlet.java:94)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
        at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
        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:282)
        at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.jav
a:165)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:257)
        at
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFi
lterChain.java:55)
        at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterC
hain.java:161)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:157)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:263)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
51)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCon
textValve.java:225)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:173)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
51)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> 161)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
51)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngine|#]

Any idea what to do?

Thanks

Rakesh


American Express Investments and American Express Independent Financial
Advisers are marketing names for American Express Financial Services
Europe Limited, a separate corporation within the American Express group
of companies.  American Express Financial Services Europe Limited is
authorised and regulated by, and is entered into the register (No.
190853 www.fsa.gov.uk/register/) of, the Financial Services Authority
and a member of the London Stock Exchange. Registered in England No.
3614902. Registered address: 230 Blackfriars Road, London SE1 8NW. Vat
No. 740 4143 68. 

The information in this email and any attachments is confidential and
intended solely for the attention and use of the named addressee(s). It
may be subject to legal, professional or other privilege and further
distribution of it is strictly prohibited without our authority.  If you
are not the intended recipient, you are not authorised to and must not
disclose, copy, distribute, or retain this message or any part of it,
and should notify us immediately.


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



American Express Investments and American Express Independent Financial
Advisers are marketing names for American Express Financial Services
Europe Limited, a separate corporation within the American Express group
of companies.  American Express Financial Services Europe Limited is
authorised and regulated by, and is entered into the register (No.
190853 www.fsa.gov.uk/register/) of, the Financial Services Authority
and a member of the London Stock Exchange. Registered in England No.
3614902. Registered address: 230 Blackfriars Road, London SE1 8NW. Vat
No. 740 4143 68. 

The information in this email and any attachments is confidential and
intended solely for the attention and use of the named addressee(s). It
may be subject to legal, professional or other privilege and further
distribution of it is strictly prohibited without our authority.  If you
are not the intended recipient, you are not authorised to and must not
disclose, copy, distribute, or retain this message or any part of it,
and should notify us immediately.


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



American Express Investments and American Express Independent Financial Advisers are \
marketing names for American Express Financial Services Europe Limited, a separate \
corporation within the American Express group of companies.  American Express \
Financial Services Europe Limited is authorised and regulated by, and is entered into \
the register (No. 190853 www.fsa.gov.uk/register/) of, the Financial Services \
Authority and a member of the London Stock Exchange. Registered in England No. \
3614902. Registered address: 230 Blackfriars Road, London SE1 8NW. Vat No. 740 4143 \
68. 

The information in this email and any attachments is confidential and intended solely \
for the attention and use of the named addressee(s). It may be subject to legal, \
professional or other privilege and further distribution of it is strictly prohibited \
without our authority.  If you are not the intended recipient, you are not authorised \
to and must not disclose, copy, distribute, or retain this message or any part of it, \
and should notify us immediately.


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic