Struts Application Properties
I think this has been broached before, but if someone could restate the answer, I
would be most obliged:
It appears that WLS 6.1 SP2 does not load properties files (like the typical Struts
Application.properties) when it loads a webapp. This leads to an exception in my
Struts apps (that work fine on Tomcat 4.0.3) when it can't find any of the application
tags.
Anybody run into this?
Name it whatever you want. All that matters is the part before the .properties extension matches what you put in the struts-config.xml:
<!-- Main resource bundle, contains errors and some generic stuff. -->
<message-resources parameter="com.company.app.MainResources"
null="true"/>
<!-- Alternate resource bundle, contains some special things maybe. -->
<message-resources parameter="com.company.app.AltResources"
key="altResourceKey" null="true" />
// and have the files...
appdir/WEB-INF/classes/com/company/app/MainResources.properties
appdir/WEB-INF/classes/com/company/app/AltResources.properties
// and use them with the bean:message tag...
<bean:message key="some.main.key" />
<bean:message bundle="altResourceKey" key="some.alt.key" />The only thing that matters is that several Struts tags, like the <html:errors /> for ActionErrors will only use 1 message resource file. The html:errors tag can specify an alternate resource file, but all the error keys used for that html:errors instance must be in that same bundle. So usually I put all my error messages in the main one and if it's a large app, I put several other resource files for different areas of the app.
Similar Messages
-
Struts - Application.properties and ApplicationResources.properties
Java Guru's,
Could some one tell me the difference between Application.properties and ApplicationResources.properties and which one shd i use in my application.
Thank you in Advance ..Name it whatever you want. All that matters is the part before the .properties extension matches what you put in the struts-config.xml:
<!-- Main resource bundle, contains errors and some generic stuff. -->
<message-resources parameter="com.company.app.MainResources"
null="true"/>
<!-- Alternate resource bundle, contains some special things maybe. -->
<message-resources parameter="com.company.app.AltResources"
key="altResourceKey" null="true" />
// and have the files...
appdir/WEB-INF/classes/com/company/app/MainResources.properties
appdir/WEB-INF/classes/com/company/app/AltResources.properties
// and use them with the bean:message tag...
<bean:message key="some.main.key" />
<bean:message bundle="altResourceKey" key="some.alt.key" />The only thing that matters is that several Struts tags, like the <html:errors /> for ActionErrors will only use 1 message resource file. The html:errors tag can specify an alternate resource file, but all the error keys used for that html:errors instance must be in that same bundle. So usually I put all my error messages in the main one and if it's a large app, I put several other resource files for different areas of the app. -
Struts and Application.properties
I think this has been broached before, but if someone could restate the answer, I
would be most obliged:
It appears that WLS 6.1 SP2 does not load properties files (like the typical Struts
Application.properties) when it loads a webapp. This leads to an exception in my
Struts apps (that work fine on Tomcat 4.0.3) when it can't find any of the application
tags.
Anybody run into this?
Name it whatever you want. All that matters is the part before the .properties extension matches what you put in the struts-config.xml:
<!-- Main resource bundle, contains errors and some generic stuff. -->
<message-resources parameter="com.company.app.MainResources"
null="true"/>
<!-- Alternate resource bundle, contains some special things maybe. -->
<message-resources parameter="com.company.app.AltResources"
key="altResourceKey" null="true" />
// and have the files...
appdir/WEB-INF/classes/com/company/app/MainResources.properties
appdir/WEB-INF/classes/com/company/app/AltResources.properties
// and use them with the bean:message tag...
<bean:message key="some.main.key" />
<bean:message bundle="altResourceKey" key="some.alt.key" />The only thing that matters is that several Struts tags, like the <html:errors /> for ActionErrors will only use 1 message resource file. The html:errors tag can specify an alternate resource file, but all the error keys used for that html:errors instance must be in that same bundle. So usually I put all my error messages in the main one and if it's a large app, I put several other resource files for different areas of the app. -
Struts application using wsad 5.0 - unable to Run on server
Hi,
I m developing a small struts application using WSAD 5.0.
Here is the code
index.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ page
language="java"
contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"
%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet" type="text/css">
<TITLE>ABC, Inc. Human Resources Portal</TITLE>
</HEAD>
<BODY background="F1_100.gif">
<font size="+1">ABC, Inc. Human Resources Portal </font>
</br>
<hr width="100%" noshade="true">
•Add an Employee
<br>
•
<html:link forward="search">Search for Employees</html:link>
<br>
</BODY>
</HTML>
search.jsp
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html>
<head>
<title> ABC, Inc. Human Resources Portal - Employee Search</title>
</head>
<body>
<font size="+1">
ABC, Inc. Human Resources Portal - Employee Search
</font><br>
<hr width="100%" noshade="true">
<html:errors/>
<html:form action="/search">
<table>
<tr>
<td align="right"><bean:message key="label.search.name"/></td>
<td><html:text property="name"/></td>
</tr>
<tr>
<td></td>
<td>-- or --</td>
</tr>
<tr>
<td align="right"><bean:message key="label.search.ssnum"/></td>
<td><html:text property="ssnum"/>(xxx-xx-xxxx)</td>
</tr>
<tr>
<td></td>
<td><html:submit/></td>
</tr>
</table>
</html:form>
<logic:present name="searchForm" property="results">
<hr width="100%" size="1" noshade="true">
<bean:size id="size" name="searchForm" property="results"/>
<logic:equal name="size" value="0">
<center><font color="red"><b>No Employees Found</b></font></center>
</logic:equal>
<logic:greaterThan name="size" value="0">
<table border="1">
<tr>
<th>Name</th>
<th>Social Security Number</th>
</tr>
<logic:iterate id="result" name="searchForm" property="results">
<tr>
<td><bean:write name="result" property="name"/></td>
<td><bean:write name="result" property="ssNum"/></td>
</tr>
</logic:iterate>
</table>
</logic:greaterThan>
</logic:present>
</body>
</html>
searchForm.java
package minihr.forms;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
* Form bean for a Struts application.
* Users may access 3 fields on this form:
* <ul>
* <li>name - [your comment here]
* <li>ssNum - [your comment here]
* </ul>
* @version 1.0
* @author
public class SearchForm extends ActionForm {
private String name = null;
private String ssNum = null;
private List results = null;
* Get Name
* @return String
public String getName() {
return name;
* Set Name
* @param <code>String</code>
public void setName(String name) {
this.name = name;
* Get SsNum
* @return String
public String getSsNum() {
return ssNum;
* Set SsNum
* @param <code>String</code>
public void setSsNum(String ssNum) {
this.ssNum = ssNum;
* Set Results
public void setResults(List results){
this.results=results;
* get Results
public List getResults(){
return results;
* Constructor
public SearchForm() {}
public void reset(ActionMapping mapping, HttpServletRequest request) {
// Reset values are provided as samples only. Change as appropriate.
name = null;
ssNum = null;
results = null;
//validate form data.
public ActionErrors validate(
ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
// Validate the fields in your form, adding
// adding each error to this.errors as found, e.g.
// if ((field == null) || (field.length() == 0)) {
// errors.add("field", new ActionError("error.field.required"));
boolean nameEntered = false;
boolean ssNumEntered = false;
//Determine if name has been entered.
if(name != null && name.length() > 0){
nameEntered = true;
//Determine if social security number has been entered
if(ssNum != null && ssNum.length() > 0){
ssNumEntered = true;
/* validate that either name or ssnum has
* been entered */
if(!nameEntered && !ssNumEntered){
errors.add(null,new ActionError("error.search.criteria.missing"));
/* validate format of ssnum if it has been entered */
if(ssNumEntered && !isValidSsNum(ssNum.trim())){
errors.add("ssNum",
new ActionError("error.search.ssNum.invalid"));
return errors;
//validate format of social security number
private static boolean isValidSsNum(String ssNum){
if(ssNum.length() < 11){
return false;
for(int i=0;i<11;i++){
if(i==3 || i==6){
if(ssNum.charAt(i) != '-'){
return false;
}else if("0123456789".indexOf(ssNum.charAt(i)) == -1){
return false;
return true;
searchAction.java
package minihr.actions;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import minihr.forms.SearchForm;
import common.EmployeeSearchService;
* @version 1.0
* @author
public class SearchAction extends Action {
* Constructor
public SearchAction() {}
public ActionForward perform(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
EmployeeSearchService service = new EmployeeSearchService();
ArrayList results;
SearchForm searchForm = (SearchForm) form;
//perform employee search based on what criteria was entered
String name = searchForm.getName();
if(name != null && name.trim().length() > 0)
results = service.searchByName(name);
else
results = service.searchBySsNum(searchForm.getSsNum().trim());
//place search results in searchform for access by JSP.
searchForm.setResults(results);
//forward control to this actions input page
return mapping.getInputForward();
EmployeeSearchService.java
package common;
import java.util.ArrayList;
import common.Employee;
* @author Niharika
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
public class EmployeeSearchService {
private static Employee[] employees =
new Employee("samuel","123-45-6789"),
new Employee("Robert","234-56-7890"),
new Employee("smith","345-67-8901"),
new Employee("Frank","456-78-9012")
// search for employees by name
public ArrayList searchByName(String name){
ArrayList resultList = new ArrayList();
for(int i=0; i<employees.length; i++)
if(employees.getName().toUpperCase().indexOf(name.toUpperCase()) != -1)
resultList.add(employees[i]);
return resultList;
// search for employee by social security number
public ArrayList searchBySsNum(String ssNum){
ArrayList resultList = new ArrayList();
for(int i=0; i<employees.length; i++)
if(int i=0; i<employees.length; i++)
if(employee[i].getSsNum().equals(ssNum))
resultList.add(employees[i]);
return resultList;
Employee.java
package common;
* @author Niharika
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
public class Employee {
private String name;
private String ssNum;
public Employee(String name,String ssNum)
this.name=name;
this.ssNum=ssNum;
public void setName(String name)
this.name=name;
public String getName()
return name;
ApplicationResources.properties
# Label Resources
label.search.name=Name
label.search.ssNum=Social Security Number
# Error Resources
error.search.criteria.missing=<li>Search Criteria Missing</li>
error.search.ssNum.invalid=<li>Invalid Social Security Number</li>
errors.header=<font color="red"><b>Validation Errors </b></font><ul>
errors.footer=</ul><hr width="100%" size="1" noshade="true">
In searchAction.java
it is showing 2 errors
public ActionForward perform(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
error is: Exception Exception is not compatible with throws clause in
org.apache.struts.action.Action.Perform()
Another error is shown at :
return mapping.getInputForward();
error is:
method is undefined for typt org.apache.struts.action.ActionMapping
please give me a solution for this watching the code
i have opened the server perspective and started the server.
next i am clicking run on server. There i am getting an error like this:
Error Received while starting the server
Reason:
Launching the server failed:
server port 9080 is in use.
ORB bootstrap port 2809 is in use.
SOAP connector port 8880 is in use.
change each used port number to another unused port on the ports page of the server configuration editor. In case u have another websphere server running , you can try to increase each used port number by one and try again.please solve this problemNothing at all to do with struts.
Some of the ports that WSAD wants to use are already in use.
Maybe you have a copy of websphere running already?
If so stop that one, and try running again. -
How to add i18n features to a Struts application?
How to add i18n features to a Struts application?
txs!How to add I18N to Struts application
operation:
1) provide your native ascii encoded properties file.
2) set the correct language priority. (As to IE: Tools - Internet Options - Languages
3) coding: add correct encoding in your web page, exp. for zh_CN:
<%@ page contentType="text/html; charset=gb2312" %>
utility batch file:
native2ascii -encoding gb2312 MessageResources_zh_CN.txt MessageResources_zh_CN.properties
copy MessageResources.txt MessageResources_en_US.properties
note
Before you run the utility batch file, you should first add %JAVA_HOME%/bin to system %PATH% environment variable. -
Migrating struts application from 10.1.2 to 10.1.3.1
I've tried migrating my struts application from using JDev 10.1.2 to 10.1.3.1. When I try to open up the struts-config.xml file, I get a Java runtime exception error. I am using JDK 5.0.60.5. I'm not sure how to fix this....
Message
BME-99004: A Java runtime exception has occurred.
Cause
This exception should have been dealt with programmatically. The current activity may fail and the system may have been left in an unstable state. The following is a stack trace.
java.lang.ClassCastException: oracle.adfdt.controller.struts.diagram.db.shape.StrutsDataActionNode
at oracle.adfdt.controller.struts.diagram.shape.StrutsPageLink.connect(StrutsPageLink.java:79)
at oracle.bm.diagrammer.shape.BaseDiagramEdge.validate(BaseDiagramEdge.java:3176)
at oracle.bm.diagrammer.registry.RBaseShape.validate(RBaseShape.java:788)
at oracle.bm.diagrammer.BaseDiagram.validateOnLoad(BaseDiagram.java:6436)
at oracle.bm.persist.diagram.impl.BaseDiagramReader.loadDiagram(BaseDiagramReader.java:141)
at oracle.bm.diagrammer.BaseDiagram.loadDiagram(BaseDiagram.java:1381)
at oracle.adfdt.controller.diagram.PageFlowDiagram.loadDiagram(PageFlowDiagram.java:108)
at oracle.bm.addinUtil.IDEAppContext.buildDiagram(IDEAppContext.java:2269)
at oracle.bm.addinUtil.DiagAppPanel.buildDiagram(DiagAppPanel.java:50)
at oracle.bm.addinUtil.IDEAppContext.openLoad(IDEAppContext.java:3735)
at oracle.bm.addinUtil.IDEAppContext.open(IDEAppContext.java:3368)
at oracle.adfdt.controller.diagram.PageFlowEditor.open(PageFlowEditor.java:82)
at oracle.ideimpl.editor.EditorState.openEditor(EditorState.java:239)
at oracle.ideimpl.editor.EditorState.createEditor(EditorState.java:147)
at oracle.ideimpl.editor.EditorState.getOrCreateEditor(EditorState.java:90)
at oracle.ideimpl.editor.SplitPaneState.canSetEditorStatePos(SplitPaneState.java:231)
at oracle.ideimpl.editor.SplitPaneState.setCurrentEditorStatePos(SplitPaneState.java:194)
at oracle.ideimpl.editor.TabGroupState.createSplitPaneState(TabGroupState.java:103)
at oracle.ideimpl.editor.TabGroup.addTabGroupState(TabGroup.java:275)
at oracle.ideimpl.editor.EditorManagerImpl.createEditor(EditorManagerImpl.java:1261)
at oracle.ideimpl.editor.EditorManagerImpl.createEditor(EditorManagerImpl.java:1196)
at oracle.ideimpl.editor.EditorManagerImpl.openEditor(EditorManagerImpl.java:1131)
at oracle.ideimpl.editor.EditorManagerImpl.whenOpenEditor(EditorManagerImpl.java:2332)
at oracle.ideimpl.editor.EditorManagerImpl.handleDefaultAction(EditorManagerImpl.java:1893)
at oracle.ide.controller.ContextMenu.fireDefaultAction(ContextMenu.java:343)
at oracle.ideimpl.explorer.BaseTreeExplorer.fireDefaultAction(BaseTreeExplorer.java:1576)
at oracle.ideimpl.explorer.BaseTreeExplorer.dblClicked(BaseTreeExplorer.java:1913)
at oracle.ideimpl.explorer.BaseTreeExplorer.mouseReleased(BaseTreeExplorer.java:1934)
at oracle.ideimpl.explorer.CustomTree.processMouseEvent(CustomTree.java:176)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Action
If further errors occur, you should restart the application.
Also, report the problem on the JDeveloper forum on otn.oracle.com, or contact Oracle support, giving the information from this message.
________________________________________________________________________________Yes, but the application under 10.1.3 points to the application.jws file in the old 10.1.2 directory.
I want the application to point to the .jws file JDeveloperApplication/<application>/<application>.jws.
10.1.3 keeps this pointer somewhere and would like to change it. I scanned the jdev directory for files containing <application>.jws, and found it in the binary file jdev/system/oracle.jdeveloper.10.1.3.36.73/system.sys file, and the ide.properties file, and the system/oracle.ide.10.1.3.26.73/windowinglayout.xml file.
None of these files seem to be the place to make the adjustments.
I guess the more general question for me is "How should JDeveloper be configured to allow for migration of applications? (It does not seem to be a no-brainer!) How should it be configured when additional libraries have been included in the list libraries of prior JDeveloper version and need to be migrated/duplicated to a new version of JDeveloper? How are connections supposed to be migrated (for database, cvs, application servers)? How should JDeveloper be configured for team use? (Each member of a team should maintain identical JDeveloper configurations. Yes?)"
But, first things, first. How do I point a JDeveloper application to a different .jws and application directory? -
Application.Properties Loosing Content
I am using Action.Properties to set error codes and display them as part of my validation.
I am setting the Error in a Validate class using the following Syntax
errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("error.FirstField.invalid"));
I am routing control back to homepage incase of an error and printing the same using
<html:errors/>
This Works Just FIne, Until i re-build the application.
Once i re-Build, the content in application.Properties disappears. Just Gone!
Have you guys had the same problem or do i have the patent this rare finding, LOLIf you are loosing the complete application.Properties file, the reason may be that you are putting this file at wrong place. I think you are putting it in classes folder and when you re build the complete application, all the existing files are flushed by the newly genrated class files. If you are using any advanced editor like WSAD, you should put this file in a package in Java Source. So that when you rebuild the project, it will be copied as it is in the classes folder. And accordingly you need to change the path of this file into struts-config.xml.
-
Internationalization in struts application
Hi,
I am trying to implement the multilingual in my struts application.I have done it successfully through browser setting.Now I want to select a language on my login page through drop down and then application should be opened in the choosen language. i.e. i want to change the locale through code.
Can anybody suggest me what to do?I am preparing a multi language support for a project. I have 2
resource file for now, these are ApplicationResource (for English words)
and ApplicationResource s_de(for German words). And I have flag buttons
when user login into system can see flags(German and English flags). I
defined these resources files in struts-config, xml like this:
<message-resources key="application" parameter="com. ps.action. common.config. ApplicationResou rces" />
<message-resources key="german" parameter="com. ps.action. common.config. ApplicationResou rces_de" />
and than, I use words from resource files like this:
<bean:message bundle="application " key="issue.headerPa rt"/>
I want to this: if user login into system user can see flags, than he
can click flags, if he clicks German flag
ApplicationResoirce s_de.properties file will be called and I will see
<bean:message bundle="application " key="issue.headerPa rt"/>
this in German. when I click German flag, bundle must be change to bundle="german" automatically. How I can do this?
thx a lot -
Hi,
My application is based on struts frame work.
I am writing application.properties file to Internationalize the messages.
Now i am strucked in between. i want to add html tags between the messages in application.properties file
for example...
new.message=<table>
<tr>
<td>
<li>Add name</li>
<li>Add age</li>
</td>
</tr>
</table>
But when i used this in my actual JSP page like
<bean:message key="new.message "/>. but its showing blank page. I want to know...can i use html tags in properties file. If so how can i achive it. please help me
Thanks in advanceall these should be in one line...there shouldnt be any breaks...
new.message=<table><tr><td><li>Add name</li><li>Add age</li></td></tr></table>
regards
shanu -
Hi guys,
I'm using struts application,from that i will call
one external java file.(i.e) At the time of server(tomcat) will start ,the java class file is also started.
can u give any idea regarding my condition.I wrote some triggering logic in that Java file.
so, i need once the application will start, the corresponding java file will also called."SimpleServlet.java"
package com;
import org.quartz.CronExpression;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.CronTrigger;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;
import javax.servlet.*;
import java.io.*;
import javax.servlet.http.HttpServlet;
import org.quartz.ee.servlet.QuartzInitializerServlet;
public class Simple extends HttpServlet {
//Override
public void init(ServletConfig config) throws ServletException {
System.out.println("Initializing Scheduler PlugIn for Jobs!");
super.init(config);
// Retrieve a scheduler from schedule factory
try {
Scheduler scheduler;
SchedulerFactory schedulerFactory = new
StdSchedulerFactory();
scheduler = schedulerFactory.getScheduler();
ServletContext ctx = config.getServletContext();
//Scheduler scheduler = null;
StdSchedulerFactory factory = (StdSchedulerFactory)
ctx.getAttribute(QuartzInitializerServlet.QUARTZ_FACTORY_KEY);
scheduler = factory.getScheduler();
//JobDetail jd = new JobDetail("job1",
"group1",SimpleQuartzJob.class);
JobDetail jd = new JobDetail("job1", "group1",Hello.class);
CronTrigger cronTrigger = new CronTrigger("trigger1","group1");
CronExpression cexp = new CronExpression("0/5 * * * * ?");
//String cronExpr = null;
//cronExpr = getInitParameter("cronExpr");
//System.out.println(cronExpr);
cronTrigger.setCronExpression(cexp);
scheduler.scheduleJob(jd, cronTrigger);
scheduler.start();
System.out.println("Job scheduled now ..");
} catch (Exception e){
e.printStackTrace();
//Override
public void service(ServletRequest request, ServletResponse
response)throws ServletException, IOException {
PrintWriter pw=response.getWriter();
pw.print("<html> <body> <h1>");
pw.print("Please wait,DataBase Operations is
performing.............");
pw.print("</h1></body></html>");
//Override
public String getServletInfo() {
System.out.println("servlet started..");
return null;
"web.xml"
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<display-name>
Quartz</display-name>
<servlet>
<servlet-name>QuartzInitializer</servlet-name>
<display-name>Quartz Initializer Servlet</display-name>
<servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<init-param>
<param-name>config-file</param-name>
<param-value>quartz.properties</param-value>
</init-param>
<init-param>
<param-name>shutdown-on-unload</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>start-scheduler-on-load</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>Simple</servlet-name>
<servlet-class>com.Simple</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Simple</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>I tried from this site http://www.oreillynet.com/cs/user/view/cs_msg/86579
but it will not work for me.
It throws servlet exception.
Message was edited by:
SARAV_RS -
Error while deploying struts application in tomcat
Hi,
I'm getting the following error when I start Tomcat using while auto-deploying a struts application.
2005-09-21 15:28:17 - ContextManager: Adding DEFAULT:/cna
2005-09-21 15:28:18 - Ctx(/cna) : Validating web.xml
2005-09-21 15:28:18 - Ctx(/cna) : Class not found: org.apache.struts.action.Acti
onServlet
2005-09-21 15:28:18 - Ctx(/cna) : Class not found: org.apache.axis.transport.htt
p.AdminServlet
In case anyone is aware how to resolve this issue, please help.
Thanks,
RoselineHi,
1] Remove following from server.xml
<Context path="/SEA" docBase="SEA" debug="0"/>
2] Paste SEA.WAR (test WAR file) into /webapps of TOMCAT
3] Start Tomcat Server - This will create SEA folder under webapps
4] Stop server.
5] Add following to server.xml
<Context path="/SEA" docBase="SEA" debug="0"/>
6] Start Tomcat Server
7] Access the URL.
This will work. Somehow Tomcat does not extract war file contents which are mentioned in server.xml.
I have Apache Tomcat 4.0.3 and faced this problem. The above solution works for it.
Regards,
Sandesh
hi.
I have put my SEA.WAR (test WAR file) into /webapps of
TOMCAT.
I checked the server.xml and put:
<Context path="/SEA" docBase="SEA" debug="0"/>
I restarted TOMCAT and tried to execute the file:
http://localhost:8080/SEA/index.jsp
But I got error message:
Apache Tomcat/4.0.3 - HTTP Status 404 -
/SEA/index.jsp
What was happenning?
Anyone can help me?
Thank you. -
Error while deploying struts application
Hi every body,
I am new for struts application. While i deploying my application, the following error is comming any body give a remedy to me...
Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: File "/WEB-INF/struts-html.tld" not found
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:214)
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:174)
at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirective(JspParseEventListener.java:1170)
at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:765)
at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:125)
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:255)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1099)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:214)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:534)
--------------------------------------------------------------------------------Hi every body,
I am new for struts application. While i deploying my
application, the following error is comming any body
give a remedy to me...
Apache Tomcat/4.0.4 - HTTP Status 500 - Internal
Server Error
type Exception report
message Internal Server Error
description The server encountered an internal error
(Internal Server Error) that prevented it from
fulfilling this request.
exception
org.apache.jasper.JasperException: File
"/WEB-INF/struts-html.tld" not found
at
t
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibr
aryInfoImpl.java:214)
at
t
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibr
aryInfoImpl.java:174)
at
t
org.apache.jasper.compiler.JspParseEventListener.proce
ssTaglibDirective(JspParseEventListener.java:1170)
at
t
org.apache.jasper.compiler.JspParseEventListener.handl
eDirective(JspParseEventListener.java:765)
at
t
org.apache.jasper.compiler.DelegatingListener.handleDi
rective(DelegatingListener.java:125)
at
t
org.apache.jasper.compiler.Parser$Directive.accept(Par
ser.java:255)
at
t
org.apache.jasper.compiler.Parser.parse(Parser.java:11
45)
at
t
org.apache.jasper.compiler.Parser.parse(Parser.java:11
03)
at
t
org.apache.jasper.compiler.Parser.parse(Parser.java:10
99)
at
t
org.apache.jasper.compiler.ParserController.parse(Pars
erController.java:214)
at
t
org.apache.jasper.compiler.Compiler.compile(Compiler.j
ava:210)
at
t
org.apache.jasper.servlet.JspServlet.loadJSP(JspServle
t.java:548)
at
t
org.apache.jasper.servlet.JspServlet$JspServletWrapper
.loadIfNecessary(JspServlet.java:176)
at
t
org.apache.jasper.servlet.JspServlet$JspServletWrapper
.service(JspServlet.java:188)
at
t
org.apache.jasper.servlet.JspServlet.serviceJspFile(Js
pServlet.java:381)
at
t
org.apache.jasper.servlet.JspServlet.service(JspServle
t.java:473)
at
t
javax.servlet.http.HttpServlet.service(HttpServlet.jav
a:853)
at
t
org.apache.catalina.core.ApplicationFilterChain.intern
alDoFilter(ApplicationFilterChain.java:247)
at
t
org.apache.catalina.core.ApplicationFilterChain.doFilt
er(ApplicationFilterChain.java:193)
at
t
org.apache.catalina.core.StandardWrapperValve.invoke(S
tandardWrapperValve.java:243)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:566)
at
t
org.apache.catalina.core.StandardPipeline.invoke(Stand
ardPipeline.java:472)
at
t
org.apache.catalina.core.ContainerBase.invoke(Containe
rBase.java:943)
at
t
org.apache.catalina.core.StandardContextValve.invoke(S
tandardContextValve.java:190)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:566)
at
t
org.apache.catalina.valves.CertificatesValve.invoke(Ce
rtificatesValve.java:246)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:564)
at
t
org.apache.catalina.core.StandardPipeline.invoke(Stand
ardPipeline.java:472)
at
t
org.apache.catalina.core.ContainerBase.invoke(Containe
rBase.java:943)
at
t
org.apache.catalina.core.StandardContext.invoke(Standa
rdContext.java:2347)
at
t
org.apache.catalina.core.StandardHostValve.invoke(Stan
dardHostValve.java:180)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:566)
at
t
org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:564)
at
t
org.apache.catalina.valves.ErrorReportValve.invoke(Err
orReportValve.java:170)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:564)
at
t
org.apache.catalina.valves.AccessLogValve.invoke(Acces
sLogValve.java:468)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:564)
at
t
org.apache.catalina.core.StandardPipeline.invoke(Stand
ardPipeline.java:472)
at
t
org.apache.catalina.core.ContainerBase.invoke(Containe
rBase.java:943)
at
t
org.apache.catalina.core.StandardEngineValve.invoke(St
andardEngineValve.java:174)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:566)
at
t
org.apache.catalina.core.StandardPipeline.invoke(Stand
ardPipeline.java:472)
at
t
org.apache.catalina.core.ContainerBase.invoke(Containe
rBase.java:943)
at
t
org.apache.catalina.connector.http.HttpProcessor.proce
ss(HttpProcessor.java:1027)
at
t
org.apache.catalina.connector.http.HttpProcessor.run(H
ttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:534)
--------------------------i am try to run struts application. but it shows following error
org.apache.jasper.JasperException: File "/WEB-INF/struts-html.tld" not found
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) -
Console error while deploying a struts application..
I am getting following exception while deploying a struts application:-
javax.servlet.ServletException: org/apache/commons/logging/LogFactory
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:884)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:848)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:787)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3252)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3197)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3174)
at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletContext.java:5647)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:869)
at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2022)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2063)
at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399)
at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
please help me out.The ServletException is just a wrapper exception which informs about an underlying failure. When interpreting stacktraces,the bottommost root cause parts is the most important part. I assume that it's just a java.lang.ClassNotFoundException on org/apache/commons/logging/LogFactory. In that case, the exception is self-explaining enough. The mentioned class is missing in the classpath. The solution is also obvious: add the mentioned class (or at least, the JAR file with the mentioned class) to the classpath and you're fine. As the package name already hints, you can download it at [http://commons.apache.org/logging].
For future java.lang.* exceptions please consult 'New to Java' forum. This is unrelated to Java Servlet. -
Hi,
I have a java DC which should be able to read some application properties like
mdm.servername
mdm.repositoryname
mdm.username
I have tried using the ApplicationConfigHandler class in which I created a EAR and Web Module DC and when I run this web module dc as standalone, the properties file "sap.application.global.properties" gets loaded successfully.
But when I call this webmodule Dc's method to load properties from a Java DC , all the properties are null.
Is there any other way that I can load properties in java DC which can be modified without having to redeploy the java dc.
Thanks
MLSHi
Use [configuration services |https://help.sap.com/saphelp_nw04/helpdata/en/b8/aa343e32ff1033e10000000a114084/frameset.htm] in order to created application-specific properties that can be modified at run-time.
Good luck,
Ola -
Error in simple struts application
Hi friends,
Happy to meet again. Please help me out from this situation which kills me for the past 1 week. While i try to deploy my first struts application through eclipse 3.2 with jdk1.5 and tomcat 5.5.25 and struts 2.0.9 i'm getting this error. what is this regarding.
FYI
I'm just using two text boxes and trying to get those in next page....
The error goes like this
exception
org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.html.MessagesTei
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:281)
org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:423)
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:249)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:163)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)
org.apache.jasper.compiler.Parser.parse(Parser.java:127)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.ClassNotFoundException: org.apache.struts.taglib.html.MessagesTei
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1362)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1208)
org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:420)
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:249)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:163)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)
org.apache.jasper.compiler.Parser.parse(Parser.java:127)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)See http://forum.java.sun.com/thread.jspa?messageID=3866745&tstart=0
Maybe you are looking for
-
Problem with exexuting an OS command
Hello! Our SAP System runs on Solaris. I want to move files from a directory in a subdirectory, similiar to this: from: /dir/file1.csv /dir/file2.csv /dir/file3.csv to: /dir/subdir I made an OS command with the SM69 and executed it with SM49. The com
-
Can I buy a new battery somewhere?
Playbook is a great tool when it works, which is hardly ever. Battery won't hold a charge and won't charge. Is there a place to buy a new battery or should I just chuck this thing and get in iPad?
-
Updating master data for time dimensions from front end
Hi Experts, I am sure this must be handled in a very straight forward way. Just want to know the best practice here. We are working on a copy of appset and want to completely revamp the time dimension papers as per client's fiscal year which is april
-
Trying to upgrade OS X Mavericks for months now.
It seems like I've been trying to upgrade to OS X Mavericks for months now. I keep getting this message -The file couldn't be saved because you don't have permission.(513). Why? And what can I do to fix this so that I can upgrade?
-
Hello I have 2 tables. One has an xmltype column. The way I have to joing these 2 tables is by writing the query like: select ... from table1 t1 where t1.col1not in ( select distinct lki from table2 t2 where to_char(lki) in (select distinct ft3.xmlco