Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Tomcat HTTP 404 error - Requested resource () not available

  • 03-05-2012 2:01am
    #1
    Closed Accounts Posts: 82 ✭✭


    Hi,
    Im working on my FYP and have got into huge bother at the moment...
    Im working on a dynamic web project,it was fine yesterday and then today all of a sudden this error has popped up and I can not run my project in eclipse!:(
    Ive searched up and down the net for an answer but to no avail! Any help would be much appreciated thanks as I have spent the last 8 hours pulling my hair out!


Comments

  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    If you're hosting on Linux
    Try /var/tomcat/logs or CATALINA_HOME/logs (where CATALINA_HOME is a path variabkle), also try your apache logs.
    If windows, look in the running directory for the logs, or check the windows event log.


  • Registered Users, Registered Users 2 Posts: 897 ✭✭✭moycullen14


    Tomcat is being asked for something it can't find.

    Is it a jsp or a servlet or a html file?
    Are you running tomcat from within Eclipse?

    If so, one thing to do is to 'clean' the server and run again.

    From the Server perspective, right click and select Clean.
    Then run the webapp.

    Sometimes eclipse<=>tomcat gets itself into a muddle.

    Are you sure you are connecting to the right instance of tomcat?

    Post the url and your web.xml file and we should be able to see what's going wrong.


  • Closed Accounts Posts: 82 ✭✭lippy88


    Thanks for help guys,
    This is the last file in the catalina log not sure if this is the one you are looking for:


    INFO: Deploying web application directory ROOT
    May 03, 2012 1:08:48 AM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-80
    May 03, 2012 1:08:48 AM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    May 03, 2012 1:08:48 AM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/78 config=null
    May 03, 2012 1:08:48 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 2347 ms
    May 03, 2012 1:09:14 AM org.apache.coyote.http11.Http11Protocol pause
    INFO: Pausing Coyote HTTP/1.1 on http-80
    May 03, 2012 1:09:15 AM org.apache.catalina.core.StandardService stop
    INFO: Stopping service Catalina
    May 03, 2012 1:09:16 AM org.apache.coyote.http11.Http11Protocol destroy
    INFO: Stopping Coyote HTTP/1.1 on http-80
    May 03, 2012 1:33:40 AM org.apache.catalina.startup.Catalina stopServer
    SEVERE: Catalina.stop:
    java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:337)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:198)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
    at java.net.Socket.connect(Socket.java:579)
    at java.net.Socket.connect(Socket.java:528)
    at java.net.Socket.<init>(Socket.java:425)
    at java.net.Socket.<init>(Socket.java:208)
    at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:408)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)

    May 03, 2012 1:33:43 AM org.apache.catalina.core.AprLifecycleListener init
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_01\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\Program Files (x86)\ActiveState Komodo Edit 6\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\TortoiseSVN\bin;C:\Ruby192\bin;.
    May 03, 2012 1:33:43 AM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-80
    May 03, 2012 1:33:43 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 561 ms
    May 03, 2012 1:33:43 AM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    May 03, 2012 1:33:43 AM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.28
    May 03, 2012 1:33:43 AM org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Deploying configuration descriptor host-manager.xml
    May 03, 2012 1:33:43 AM org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Deploying configuration descriptor manager.xml
    May 03, 2012 1:33:43 AM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory docs
    May 03, 2012 1:33:43 AM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory examples
    May 03, 2012 1:33:43 AM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory Recruiter
    May 03, 2012 1:33:44 AM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory ROOT
    May 03, 2012 1:33:44 AM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-80
    May 03, 2012 1:33:44 AM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    May 03, 2012 1:33:44 AM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/31 config=null
    May 03, 2012 1:33:44 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 885 ms
    May 03, 2012 2:01:25 AM org.apache.coyote.http11.Http11Protocol pause
    INFO: Pausing Coyote HTTP/1.1 on http-80
    May 03, 2012 2:01:26 AM org.apache.catalina.core.StandardService stop
    INFO: Stopping service Catalina
    May 03, 2012 2:01:26 AM org.apache.coyote.http11.Http11Protocol destroy
    INFO: Stopping Coyote HTTP/1.1 on http-80


    And the web.xml is:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_9" version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee&quot;
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <display-name>Struts2 Application</display-name>
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>
    org.apache.struts2.dispatcher.FilterDispatcher
    </filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    <welcome-file-list>
    <welcome-file>Home.jsp</welcome-file>
    </welcome-file-list>
    </web-app>

    Il just mention I also downloaded a pre-configured tomcat v6.0.28 from coreservlets.com, I dont think this could have anything to do with it though?
    My environment variable is set to c:\apache2.0.28 and tomcat runs fine on internet explorer at address http://localhost:80 !! Ive noticed that other versions are http://localhost:8080 but 80 works for me.
    The only other conclusion I can come up with is that when I set the settings for tomcat server in eclipse that I may not have correct!
    Thanks again:)


  • Closed Accounts Posts: 82 ✭✭lippy88


    This is whats displayed in the console when I run the project:




    03-May-2012 14:05:36 org.apache.catalina.core.AprLifecycleListener init
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jre6\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:/Program Files (x86)/Java/jre6/bin/client;C:/Program Files (x86)/Java/jre6/bin;C:/Program Files (x86)/Java/jre6/lib/i386;C:\Program Files (x86)\ActiveState Komodo Edit 6\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\TortoiseSVN\bin;C:\Ruby192\bin;C:\Users\Lippy\Downloads\eclipse-jee-indigo-SR1-win32\eclipse;;.
    03-May-2012 14:05:36 org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Recruiter' did not find a matching property.
    03-May-2012 14:05:36 org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-80
    03-May-2012 14:05:36 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 361 ms
    03-May-2012 14:05:36 org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    03-May-2012 14:05:36 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.28
    03-May-2012 14:05:37 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
    INFO: Parsing configuration file [struts-default.xml]
    03-May-2012 14:05:37 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
    INFO: Unable to locate configuration files of the name struts-plugin.xml, skipping
    03-May-2012 14:05:37 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
    INFO: Parsing configuration file [struts-plugin.xml]
    03-May-2012 14:05:37 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
    INFO: Parsing configuration file [struts.xml]
    03-May-2012 14:05:37 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
    INFO: Loading global messages from ApplicationResources
    03-May-2012 14:05:37 com.opensymphony.xwork2.util.logging.jdk.JdkLogger error
    SEVERE: Dispatcher initialization failed
    Unable to load configuration. - action - file:/C:/Users/Lippy/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/Recruiter/WEB-INF/classes/struts.xml:25:75
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)
    at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4001)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4651)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
    at org.apache.catalina.core.StandardService.start(StandardService.java:519)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
    Caused by: Action class [net.viralpatel.struts2.JobCheck] not found - action - file:/C:/Users/Lippy/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/Recruiter/WEB-INF/classes/struts.xml:25:75
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:420)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:365)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:479)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:275)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
    ... 21 more
    03-May-2012 14:05:37 org.apache.catalina.core.StandardContext filterStart
    SEVERE: Exception starting filter struts2
    Unable to load configuration. - action - file:/C:/Users/Lippy/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/Recruiter/WEB-INF/classes/struts.xml:25:75
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:428)
    at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4001)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4651)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
    at org.apache.catalina.core.StandardService.start(StandardService.java:519)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
    Caused by: Unable to load configuration. - action - file:/C:/Users/Lippy/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/Recruiter/WEB-INF/classes/struts.xml:25:75
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)
    ... 19 more
    Caused by: Action class [net.viralpatel.struts2.JobCheck] not found - action - file:/C:/Users/Lippy/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/Recruiter/WEB-INF/classes/struts.xml:25:75
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:420)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:365)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:479)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:275)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
    ... 21 more
    03-May-2012 14:05:37 org.apache.catalina.core.StandardContext start
    SEVERE: Error filterStart
    03-May-2012 14:05:37 org.apache.catalina.core.StandardContext start
    SEVERE: Context [/Recruiter] startup failed due to previous errors
    03-May-2012 14:05:37 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
    SEVERE: The web application [/Recruiter] registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.




    03-May-2012 14:05:37 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
    SEVERE: The web application [/Recruiter] created a ThreadLocal with key of type [null] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1bc16f0]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@18622f3]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
    03-May-2012 14:05:37 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
    SEVERE: The web application [/Recruiter] created a ThreadLocal with key of type [null] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@160877b]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@5eb489]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.


  • Registered Users, Registered Users 2 Posts: 897 ✭✭✭moycullen14


    Ok, struts.xml is your problem. Post it up and we'll have a look


  • Advertisement
  • Closed Accounts Posts: 82 ✭✭lippy88


    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd"&gt;

    <struts>
    <constant name="struts.enable.DynamicMethodInvocation"
    value="false" />
    <constant name="struts.devMode" value="false" />
    <constant name="struts.custom.i18n.resources" value="ApplicationResources" />

    <package name="default" extends="struts-default" namespace="/">



    <action name="applyForJob" class="net.viralpatel.struts2.ApplyForJob">
    <result name="SUCCESS">RegisterSuccess.jsp</result>
    <result name="ERROR">Register.jsp</result>
    </action>

    <action name="jobCreate" class="net.viralpatel.struts2.JobCreate">
    <result name="SUCCESS">CreateJobs.jsp</result>
    </action>

    <action name="checkJob" class="net.viralpatel.struts2.JobCheck">
    <result name="SUCCESS">JobCheck.jsp</result>
    </action>



    <action name="register" class="net.viralpatel.struts2.RegisterAction">
    <result name="SUCCESS">RegisterSuccess.jsp</result>
    <result name="ERROR">Register.jsp</result>
    </action>

    <action name="login" method="execute" class="net.viralpatel.struts2.LoginAction">
    <result name="SUCCESS">Welcome.jsp</result>
    <result name="FAILURE">Login.jsp</result>
    </action>

    <action name="createSkill" method="execute" class="net.viralpatel.struts2.SkillAction">
    <result name="SUCCESS">Skills.jsp</result>
    <result name="ERROR">Welcome.jsp</result>
    </action>

    <action name="Logout" class="net.viralpatel.struts2.LogoutAction">
    <result name="SUCCESS">/Home.jsp</result>
    </action>

    <action name="registerCompany" class="net.viralpatel.struts2.RegisterCompAction">
    <result name="SUCCESS">/RegisterSuccess.jsp</result>
    <result name="ERROR">RegisterCompany.jsp</result>
    </action>

    <action name="employerLogin" method="execute" class="net.viralpatel.struts2.CompanyLogin">
    <result name="SUCCESS">CompanyWelcome.jsp</result>
    <result name="FAILURE">CompanyLogin.jsp</result>
    </action>

    <action name="createJobs" method="execute" class="net.viralpatel.struts2.CreateJobAction">
    <result name="SUCCESS">CompanyWelcome.jsp</result>
    <result name="FAILURE">CompanyLogin.jsp</result>
    </action>
    </package>
    </struts>



    Thanks for your help Moycullen!:)


  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    Have you created this action?
    <action name="checkJob" class="net.viralpatel.struts2.JobCheck">
    <result name="SUCCESS">JobCheck.jsp</result>
    </action>

    Check for errors in that class as well.


  • Closed Accounts Posts: 82 ✭✭lippy88


    Giblet,
    You are correct,my problem was in the JobCheck action class!!!:) In my action class I had declared 'public class Jobcheck' instead of public class JobCheck !!
    I spent hours trying to figure this problem out and It never dawned on my to look at the java file as I was sure that this action would not affect the project starting up as it was not going to call the jobCheck action until a button was pressed on the web page!I thought it had something to do with the set up of my server...Thanks a million


  • Registered Users, Registered Users 2 Posts: 897 ✭✭✭moycullen14


    net.viralpatel.struts2.JobCheck is missing?

    Check that you have a java file for this and that it is compiled correctly.

    Also, I'm guessing that you've copied this from a 'tutorial' on struts2 on the web?

    Make sure you have all the JARs needed to run this in your WEB-INF/lib directory?


  • Closed Accounts Posts: 82 ✭✭lippy88


    Yes JobCheck.java had a spelling mistake in it, as I said I didnt realise this would prevent the start up of the web app as it wouldnt be used until asked to do so.
    Anyway,seems the project is working ok again now thanks. And yes I found a tutorial online to help me start the base of my project: http://viralpatel.net/blogs/2009/12/tutorial-create-struts-2-application-eclipse-example.html
    It was a handy tutorial and easy to learn especially since I was not very familiar with struts!

    While I have you there Giblet you might able to answer one more question relating to a form for creating a new job.At the moment I have a number of textfields and then a drop-down list which displays the skills available to choose from. e.g java ruby sql etc. When I click submit, the form for some reason does not enter the data in the database.Im wondring have I named the drop down list correctly linked to skillName? I coded a print statement System.out.println(skillName); and when the action is run I get back : net.viralpatel.struts2.Skill@1bd9d76 instead of say 'Java'!

    Here is the JSP of the form...

    <s:form action="createJobs">

    <s:textfield name="jobName" label="Job Name" />
    <s:textfield name="startDate" label="Start Date"/>
    <s:textfield name="endDate" label="End Date" />
    <s:textfield name="salary" label="Salary" />
    <s:textfield name="description" label="Description" />

    <s:select label="Skill" name="skillName" list="skills" listValue="skillName">
    </s:select>
    <s:submit
    </s:form>


    Sorry for been a pain,taking up your time!


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    It seems that skillName might be a complex type, not a string.


  • Closed Accounts Posts: 82 ✭✭lippy88


    Sorry I dont understand what you mean complex type?
    I have set skillName as type String so I am trying to get the exact skill whether it be java / ruby back from the drop down list.

    this.createJob.setString(7, this.getSkillName());
    System.out.println(skillName);


Advertisement