Re: Confusing error and other questions

2001-04-17 Thread Dan Miser

The exception is happening in the  tag. I would guess that you
have a malformed struts-config.xml file. Do you have any error messages in
your console or servlet log file?

You can look up data-source elements that you defined in struts-config.xml
in your Action or ActionForm by using servlet.findDataSource(null) to
retrieve the default DataSource, or servlet.findDataSource(key) to retrieve
the DataSource identified by the key attribute.
--
Dan Miser
http://www.distribucon.com

- Original Message -
From: Scott Fitzgerald
To: Struts-User
Sent: Tuesday, April 17, 2001 1:00 PM
Subject: Confusing error and other questions

I am working on an application that interacts with a database. When I try to
run the app, I get an error (500) that tells me:
javax.servlet.ServletException: Cannot find ActionMappings or
ActionFormBeans collection.
Can someone offer some insight? Also, I have added a datasource mapping in
my struts-config.xml file for my database access. When I reference this in
my bean, do I have to reference one of the attributes of the datasource
tag(ex:driverclass), or do I simply do a call to
javax.sql.DataSource dataSource = (javax.sql.DataSource)
getServletContext().getAttribute(Action.DATA_SOURCE_KEY);





RE: Confusing error and other questions

2001-04-17 Thread Iraklis Kourtidis



Hi 
Scott,
 
this 
may or may not end up answering your question: 
 
I 
remember seeing something similar when I was first trying to create my own 
Struts app. What happened was that, for some mysterious  reason, the 
struts-config.xml file was not getting read properly - although I never got a 
parse error or anything of that sort. I couldn't figure it out for my life, so I 
started off with the struts-config.xml from the struts-example app, and slowly 
added my modifications.
 
If you 
change the logging level in web.xml to show you all the messages that get shown 
when struts-config.xml gets read (I believe it's a parameter to the 
'action' servlet that looks like this:
  
detail  
2)
then 
you MIGHT notice that the messages that you normally see in the struts-example 
app do not appear when your app gets initialized (I'm talking of the messages of 
the sort:
Call 
org.apache.struts.action.ActionMapping.addForward(ActionForward[failure])Pop 
org.apache.struts.action.ActionForwardCall 
org.apache.struts.action.ActionServlet.addMapping(ActionMapping[path=/prepareNewFolderCreation)
So 
basically what I'm saying is that there's a possibility that struts-config.xml 
does not get read correctly, and you only find out about it 
later.
 
I hope 
that makes sense (and that it solves your problem.)
Iraklis
-Original Message-From: Scott Fitzgerald 
[mailto:[EMAIL PROTECTED]]Sent: Tuesday, April 17, 2001 
1:00 PMTo: Struts-UserSubject: Confusing error and other 
questions

  Hello 
  Everyone,
   
  I am working on an 
  application that interacts with a database. When I try to run the app, I get 
  an error (500) that tells me: javax.servlet.ServletException: Cannot find ActionMappings or 
  ActionFormBeans collection.
  Can someone offer some 
  insight? Also, I have added a datasource mapping in my struts-config.xml file 
  for my database access. When I reference this in my bean, do I have to 
  reference one of the attributes of the datasource tag(ex:driverclass), or 
  do I simply do a call to 
  
  javax.sql.DataSource dataSource = (javax.sql.DataSource) 
  getServletContext().getAttribute(Action.DATA_SOURCE_KEY);
  Thanks in 
  advance,
  Scott 
  Fitzgerald