Re: workaround for weblogic5.1 cast exception

2001-01-29 Thread renzo estrella

I forgot to mention another step that may be needed to

 make 0.5 struts-example work with weblogic5.1:
  If you call a *.jsp page before the ActionServlet
  init() method ever gets called you will get the
  following exception:
 javax.servlet.jsp.JspException: Missing  
 resources attribute 
 org.apache.struts.action.MESSAGE at
 org.apache.struts.taglib.MessageTag.doStartTag  
 (MessageTag.java:360)
 at jsp_servlet._index._jspService(_index.java:82)

 e.g. If you use the url "http://.../struts_example/"
you're web.xml has 
 welcome-file-list
   welcome-fileindex.jsp/welcome-file
 /welcome-file-list
 This bypasses the ActionServlet  calls the *.jsp
 directly. But if ActionServlet.init() method has 
 never been called then it hasn't had a chance to  
 insert the ResourceBundle into servletContext.Now 
 when the jsp calls the MessageTag custom tag handler,
 MessageTag tries to get the ResourceBundle from
 the servletContext but it doesn't find it cause
 its not there yet.To fix this just make sure the
 ActionServlet gets called at least once.Either
 when weblogic startsup or manually e.g.
 if you've mapped the ActionServlet to be called for
 a *.do file just use a url like 
 "http://../struts_example/x.do".
 The example should now work correctly assuming you
 have done the other two steps I mentioned before:
  1) unjar the war file cause weblogic5.1 can't handle
  resource bundles in *.war.
  2) add the jps-precompile section to web.xml
 param-nameweblogic.jsp.precompile/param-name
   param-valuetrue/param-value
 /context-param
 
 This leads to a question I have:
  How do you prevent people from bypassing your 
  ActionServlet and going directly to a *.jsp
  without putting extra logic in the jsp.
  E.g. I may not want people to bookmark a jsp
  because I want security/authentication/session
  management to be done in my central servlet.
  It seems to me that I have to insert logic into
  ALL my JSPs (e.g. by calling a bean) to make sure   
  that a person has logged in or has a valid 
  session.   But I do not want to put 
  this logic in a jsp I want to handle it from a  
  central servlet. Is there a way to do this or am I 
  stuck putting the logic in each jsp ?



--- renzo estrella [EMAIL PROTECTED] wrote:
 I made the struts-example  struts-documentation
 demo
  apps work by doing the following 2 steps:
  
 1. For cast exception added this section to web.xml:
  context-param
  
 param-nameweblogic.jsp.precompile/param-name
   param-valuetrue/param-value
 /context-param
 2. For missing resource exception:
I had to unjar the *.war files to the directorie
because weblogic5.1 can't find resource in *.war 
files.  
 I'm using weblogic5.1 service pack 8
 I get a different problem for the struts-test demo:
  "weblogic.servlet.jsp.JspException: (line 25): 
   sess is not defined as bean
   at weblogic.servlet.jsp.JspLexer.jspException  
(JspLexer.java:665)"
 
 Any help with the struts-test demo app would be
 appreciated.
 
 
 
 __
 Do You Yahoo!?
 Yahoo! Auctions - Buy the things you want at great
 prices. 
 http://auctions.yahoo.com/


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.com/



workaround for weblogic5.1 cast exception

2001-01-25 Thread renzo estrella

I made the struts-example  struts-documentation demo
 apps work by doing the following 2 steps:
 
1. For cast exception added this section to web.xml:
 context-param
  param-nameweblogic.jsp.precompile/param-name
  param-valuetrue/param-value
/context-param
2. For missing resource exception:
   I had to unjar the *.war files to the directorie
   because weblogic5.1 can't find resource in *.war 
   files.  
I'm using weblogic5.1 service pack 8
I get a different problem for the struts-test demo:
 "weblogic.servlet.jsp.JspException: (line 25): 
  sess is not defined as bean
  at weblogic.servlet.jsp.JspLexer.jspException  
   (JspLexer.java:665)"

Any help with the struts-test demo app would be
appreciated.



__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.com/



Re: Weblogic 5.1 and Struts 1.0, Classpath question

2001-01-25 Thread renzo estrella

This may be caused by the cast exception problem:
  MessageTag code first gets tries to get 
  the MessageResources from 
  servletContext.getAttribute()
  It then cast the object returned to MessageResources
   this failure may be leading to your problem
   so I would suggest you try including the following
   sectoin into web.xml:

   context-param
param-nameweblogic.jsp.precompile/param-name
 param-valuetrue/param-value
   /context-param


--- Harit Nanavati [EMAIL PROTECTED] wrote:
 I have been trying the same thing. Getting the
 examples to work with
 Weblogic 5.1. I did get pass though the problem of
 runtime failur by
 un-jar-ing the classes and then included in WL
 classpath.
 I still get following exception. Can anyone please
 explain. I really want
 struts to get working in our current development.
 Thanx
 -Harit
 Exception

--
 Thu Jan 25 19:22:58 PST 2001:E
 WebAppServletContext-struts Root cause of
 ServletException
 javax.servlet.jsp.JspException: Missing resources
 attribute
 org.apache.struts.action.MESSAGE
 at

org.apache.struts.taglib.MessageTag.doStartTag(MessageTag.java:360)
 at
 jsp_servlet._index._jspService(_index.java:82)
 at

weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
 at

weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
 :124)
 at

weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
 :142)
 at

weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
 l.java:760)
 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, January 25, 2001 7:05 PM
 Subject: Weblogic 5.1 and Struts 1.0, Classpath
 question
 
 
  Well,
 
  After much frustration the past few nights I have
 finally managed to get
 the
  Struts 1.0 example application to work on WL5.1.
 The majority of my
 problems
  had to do with the classpath, which I never
 thought could be so irritating
  (Thierry Cools suggested not to put struts.jar in
 the classpath, so I did
  this and then it worked... Thanks!). My other
 problem was that I was using
  the JAXP parser from Sun, which apparently is not
 appropriate for Struts
 1.0
  and WL5.1. It was fine with 0.5, but 1.0 failed to
 load with many errors.
  Now I am using Xerces and things are much better.
 
  However, there is still a problem. If I put
 struts.jar in the WL
 classpath,
  the example application will not work. The app
 deploys and loads without
  errors, but when the first JSP is executed I get a
 "runtime failure in
  custom tag 'message'" error (see below). So the
 easy solution is just
 don't
  put struts.jar in the classpath. The problem is
 that it needs to be
 included
  because my session beans need a few classes that
 are included with
  struts.jar (probably not the ideal design, but
 this how I am doing things)
  such as ValidatingActionForm. Before I unzip
 things and try to include
 just
  what I need, I just wanted to see if anyone had
 any ideas why including
 this
  in the classpath is causing these problems. Both
 *.jars are identical, so
 I
  don't see why this makes a difference.  I am not
 sure what this error
 means
  so I don't know where to begin.
 
  Any ideas?
 
  Thanks
  -Bob
 
  BTW - has anyone written (or in process or
 writing) installation notes
  regarding Struts1.0 and WL5.1? If not, I would be
 happy to help out and do
  this.
 
 
  Thu Jan 25 21:32:15 EST 2001:E
 WebAppServletContext-strutsexample Root
  cause of ServletException
  javax.servlet.ServletException: runtime failure in
 custom tag 'message'
  at
 jsp_servlet._index._jspService(_index.java, Compiled
 Code)
  at

weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
  at
 

weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
  :106)
  at
 

weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
  :124)
  at
 

weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
  l.java:907)
  at
 

weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
  l.java:851)
  at
 

weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
  Manager.java:252)
  at
 

weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:364)
  at
 

weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:252)
  at

weblogic.kernel.ExecuteThread.run(ExecuteThread.java,
 Compiled
  Code)
 
 
 
 
 Confidential Information. This email is for intended
 recipient only.
 
 
 


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.com/



Re: Weblogic 5.1 and Struts 1.0, Classpath question

2001-01-25 Thread renzo estrella

I was using the struts 0.5 examples I did not unjar
the
 main struts.jar file, I left that in the lib 
 directory. 
 Instead I unjarred the struts-example.war file   
 modified the web.xml for the struts-example demo.
 Weblogic5.1 doesn't seem able to read ResourceBundles
 from a *.war file.
 I have not tried the 1.0 examples, if you are using
 those perhaps what I did those not apply.

--- Harit Nanavati [EMAIL PROTECTED] wrote:
 Just did that ..
 sturts.jar extracted. directory in WL classpath
 war file extrected.
 deleted starts.jar from lib directory
 added the addtional precomple lines in web.xml
 All the jsp compiles without problem.
 But same error again !!..
  Missing resources attribute
 org.apache.struts.action.MESSAGE
 
 No luck here !
 
 -Harit
 - Original Message -
 From: "renzo estrella" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, January 25, 2001 7:27 PM
 Subject: Re: Weblogic 5.1 and Struts 1.0, Classpath
 question
 
 
  This may be caused by the cast exception problem:
MessageTag code first gets tries to get
the MessageResources from
servletContext.getAttribute()
It then cast the object returned to
 MessageResources
 this failure may be leading to your problem
 so I would suggest you try including the
 following
 sectoin into web.xml:
 
 context-param
 
 param-nameweblogic.jsp.precompile/param-name
   param-valuetrue/param-value
 /context-param
 
 
  --- Harit Nanavati [EMAIL PROTECTED]
 wrote:
   I have been trying the same thing. Getting the
   examples to work with
   Weblogic 5.1. I did get pass though the problem
 of
   runtime failur by
   un-jar-ing the classes and then included in WL
   classpath.
   I still get following exception. Can anyone
 please
   explain. I really want
   struts to get working in our current
 development.
   Thanx
   -Harit
   Exception
  
 

--
   Thu Jan 25 19:22:58 PST 2001:E
   WebAppServletContext-struts Root cause of
   ServletException
   javax.servlet.jsp.JspException: Missing
 resources
   attribute
   org.apache.struts.action.MESSAGE
   at
  
 

org.apache.struts.taglib.MessageTag.doStartTag(MessageTag.java:360)
   at
   jsp_servlet._index._jspService(_index.java:82)
   at
  
 

weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
   at
  
 

weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
   :124)
   at
  
 

weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
   :142)
   at
  
 

weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
   l.java:760)
   - Original Message -
   From: [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Thursday, January 25, 2001 7:05 PM
   Subject: Weblogic 5.1 and Struts 1.0, Classpath
   question
  
  
Well,
   
After much frustration the past few nights I
 have
   finally managed to get
   the
Struts 1.0 example application to work on
 WL5.1.
   The majority of my
   problems
had to do with the classpath, which I never
   thought could be so irritating
(Thierry Cools suggested not to put struts.jar
 in
   the classpath, so I did
this and then it worked... Thanks!). My other
   problem was that I was using
the JAXP parser from Sun, which apparently is
 not
   appropriate for Struts
   1.0
and WL5.1. It was fine with 0.5, but 1.0
 failed to
   load with many errors.
Now I am using Xerces and things are much
 better.
   
However, there is still a problem. If I put
   struts.jar in the WL
   classpath,
the example application will not work. The app
   deploys and loads without
errors, but when the first JSP is executed I
 get a
   "runtime failure in
custom tag 'message'" error (see below). So
 the
   easy solution is just
   don't
put struts.jar in the classpath. The problem
 is
   that it needs to be
   included
because my session beans need a few classes
 that
   are included with
struts.jar (probably not the ideal design, but
   this how I am doing things)
such as ValidatingActionForm. Before I unzip
   things and try to include
   just
what I need, I just wanted to see if anyone
 had
   any ideas why including
   this
in the classpath is causing these problems.
 Both
   *.jars are identical, so
   I
don't see why this makes a difference.  I am
 not
   sure what this error
   means
so I don't know where to begin.
   
Any ideas?
   
Thanks
-Bob
   
BTW - has anyone written (or in process or
   writing) installation notes
regarding Struts1.0 and WL5.1? If not, I would
 be
   happy to help out and do
this.
   
   
Thu Jan 25 21:32:15 EST 2001:E
   WebAppServletContext-strutsexample Root
cause of ServletException
javax.servlet.ServletException: runtime
 failure in
   custom tag 'message'
at
   jsp_servlet._index._js