You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Canos <da...@gmail.com> on 2009/09/06 11:02:44 UTC

Re: Struts2 is not outputting to the Glassfish server.log

Hi Tikiidid you solve the problem?


2009/8/27 David Canos <da...@gmail.com>

> same to me when working with EAR projects in Glassfish v2 and v2.1.
>
> try config Exception interceptor, anyway I could not resolved the problem
> this way,
> I turn struts.debug to on, and then i'm able to see the exception msg in a
> configured exception.jsp but never in the server.log!
>
> I hope it help you!
> good luck and if you find a fix please put it in the list :)
>
> 2009/8/25 Tikii <th...@hardlovecowboys.com>
>
>
>> I am currently building a web application using struts2 and deploying it
>> to a
>> Glassfish v2.1 application server. I have an issue, in that when a struts2
>> action results in an Exception, no stack trace is being output to the
>> server.log, in fact nothing is reported in the log at all. This makes
>> debugging very tedious.
>>
>> I am including several parts of my code in the hope that someone can
>> assist
>> me with turning this error logging on. This code is set up to deliberately
>> cause a NullPointerException, which I would expect to be logged with a
>> stack
>> trace to the server.log.
>>
>> Please note that this issue occurs regardless of struts.devMode being true
>> or false
>>
>> struts.xml package
>> <package name="Game-web" extends="struts-default">
>>  <action name="GameSearch_search" class="app.GameSearchAction"
>> method="search">
>>    <result>game_search.jsp</result>
>>  </action>
>> </package>
>>
>> GamSearchAction search method (I have deliberately set this to cause a
>> NullPointerException)
>> public String search() {
>>  Date date = null;
>>  date.equals(null);
>>  return Action.SUCCESS;
>> }
>>
>> log4j.properties
>> # Set root logger level to DEBUG and its only appender to A1.
>> log4j.rootLogger=INFO, A1
>>
>> # A1 is set to be a ConsoleAppender.
>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>
>> # A1 uses PatternLayout.
>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>> log4j.appender.A1.layout.ConversionPattern=%d %-5p %c.%M:%L - %m%n
>>
>> # try setting struts logging to INFO
>> log4j.logger.org.apache.struts2=INFO
>> log4j.logger.com.opensymphony.xwork2=INFO
>>
>> Result
>> The result of going to
>> http://localhost:8080/Game-web/GameSearch_search.action is the default
>> glassfish 500 error server page.
>>
>> HTTP Status 500 -
>>
>> type Exception report
>>
>> message
>>
>> descriptionThe server encountered an internal error () that prevented it
>> from fulfilling this request.
>>
>> exception
>>
>> java.lang.NullPointerException
>>
>> note The full stack traces of the exception and its root causes are
>> available in the Sun GlassFish Enterprise Server v2.1 logs.
>> Sun GlassFish Enterprise Server v2.1
>> --
>> View this message in context:
>> http://www.nabble.com/Struts2-is-not-outputting-to-the-Glassfish-server.log-tp25131136p25131136.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>

RE: Struts2 is not outputting to the Glassfish server.log

Posted by Martin Gainty <mg...@hotmail.com>.
change ConsoleAppender to RollingFileAppender e.g.
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log

log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
ceki gulcu has a nice tutorial located at
http://logging.apache.org/log4j/1.2/manual.html

Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Sun, 6 Sep 2009 11:02:44 +0200
> Subject: Re: Struts2 is not outputting to the Glassfish server.log
> From: davidcanos@gmail.com
> To: user@struts.apache.org
> 
> Hi Tikiidid you solve the problem?
> 
> 
> 2009/8/27 David Canos <da...@gmail.com>
> 
> > same to me when working with EAR projects in Glassfish v2 and v2.1.
> >
> > try config Exception interceptor, anyway I could not resolved the problem
> > this way,
> > I turn struts.debug to on, and then i'm able to see the exception msg in a
> > configured exception.jsp but never in the server.log!
> >
> > I hope it help you!
> > good luck and if you find a fix please put it in the list :)
> >
> > 2009/8/25 Tikii <th...@hardlovecowboys.com>
> >
> >
> >> I am currently building a web application using struts2 and deploying it
> >> to a
> >> Glassfish v2.1 application server. I have an issue, in that when a struts2
> >> action results in an Exception, no stack trace is being output to the
> >> server.log, in fact nothing is reported in the log at all. This makes
> >> debugging very tedious.
> >>
> >> I am including several parts of my code in the hope that someone can
> >> assist
> >> me with turning this error logging on. This code is set up to deliberately
> >> cause a NullPointerException, which I would expect to be logged with a
> >> stack
> >> trace to the server.log.
> >>
> >> Please note that this issue occurs regardless of struts.devMode being true
> >> or false
> >>
> >> struts.xml package
> >> <package name="Game-web" extends="struts-default">
> >>  <action name="GameSearch_search" class="app.GameSearchAction"
> >> method="search">
> >>    <result>game_search.jsp</result>
> >>  </action>
> >> </package>
> >>
> >> GamSearchAction search method (I have deliberately set this to cause a
> >> NullPointerException)
> >> public String search() {
> >>  Date date = null;
> >>  date.equals(null);
> >>  return Action.SUCCESS;
> >> }
> >>
> >> log4j.properties
> >> # Set root logger level to DEBUG and its only appender to A1.
> >> log4j.rootLogger=INFO, A1
> >>
> >> # A1 is set to be a ConsoleAppender.
> >> log4j.appender.A1=org.apache.log4j.ConsoleAppender
> >>
> >> # A1 uses PatternLayout.
> >> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> >> log4j.appender.A1.layout.ConversionPattern=%d %-5p %c.%M:%L - %m%n
> >>
> >> # try setting struts logging to INFO
> >> log4j.logger.org.apache.struts2=INFO
> >> log4j.logger.com.opensymphony.xwork2=INFO
> >>
> >> Result
> >> The result of going to
> >> http://localhost:8080/Game-web/GameSearch_search.action is the default
> >> glassfish 500 error server page.
> >>
> >> HTTP Status 500 -
> >>
> >> type Exception report
> >>
> >> message
> >>
> >> descriptionThe server encountered an internal error () that prevented it
> >> from fulfilling this request.
> >>
> >> exception
> >>
> >> java.lang.NullPointerException
> >>
> >> note The full stack traces of the exception and its root causes are
> >> available in the Sun GlassFish Enterprise Server v2.1 logs.
> >> Sun GlassFish Enterprise Server v2.1
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Struts2-is-not-outputting-to-the-Glassfish-server.log-tp25131136p25131136.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >

