Struts 1.1 Servlet action is currently unavailable

Struts 1.1 Servlet action is currently unavailable - Java - Programmation

Marsh Posté le 19-05-2004 à 15:52:35    

J'essaye de passer aux struts 1.1 à partir d'une appli 1.0.2.
 
Je suis sous jBuilder 8 / Tomcat 4.0.
 
Et je rencontre ce problème :
 

Code :
  1. java.sql.SQLException: open: java.lang.NullPointerException
  2. at org.apache.struts.legacy.GenericDataSource.open(GenericDataSource.java:735)
  3. at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1085)
  4. at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
  5. at javax.servlet.GenericServlet.init(GenericServlet.java:256)
  6. at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:918)
  7. at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
  8. at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3279)
  9. at org.apache.catalina.core.StandardContext.start(StandardContext.java:3421)
  10. at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
  11. at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
  12. at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
  13. at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
  14. at org.apache.catalina.core.StandardService.start(StandardService.java:388)
  15. at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
  16. at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
  17. at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
  18. at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
  19. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  20. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  21. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  22. at java.lang.reflect.Method.invoke(Method.java:324)
  23. at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
  24. StandardWrapper[/AppStruts11:action]: Marking servlet action as unavailable
  25. StandardContext[/AppStruts11]: Servlet /AppStruts11 threw load() exception: javax.servlet.UnavailableException: Initializing application data source org.apache.struts.action.DATA_SOURCE
  26. javax.servlet.UnavailableException: Initializing application data source org.apache.struts.action.DATA_SOURCE
  27. at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1091)
  28. at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
  29. at javax.servlet.GenericServlet.init(GenericServlet.java:256)
  30. at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:918)
  31. at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
  32. at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3279)
  33. at org.apache.catalina.core.StandardContext.start(StandardContext.java:3421)
  34. at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
  35. at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
  36. at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
  37. at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
  38. at org.apache.catalina.core.StandardService.start(StandardService.java:388)
  39. at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
  40. at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
  41. at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
  42. at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
  43. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  44. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  45. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  46. at java.lang.reflect.Method.invoke(Method.java:324)
  47. at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)


 
Struts-config.xml :
 

Code :
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
  3. <struts-config>
  4.   <!-- ========== Paramètres Base de données =========================== -->
  5.   <data-sources>
  6.     <data-source url="jdbc:oracle:thin:@localhost:1521:TOTO" maxCount="25" user="toto" autoCommit="true" minCount="2" driverClass="oracle.jdbc.driver.OracleDriver" password="toto" description="DATA BASE CONNEXION" />
  7.   </data-sources>
  8.   <!-- ========== Déclaration des Beans =========================== -->
  9.   <form-beans>
  10.     <form-bean name="infoActionForm" type="exemple.InfoActionForm" />
  11.     <form-bean name="jspokActionForm" type="exemple.jspokActionForm" />
  12.   </form-beans>
  13.   <!-- ========== Déclaration du Mapping =========================== -->
  14.   <action-mappings>
  15.     <action name="infoActionForm" type="exemple.infoAction" input="/info.jsp" scope="request" path="/infoAction">
  16.       <forward name="ok" path="/jspok.jsp" />
  17.       <forward name="nok" path="/jspnok.jsp" />
  18.     </action>
  19.     <action name="suppAction" type="exemple.suppAction" validate="false" input="/jspok.jsp" scope="request" path="/suppAction">
  20.       <forward name="retour" path="/jspok.jsp" />
  21.     </action>
  22.     <action name="jspok.do" type="exemple.jspokAction" input="/jspok.jsp" scope="request" path="/jspokAction" validate="false">
  23.       <forward name="ok" path="/jspok.jsp" />
  24.       <forward name="nok" path="/jspnok.jsp" />
  25.     </action>
  26.   </action-mappings>
  27.   <!-- ========== Message Resources Definitions =========================== -->
  28.   <!-- <message-resources parameter="exemple.ApplicationResources.properties"/> -->
  29. </struts-config>


 
et le web.xml :
 

Code :
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
  3. <web-app>
  4.   <display-name>Home Struts11 OC</display-name>
  5.   <servlet>
  6.     <servlet-name>action</servlet-name>
  7.     <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
  8.     <init-param>
  9.       <param-name>config</param-name>
  10.       <param-value>/WEB-INF/struts-config.xml</param-value>
  11.     </init-param>
  12.     <load-on-startup>1</load-on-startup>
  13.   </servlet>
  14.   <servlet>
  15.     <servlet-name>debugjsp</servlet-name>
  16.     <description>Ajouté pour compiler les JSP avec les informations de débogage</description>
  17.     <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
  18.     <init-param>
  19.       <param-name>classdebuginfo</param-name>
  20.       <param-value>true</param-value>
  21.     </init-param>
  22.     <load-on-startup>3</load-on-startup>
  23.   </servlet>
  24.   <servlet-mapping>
  25.     <servlet-name>action</servlet-name>
  26.     <url-pattern>*.do</url-pattern>
  27.   </servlet-mapping>
  28.   <servlet-mapping>
  29.     <servlet-name>debugjsp</servlet-name>
  30.     <url-pattern>*.jsp</url-pattern>
  31.   </servlet-mapping>
  32.   <welcome-file-list>
  33.     <welcome-file>info.jsp</welcome-file>
  34.   </welcome-file-list>
  35.   <taglib>
  36.     <taglib-uri>/WEB-INF/app.tld</taglib-uri>
  37.     <taglib-location>/WEB-INF/app.tld</taglib-location>
  38.   </taglib>
  39.   <taglib>
  40.     <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
  41.     <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
  42.   </taglib>
  43.   <taglib>
  44.     <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
  45.     <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
  46.   </taglib>
  47.   <taglib>
  48.     <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
  49.     <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
  50.   </taglib>
  51. </web-app>


 
Où mettons le chemin vers le fichier properties?

Reply

Marsh Posté le 19-05-2004 à 15:52:35   

Reply

Marsh Posté le 21-05-2004 à 13:01:52    

Nobody has tried to use database with struts 1.1

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed