madhun reddy

Greenhorn
+ Follow
since Sep 29, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 madhun reddy

We were able to solve the issue, the problem was mainly due to error in validation xml file for the a action class.

But I have a general doubt on what all jars need to be used for implementing projects in using following technologies:
1. Strut2
2. Tiles
3. Spring
4. Spring-AOP
5. LDAP
12 years ago
Got the issue solved, it has to do something with action validation.xml files. I temporerly removed them and the app is working fine. need to check what really is wrong with validation file.
12 years ago
Hi,

I am trying to implement project using Struts2-Spring-AOP, but I am getting following strange error.

java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [itemservice]
org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:99)
org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:379)
org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:268)

Following are the library files I am using, please let me know if I need to remove/add any jars.

antlr-runtime-3.0.jar
aopalliance.jar
aspectjrt.jar
aspectjweaver.jar
cglib-nodep-2.1_3.jar
commons-beanutils.jar
commons-collections-2.1.1.jar
commons-dbcp.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.1.jar
commons-pool.jar
freemarker-2.3.13.jar
jstl.jar
junit-3.8.1.jar
mysql-connector-java-5.1.6-bin.jar
ognl-2.6.11.jar
org.springframework.asm-3.0.0.M3.jar
org.springframework.beans-3.0.0.M3.jar
org.springframework.context-3.0.0.M3.jar
org.springframework.core-3.0.0.M3.jar
org.springframework.expression-3.0.0.M3.j

org.springframework.web-3.0.0.M3.jar
org.springframework.web.servlet-3.0.0.M3.

spring-aop.jar
spring-jdbc.jar
spring-ldap-1.2.1.jar
spring-orm.jar
spring-security-core-2.0.3.jar
spring-tx.jar
struts2-convention-plugin-2.1.6.jar
struts2-core-2.1.6.jar
struts2-spring-plugin-2.1.6.jar
xwork-2.1.2.jar

thanks
Madhu
12 years ago
Hi
I am new to struts2 and I am getting following exception, my entire project got stuckup due to this.

I am using Struts2 and Spring 3.0.
When I call this http://localhost:8080/security.ac/actions/populateRole.action, I am getting this exception.


java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [roleservice]
org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:100)
org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:385)
org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:274)
com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:87)

My Struts.xml
=============
<package name="default" namespace="/actions" extends="struts-default">
<action name="populateRole" method="populate" class="roleservice">
<result name="populate">/DisplayRole.jsp</result>
</action>
<action name="createRole" method="doCreate" class="roleservice">
<result name="success" type="redirect">listRole</result>
<result name="input">/DisplayRole.jsp</result>
</action>
<action name="updateRole" method="doUpdate" class="roleservice">
<result name="success" type="redirect">listRole</result>
<result name="input">/DisplayRole.jsp</result>
</action>
<action name="listRole" method="doList" class="roleservice">
<result name="success">/ListRole.jsp</result>
</action>
<action name="editRole" method="doEdit" class="roleservice">
<result name="success">/DisplayRole.jsp</result>
</action>
<action name="deleteRole" method="doDelete" class="roleservice">
<result name="success" type="redirect">listRole</result>
</action>
</package>

My applicationContext.xml has

<bean name="roleservice" class="com.companyapk.security.ac.action.RoleServiceAction">
<property name="roleserviceBO" ref="roleserviceBO"></property>
<property name="itemserviceBO" ref="itemserviceBO"></property>
</bean>

<bean name="roleserviceBO" class="com.companyapk.security.ac.bs.RoleServiceBOImpl">
<property name="roleserviceDAO" ref="roleserviceDAO"></property>
</bean>

<bean id="roleserviceDAO" class="com.companyapk.security.ac.dao.RoleServiceDAOImpl">
<property name="itemserviceDAO" ref="itemserviceDAO"></property>
<property name="dataSource" ref="dataSource"/>
</bean>

My servlet class:
public class ItemServiceAction extends com.opensymphony.xwork2.ActionSupport
implements ModelDriven<ItemDO> {

private static final long serialVersionUID = 3777666021811678484L;

ItemServiceBO itemserviceBO;

ActionServiceBO actionserviceBO;

ItemDO itemDO = new ItemDO();

List<ItemDO> itemDOList = new ArrayList<ItemDO>();

List<String> selectedActions = new ArrayList<String>();

List<String> actionList = new ArrayList<String>();

String editMode = "add";


static {
ConvertUtils.register(new SqlDateConverter(null), java.sql.Date.class);
}

public void setitemserviceBO(ItemServiceBO itemserviceBO) {
this.itemserviceBO = itemserviceBO;
}

public void setactionserviceBO(ActionServiceBO actionserviceBO) {
this.actionserviceBO = actionserviceBO;
}

public void setItemDO(ItemDO itemDO) {
this.itemDO = itemDO;
}

public List<ItemDO> getItemDOList() {
return itemDOList;
}

public void setItemDOList(List<ItemDO> itemDOList) {
this.itemDOList = itemDOList;
}

public ItemDO getModel() {
return itemDO;
}

public String getEditMode() {
return editMode;
}

public void setEditMode(String editMode) {
this.editMode = editMode;
}

public String execute() {
return SUCCESS;
}

public String doCreate() {

itemDO.setActions(getSelectedActionDOs());
this.itemserviceBO.addItem(itemDO);
return SUCCESS;

}

public String populate() {

List<ActionDO> actions = actionserviceBO.loadAction();

this.actionList = new ArrayList<String>();
for (int i = 0; i < actions.size(); i++) {
actionList.add(actions.get(i).getName());
}
return "populate";
}

public String doUpdate() {

itemDO.setActions(getSelectedActionDOs());
this.itemserviceBO.saveItem(itemDO);
return SUCCESS;
}

public String doDelete() {

HttpServletRequest request = (HttpServletRequest) ActionContext
.getContext().get(ServletActionContext.HTTP_REQUEST);

ItemDO a = new ItemDO();
a.setName(request.getParameter("name"));

this.itemserviceBO.deleteItem(a);
return SUCCESS;
}

public String doEdit() {

this.editMode = "edit";
return doRead();
}

public String doRead() {

HttpServletRequest request = (HttpServletRequest) ActionContext
.getContext().get(ServletActionContext.HTTP_REQUEST);

ItemDO a = new ItemDO();
a.setName(request.getParameter("name"));

this.itemDO = this.itemserviceBO.viewItem(a);
populate();
return SUCCESS;
}

public String doList() {

this.itemDOList = itemserviceBO.loadItem();
if (this.itemDOList == null) itemDOList = new ArrayList<ItemDO>();
return SUCCESS;
}

public List<String> getSelectedActions() {
return selectedActions;
}

public void setSelectedActions(List<String> selectedActions) {
this.selectedActions = selectedActions;
}

public List<String> getActionList() {
return this.actionList;
}

public void setActionList(List<String> actionList) {
this.actionList = actionList;
}

protected List<ActionDO> getSelectedActionDOs() {

List<ActionDO> list = new ArrayList<ActionDO>();
for (int i = 0; i < selectedActions.size(); i++) {
ActionDO action = new ActionDO();
action.setName(selectedActions.get(i));
list.add(action);
}
return list;
}
}

Please let me know what is the problem in this code.
Thanks inadvance for help.

thanks
Madhu
12 years ago