• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Datasources Problem-Servlet action is not available

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i'm new to struts and have been facing a problem for quite some time now have gone through almost every listing regarding this problem on this forum and others and still my problem isnt solved.

HTTP Status 404 - Servlet action is not available this is the proble

"type Status report
message Servlet action is not available
description The requested resource (Servlet action is not available) is not available."

following is the entry in my web.xml:

<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>

<init-param>
<param-name>mapping</param-name>
<param-value>org.apache.struts.action.RequestActionMapping</param-value>
</init-param>

<init-param>
<param-name>config/admin</param-name>
<param-value>/WEB-INF/admin/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>


<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern> <!-- *.do /do/*-->
</servlet-mapping>

the following is the entry in the struts-config.xml:

<data-sources>
<data-source type="org.apache.tomcat.dbcp.BasicDataSource">
<set-property
property="driverClassName"
value="com.mysql.jdbc.Driver" />
<set-property
property="url"
value="jdbc:mysql://localhost:3306/refinery" />
<set-property
property="username"
value="root" />
<set-property
property="password"
value="root" />
<set-property
property="maxActive"
value="10" />
<set-property
property="maxWait"
value="5000" />
<set-property
property="defaultAutoCommit"
value="false" />
<set-property
property="defaultReadOnly"
value="false" />
<set-property
property="key"
value="refineryDS" />
</data-source>
</data-sources>

when i comment the datasources entry in the struts-config.xml the application starts but if i enable the datasources entry above i get the mentioned error!

<global-forwards>
<forward name="welcome" path="/welcome.do"/>
<forward name="home" path="/welcome.do"/>
</global-forwards>

<action-mappings>
<action
path="/welcome"
type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/user/home.jsp"/>
</action-mappings>

so plz help me out becoz i cant seem to tackle this error! remember if i comment out the datasources entry the app starts but i need it because i have to connect to the db to make a option list. thnx for ure time....... and yes the entry in the log file is like this:

2005-12-28 20:01:20 StandardWrapperValve[action]: Servlet action is currently unavailable


thats abt it sorry for the long post but i've tried everything and i want u guys to look at it and teme wots wrong. thnx in advance!

p.s- follwoing r the files:

In Re-finery\Sources\Site\WEB-INF\ the following files r present:
struts-bean.tld, struts-html.tld, struts-logic.tld, struts-nested.tld, struts-template.tld, struts-tiles.tld, copy of struts config.xml, struts-config.xml, tiles-defs.xml, validation.xml, validator-rules.xml, web.xml

In Re-finery\Sources\Site\WEB-INF\lib\ the following files r present:
commons-beanutils.jar, commons-collections.jar, commons-dbcp.jar, commons-digester.jar, commons-fileupload.jar, commons-lang.jar, commons-logging.jar, commons-logging-api.jar, commons-pool.jar, commons-resources.jar, commons-validator.jar, mysql-connector-java-3.0.8-s...jar,struts.jar, quartz.jar

and ive made sure that all other files r in thr respective folders, i've made another app that doesnt use struts to check that it connects to the db and it does! so.......?

p.p.s- i have the following code too in my web.xml:

<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/refineryDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

???

[ December 28, 2005: Message edited by: khurram kureshi ]

[ December 28, 2005: Message edited by: khurram kureshi ]

[ December 28, 2005: Message edited by: khurram kureshi ]
[ December 28, 2005: Message edited by: khurram kureshi ]
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think your data source element is wrong ..

<data-source type="org.apache.tomcat.dbcp.BasicDataSource">

should be

<data-source type="org.apache.commons.dbcp.BasicDataSource">
 
khurram kureshi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thnx the application has started to run since i made the change but i still am stuck at something:

<jsp:useBean id="auctionviewbean" class="com.cst.auction.beans.ViewHelperBean"/>

<logic:iterate id="gender" name="auctionviewbean" property="genders" type="com.cst.auction.dataobjects.Gender" >

<html ption value="<%= SQLUtil.checkNull(gender.getGender()) %>"><%= SQLUtil.checkNull(gender.getGender()) %></html ption >

<html ption value="<%= gender.getGender() %>"><%= gender.getGender() %></html ption >

</logic:iterate>

the application stops at the above mentioned logice:iterate tag,
i have all the files and supposedly thr paths r correct too since i am trying to run this application only i dont have access to the beans and the class files as in i dont have access to the code but i can seee the directory structure and everything seems to be in place.....the error lof file has no entries! so what could be wrong with the logic iterate tag in this code? thnx for ure help and hope to hear from u soon.
 
Rob Morning
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<jsp:useBean id="auctionviewbean" class="com.cst.auction.beans.ViewHelperBean"/>

<logic:iterate id="gender" name="auctionviewbean" property="genders" type="com.cst.auction.dataobjects.Gender" >

<html ption value="<%= SQLUtil.checkNull(gender.getGender()) %>"><%= SQLUtil.checkNull(gender.getGender()) %></html ption >

<html ption value="<%= gender.getGender() %>"><%= gender.getGender() %></html ption >

</logic:iterate>

Hi again,

I looked thru you JSP .. Is it complete ? The <html ption/> tag is ONLY valid when nested in an <html:select/> tag. Are you just posting an extract of your JSP ? If you are can you post the enclosing <html:select/> so i can see better what may be happening.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am a bit confused. I guess you guys have deployed the app on Tomcat.
I am trying to deploy the app on WebSphere and this is what my Data source looks as of now ...

<data-sources>
<data-source type="org.apache.tomcat.dbcp.BasicDataSource">
<set-property
property="driverClassName"
value="org.gjt.mm.mysql.Driver" />
<set-property
property="url"
value="jdbc:mysql://localhost:3306/dev" />
<set-property
property="username"
value="dev" />
<set-property
property="password"
value="dev" />
<set-property
property="defaultAutoCommit"
value="false" />
<set-property
property="defaultReadOnly"
value="false" />
<set-property
property="key"
value="refineryDS" />
</data-source>
</data-sources>

I am not sure what the "type" attribute should be and what the key attribute should be. Also does Struts to JNDI lookups for the datasources regd in struts-config.xml ?

Thanks

Jigs
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd suggest setting up the data source through the WebSphere Admin Console, rather than through struts.

Here is a link that explains how to do it for MYSQL.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi people,,

jus check if necessary jars are added ..

check for
commons-dbcp-1.2.2.jar
commons-pool-1.4.jar
mysql-connector-java-5.1.6.bin.jar

bye
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Swarupa, welcome to javaranch.

Please check your private messages for some administrative matter.

Please Dont Wake The Zombies, this thread is 3 years old, the person won't be looking for a answer this long...
 
You guys haven't done this much, have ya? I suggest you study this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic