Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

monika se

Greenhorn
+ Follow
since Mar 23, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by monika se

I am having a table A with following structure:

Table A
Column a1(PK)
Column a2
.....

Table B
Column b1(PK)
Column b2
........


Table C
Column c1(PK)
Column c2
Column a1b1
......


In Column a1b1 of Table C we are storing the values from PK Column a1 from table A or PK Column b1 from Table B. i.e, some rows in Table C relates to Table A and some relates to Table B depending on this Column "a1b1" column value.
Please help me in doing the mapping for this case in JPA Annotations.


I have used below mapping that was NOT working.


Please help me as what could be going wrong. My full stackTrace is:



I am a new to this kind of exception but I know its getting timed out. Sometimes same action works fine. any help would be appreciated. Thanks in adv.
Hi,
I have a Query on 2 tables A,B as below:

This query is returning correct result on Database.
select A.id, B.id from Apple A left join Ball B on A.id= B.aId where A.categoryId = 23 order by B.phone ;

In Database, for each category, We have many records in A table. And corresponding to each entry in A table, We may/may not have a unique entry in table B.
Need to fetch all records that are in A and are associated/not associated with Table B for that categoryId. When we do not find any record for B, make it as blank/null. Basically I want distinct entry left outer join.

When I am using it in Hibernate Criteria Class, on keyword is not recognized. And so not able to use it. Please suggest a way out to implement it.
Thanks.
MY ALL FILES ARE GIVEN BELOW.
I AM TRYING WEBWORK HELLO WORLD PROGRAM DEALING WITH INPUTS.
web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/javaee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
version="2.5">


<servlet>
<servlet-name>webwork</servlet-name>
<servlet-class>com.opensymphony.webwork.dispatcher.ServletDispatcher</servlet-class>

</servlet>
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>webwork</servlet-name>
<url-pattern>*.action</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
<jsp-config>
<taglib>
<taglib-uri>
webwork
</taglib-uri>
<taglib-location>
web/lib/webwork2/webwork-2.2.6.jar
</taglib-location>
</taglib>
</jsp-config>
</web-app>



xwork.xml

<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN" "http://www.opensymphony.com/xwork/xwork-1.1.1.dtd">;


<xwork>
<include file="webwork-default.xml"/>
<package name="default" extends="webwork-default">
<default-interceptor-ref name="completeStack"/>

<action name="helloWorld" class="HelloWorld">
<result name="success">/WEB-INF/helloworld.jsp</result>
<result name="input">/WEB-INF/name.jsp</result>
</action>
</package>
</xwork>

HelloWorld.java

import com.opensymphony.xwork.Action;

public class HelloWorld implements Action {
private String message;
private String name;

public String execute() {

message = "Hello, " + name + "!\n";
message += "The time is:\n";
message += System.currentTimeMillis();
return SUCCESS;
}

public String getMessage() {
return message;
}

public void setName(String name) {
this.name = name;
}

public String getName() {
return this.name;
}
}

helloworld.jsp

<%@ taglib prefix="ww" uri="/webwork" %>


<html>
<head>
<title>Hello Page</title>
</head>
<body>
The message generated by my first action is:
<ww:property value="message"/>
</body>
</html>

name.jsp

<%--
Created by IntelliJ IDEA.
User: MBurnwal
Date: Mar 31, 2011
Time: 12:42:29 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Enter your name</title>
</head>
<body>
Please enter your name:
<form action="helloWorld.action">
<label>
<input type="text" name="name"/>
</label>
<input type="submit"/>
</form>
</body>
</html>

I saw and enquired , this class file is inside that lib/webwork jar. still dont know why it is not getting loaded.

Also I am using IDEA. If i refresh my browser, i get helloworld_jsp not found .. class not found error..

Please suggest me what went wrong?? what all files should i check.
Please help me.

My stack trace on running helloworld.jsp is:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /helloworld.jsp(10,0) Unable to load tag handler class "com.opensymphony.webwork.views.jsp.PropertyTag" for tag "ww:property"
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:198)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1198)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1422)
org.apache.jasper.compiler.Parser.parse(Parser.java:130)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:185)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:326)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.

Apache Tomcat/6.0.32

when i refresh this browser, i gets stack trace as:
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:161)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:630)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:149)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

java.lang.ClassNotFoundException: org.apache.jsp.helloworld_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:202)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:628)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:149)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.

Apache Tomcat/6.0.32

Now i am getting error exceptions as

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception
root cause

java.lang.NoSuchMethodError: com.opensymphony.xwork.ObjectFactory.buildBean(Ljava/lang/String;Ljava/util/Map;)Ljava/lang/Object;
com.opensymphony.webwork.dispatcher.mapper.ActionMapperFactory.getMapper(ActionMapperFactory.java:37)
com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:101)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.



i saw xwork.jar files with two versions, so removed one of it so to avoid collision(as seen on google-help)

then i got error as:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /hello.jsp at line 16

13: </head>
14: <body>
15: WebWork says:
16: <h1><ww:property value="message"/></h1>
17: </body>
18: </html>
19:


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:519)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:410)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class com.opensymphony.xwork.util.OgnlValueStack
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:865)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
org.apache.jsp.hello_jsp._jspService(hello_jsp.java:78)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

java.lang.NoClassDefFoundError: Could not initialize class com.opensymphony.xwork.util.OgnlValueStack
com.opensymphony.webwork.views.jsp.TagUtils.getStack(TagUtils.java:39)
com.opensymphony.webwork.views.jsp.WebWorkBodyTagSupport.getStack(WebWorkBodyTagSupport.java:40)
com.opensymphony.webwork.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:32)
org.apache.jsp.hello_jsp._jspx_meth_ww_005fproperty_005f0(hello_jsp.java:95)
org.apache.jsp.hello_jsp._jspService(hello_jsp.java:67)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.

Apache Tomcat/6.0.32

can anyone tell me ways to solve it??
Similar Problem i have::

My servlet_lifecycle.java file is:

//servlet programs demonstrating its life cycle

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class servlet_lifecycle extends HttpServlet{
int i;

public void init() throws ServletException
{
i=0; //initializing i value-- parameters
}

//incrementing i value in doGet

public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();

if(i==0)
{
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet's Life Cycle</title>");
out.println("</head>");
out.println("</body>");
out.println("</h1>i value initialized in init method</h1>" + "<h1>"+ i + "</h1>");
out.println("</body>");
out.println("</html>");
}
i=i+1;
if(i==10)
{
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet's Life Cycle</title>");
out.println("</head>");
out.println("</body>");
out.println("</h1>i value reaches 10, hence calling destroy method to reset it</h1>" + "<h1>"+ i + "</h1>");
out.println("</body>");
out.println("</html>");
destroy();
}


if(i<10)
{
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet's Life Cycle</title>");
out.println("</head>");
out.println("</body>");
out.println("</h1>i value incremented in doGet method</h1>" + "<h1>"+ i + "</h1>");
out.println("</body>");
out.println("</html>");
}
}

public void destroy()
{
i=0;
}


}


web.xml file is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<web-app xmlns="http://java.sun.com/xml/ns/javaee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd";
version="2.4">

<description>
Servlet and JSP Examples.
</description>
<display-name>Servlet and JSP Examples</display-name>



<servlet>
<servlet-name>servlet_lifecycle</servlet-name>
<servlet-class>servlet_lifecycle</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>servlet_lifecycle</servlet-name>
<url-pattern>/servlet_lifecycle</url-pattern>
</servlet-mapping>

</web-app>


Please help me.. i am new to servlets... i am geting error HTTP 503

HTTP Status 503 - This application is not currently available

type Status report

message This application is not currently available

description The requested service (This application is not currently available) is not currently available.

Apache Tomcat/6.0.32


9 years ago
MY VARIOUS FILES ARE BELOW, PLEASE REFER ONCE.. DO TEL ME WHAT SHOULD I DO FOR STRUTS CONFIG ETC FILES.??

HelloWorld.java:



package sample;

import com.opensymphony.xwork.ActionSupport;

public class HelloWorld extends ActionSupport {
private String message;

public String execute() {
message = "Hello, WebWorld!";
return SUCCESS;
}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}
}


hello.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="ww" uri="/webwork" %>
<html>
<head>
<title>Hello Page</title>
</head>
<body>
WebWork says:
<h1><ww:property value="message"/></h1>
</body>
</html>

xwork.xml

<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-1.0.dtd">;
<xwork>
<include file="webwork-default.xml"/>
<package name="default" extends="webwork-default">
<default-interceptor-ref name="completeStack"/>


</package>

<package name="hello" extends="default">
<action name="helloWorld" class="sample.HelloWorld">
<result name="success" type="dispatcher">hello.jsp</result>

</action>
</package>
</xwork>


web.xml


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
version="2.5">
<servlet>
<servlet-name>webwork</servlet-name>
<servlet-class>
com.opensymphony.webwork.dispatcher.ServletDispatcher
</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>webwork</servlet-name>
<url-pattern>*.action</url-pattern>
</servlet-mapping>
<jsp-config>
<taglib>
<taglib-uri>webwork</taglib-uri>
<taglib-location>/WEB-INF/lib/webwork-2.2.7.jar
</taglib-location>
</taglib>
</jsp-config>
<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>
<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>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>


struts.xml


<?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">;

<struts>
</struts>

struts-config.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">;

<struts-config>

</struts-config>



9 years ago
PLEASE CHECK LINE "INFO: Unable to locate configuration files of the name struts-plugin.xml" IN STACK TRACE./.

I AM NEW TO THIS STRUTS WEBWORK ETC... PLEASE ELABORATE WHAT SHOULD I DO... I CONFIGURED xwork.xml, webwork.properties,web.xml files correctly...
9 years ago
SOLVED PREVIOUS ISSUES..

Now my problem is::


Stack Trace: while debugging hello.jsp on IDEA.

cmd /c ""C:\Program Files\Java\jdk1.6.0_20\bin\java" "-Dcatalina.base=C:\Documents and Settings\MBurnwal\.IntelliJIdea90\system\tomcat\hello_jsp_Monika180cd8257" "-Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 6.0" "-Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 6.0\temp" -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:4836,suspend=y,server=n -jar "C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\bootstrap.jar" start"
Connected to the target VM, address: '127.0.0.1:4836', transport: 'socket'
Mar 29, 2011 2:24:53 PM 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.6.0_20\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32;;;C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;C:\Program Files\Java\jdk1.6.0_20\bin;;c:\program files\jetbrains\intellij idea 9.0.2\jre\jre\bin
Mar 29, 2011 2:24:55 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 29, 2011 2:24:55 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 3725 ms
Mar 29, 2011 2:24:55 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 29, 2011 2:24:55 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
Mar 29, 2011 2:24:55 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ROOT.xml
Mar 29, 2011 2:24:58 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-default.xml]
Mar 29, 2011 2:24:59 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Unable to locate configuration files of the name struts-plugin.xml, skipping
Mar 29, 2011 2:24:59 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-plugin.xml]
Mar 29, 2011 2:24:59 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts.xml]
Mar 29, 2011 2:25:00 PM org.apache.struts.action.ActionServlet initChain
INFO: Loading chain catalog from jar:file:/C:/Documents%20and%20Settings/MBurnwal/IdeaProjects/Monika1/out/artifacts/Monika1_war_exploded/WEB-INF/lib/struts-core.jar!/org/apache/struts/chain/chain-config.xml
Mar 29, 2011 2:25:01 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
Mar 29, 2011 2:25:01 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
Mar 29, 2011 2:25:02 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Mar 29, 2011 2:25:02 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Mar 29, 2011 2:25:02 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager
Mar 29, 2011 2:25:02 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
Mar 29, 2011 2:25:02 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory webapp
Mar 29, 2011 2:25:02 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 29, 2011 2:25:02 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 29, 2011 2:25:02 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/93 config=null
Mar 29, 2011 2:25:02 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7133 ms
Connected to server

on browser: http://localhost:8080/hello.jsp
WebWork says

on running http://localhost:8080/Monika1/helloWorld.action on browser

HTTP Status 404 - There is no Action mapped for action name helloWorld.

type Status report

message There is no Action mapped for action name helloWorld.

description The requested resource (There is no Action mapped for action name helloWorld.) is not available.

Apache Tomcat/6.0.32




Doubts:

DO i need struts.xml, struts-plugins.xml,struts-config.xml , struts-default.xml also??? Because i did not updated these files. I hope there is no conflict because of it.

9 years ago
please note "INFO: Unable to locate configuration files of the name struts-plugin.xml, skipping
Mar 29, 2011 9:59:14 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info" in above..
for above stack trace,my struts-config.xml is:


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">;

<struts-config>

</struts-config>

please elaborate what to do.
9 years ago
stack trace on browser while running helloWorld.action:

HTTP Status 404 - There is no Action mapped for name space / and action name hello World.

type Status report

message There is no Action mapped for name space / and action name hello World.

description The requested resource (There is no Action mapped for name space / and action name hello World.) is not available.
Apache Tomcat/6.0.32


One thing is there, my struts-config.xml file is not proper... cannot resolve class DefectsListForm etc or cannot resolve symbol etc.


I know something is missing ..please tell me what should i include in lib or otherwise configure struts-config.xml ..

moreover in IntelliJIDEA while debugging hello.jsp i gets this stack trace as::
cmd /c ""C:\Program Files\Java\jdk1.6.0_20\bin\java" "-Dcatalina.base=C:\Documents and Settings\MBurnwal\.IntelliJIdea90\system\tomcat\hello_jsp_Monika3d8837014" "-Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 6.0" "-Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 6.0\temp" -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:1959,suspend=y,server=n -jar "C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\bootstrap.jar" start"
Connected to the target VM, address: '127.0.0.1:1959', transport: 'socket'
Mar 29, 2011 9:59:12 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.6.0_20\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32;;;C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;C:\Program Files\Java\jdk1.6.0_20\bin;;c:\documents and settings\mburnwal\my documents\downloads\intellij idea 9.0.2\jre\jre\bin
Mar 29, 2011 9:59:13 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 29, 2011 9:59:13 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1109 ms
Mar 29, 2011 9:59:13 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 29, 2011 9:59:13 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
Mar 29, 2011 9:59:13 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ROOT.xml
Mar 29, 2011 9:59:14 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-default.xml]
Mar 29, 2011 9:59:14 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Unable to locate configuration files of the name struts-plugin.xml, skipping
Mar 29, 2011 9:59:14 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-plugin.xml]
Mar 29, 2011 9:59:14 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts.xml]
Mar 29, 2011 9:59:15 AM org.apache.struts.action.ActionServlet initChain
INFO: Loading chain catalog from jar:file:/C:/Documents%20and%20Settings/MBurnwal/IdeaProjects/Monika/out/artifacts/Monika_war_exploded/WEB-INF/lib/struts-core.jar!/org/apache/struts/chain/chain-config.xml
Mar 29, 2011 9:59:16 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
Mar 29, 2011 9:59:16 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
Mar 29, 2011 9:59:16 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Mar 29, 2011 9:59:16 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Mar 29, 2011 9:59:16 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager
Mar 29, 2011 9:59:17 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
Mar 29, 2011 9:59:17 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory webapp
Mar 29, 2011 9:59:17 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 29, 2011 9:59:17 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 29, 2011 9:59:17 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/62 config=null
Mar 29, 2011 9:59:17 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4103 ms
Connected to server
Mar 29, 2011 9:59:38 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find action or result
There is no Action mapped for namespace / and action name helloWorld. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:178)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:478)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
9 years ago
I am running webwork 1st program

HelloWorld.java
hello.jsp
helloWorld.action.

I need web.xml,xwork.xml,webwork.properties. But i have a doubt do i need struts-config.xml also!!! Please help me... The are saying "unable to locate struts-plugins.xml"..

What should i do to resolve it ...

I am using IntelliJ IDEA... Please Help me...
9 years ago
Hi I am doing HelloWorld program through webwork.

My HelloWorld.java file is :

package sample;

import com.opensymphony.xwork.ActionSupport;

public class HelloWorld extends ActionSupport {
private String message;

@Override
public String execute() {
message = "Hello, WebWorld!";
return SUCCESS;
}

public String getMessage() {
return message;
}
public void setMessage(String message)
{
this.message = message;
}
}

hello.jsp file is

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="ww" uri="/webwork" %>
<html>
<head>
<title>Hello Page</title>
</head>
<body>
WebWork says:
<h1><ww:property value="message"/></h1>
</body>
</html>

xwork.xml

<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-1.0.dtd">;
<xwork>
<include file="webwork-default.xml"/>
<package name="default" namespace="/" extends="webwork-default">
<default-interceptor-ref name="completeStack"/>

<action name="helloWorld" class="sample.HelloWorld">
<result name="success" type="dispatcher">hello.jsp</result>

</action>

</package>
</xwork>


web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
version="2.5">
<servlet>
<servlet-name>webwork</servlet-name>
<servlet-class>
com.opensymphony.webwork.dispatcher.ServletDispatcher
</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>webwork</servlet-name>
<url-pattern>*.action</url-pattern>
</servlet-mapping>
<jsp-config>
<taglib>
<taglib-uri>webwork</taglib-uri>
<taglib-location>/WEB-INF/lib/webwork-2.2.7.jar
</taglib-location>
</taglib>
</jsp-config>

<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>
<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>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>

webwork.properties
webwork.tag.altSyntax = true



I placed xwork.xml,webwork.properties and package sample inside WEB-INF/classes

and jsp file inside WEB-INF..

After compiling java file and running hello.jsp file, i gets only Webwork says. It does not fetch message and displays it on browser meaning mapping is not tking place ... please help me and tell me possible reasons for this problem.....