_________________________________________________________________
Hotmail® is up to 70% faster. Now good news travels really fast. 
http://windowslive.com/online/hotmail?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_faster:082009

RE: Struts2 is not outputting to the Glassfish server.log

Posted by Martin Gainty <mg...@hotmail.com>.
 
it would be helpful to find what a sun employee says on how to use RollingFileAppender for TC and GLassfish

http://blogs.sun.com/terrygardner/entry/rollingfileappender_file_location

ping terry or myself offline ..please dont ping struts user list for this for obvious reasons
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Sun, 6 Sep 2009 11:02:44 +0200
> Subject: Re: Struts2 is not outputting to the Glassfish server.log
> From: davidcanos@gmail.com
> To: user@struts.apache.org
> 
> Hi Tikiidid you solve the problem?
> 
> 
> 2009/8/27 David Canos <da...@gmail.com>
> 
> > same to me when working with EAR projects in Glassfish v2 and v2.1.
> >
> > try config Exception interceptor, anyway I could not resolved the problem
> > this way,
> > I turn struts.debug to on, and then i'm able to see the exception msg in a
> > configured exception.jsp but never in the server.log!
> >
> > I hope it help you!
> > good luck and if you find a fix please put it in the list :)
> >
> > 2009/8/25 Tikii <th...@hardlovecowboys.com>
> >
> >
> >> I am currently building a web application using struts2 and deploying it
> >> to a
> >> Glassfish v2.1 application server. I have an issue, in that when a struts2
> >> action results in an Exception, no stack trace is being output to the
> >> server.log, in fact nothing is reported in the log at all. This makes
> >> debugging very tedious.
> >>
> >> I am including several parts of my code in the hope that someone can
> >> assist
> >> me with turning this error logging on. This code is set up to deliberately
> >> cause a NullPointerException, which I would expect to be logged with a
> >> stack
> >> trace to the server.log.
> >>
> >> Please note that this issue occurs regardless of struts.devMode being true
> >> or false
> >>
> >> struts.xml package
> >> <package name="Game-web" extends="struts-default">
> >>  <action name="GameSearch_search" class="app.GameSearchAction"
> >> method="search">
> >>    <result>game_search.jsp</result>
> >>  </action>
> >> </package>
> >>
> >> GamSearchAction search method (I have deliberately set this to cause a
> >> NullPointerException)
> >> public String search() {
> >>  Date date = null;
> >>  date.equals(null);
> >>  return Action.SUCCESS;
> >> }
> >>
> >> log4j.properties
> >> # Set root logger level to DEBUG and its only appender to A1.
> >> log4j.rootLogger=INFO, A1
> >>
> >> # A1 is set to be a ConsoleAppender.
> >> log4j.appender.A1=org.apache.log4j.ConsoleAppender
> >>
> >> # A1 uses PatternLayout.
> >> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> >> log4j.appender.A1.layout.ConversionPattern=%d %-5p %c.%M:%L - %m%n
> >>
> >> # try setting struts logging to INFO
> >> log4j.logger.org.apache.struts2=INFO
> >> log4j.logger.com.opensymphony.xwork2=INFO
> >>
> >> Result
> >> The result of going to
> >> http://localhost:8080/Game-web/GameSearch_search.action is the default
> >> glassfish 500 error server page.
> >>
> >> HTTP Status 500 -
> >>
> >> type Exception report
> >>
> >> message
> >>
> >> descriptionThe server encountered an internal error () that prevented it
> >> from fulfilling this request.
> >>
> >> exception
> >>
> >> java.lang.NullPointerException
> >>
> >> note The full stack traces of the exception and its root causes are
> >> available in the Sun GlassFish Enterprise Server v2.1 logs.
> >> Sun GlassFish Enterprise Server v2.1
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Struts2-is-not-outputting-to-the-Glassfish-server.log-tp25131136p25131136.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >

_________________________________________________________________
With Windows Live, you can organize, edit, and share your photos.
http://www.windowslive.com/Desktop/PhotoGallery