rangababu chakravarthula

Greenhorn
+ Follow
since Jan 02, 2004
Merit badge: grant badges
For More
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 rangababu chakravarthula

App server: WebSphere 6
Datasource: XA datasource

We recently migrated from Weblogic to WebSphere and here is the problem we are getting now

We have a Container managed entity bean and a Stateless session bean. From the session bean we are doing a findByPrimarykey on the entity bean using the localhome.
We are getting
ORA-02049: timeout: distributed transaction waiting for lock
everytime it does a findByPrimarykey

any ideas?
We have a stateless session EJB (sejb) implementing TimedObject interface. The sejb is a one time timerservice and not a recurring one. The EJBTimeout method is calling another session ejb (sejb2) to implement business logic. If there are any exceptions from sejb2, ejbtimeout method is consuming them and just logging an error. In order to test the behavior, we had sejb2 throw a nullpointerexception. What we observed is sejb timeout method is getting triggered continuously as long as it receives exception even though it is created to execute only once.
If there are no exceptions, it just executes once as it is configured to do.

Is it the behavior of a timerservice?

any help is appreciated.
thanks
crb
17 years ago
If You use image buttons for different actions (using ImageButtonBean) one ActionClass can be used for different actions.

In your JSP
<html:form action="/ManageAction">
<html:image property="saveButton" src="logonsubmit.jpg" alt="save" />
<html:image property="deleteButton" src="deletesubmit.jpg" alt="delete" />
</html:form>


In your ActionForm

private ImageButtonBean saveButton = new ImageButtonBean();
private ImageButtonBean deleteButton = new ImageButtonBean();

public void setSaveButton(ImageButtonBean button) {
this.saveButton = button;
}

public ImageButtonBean getSaveButton() {
return this.saveButton;
}

public void setDeleteButton(ImageButtonBean button) {
this.deleteButton = button;
}

public ImageButtonBean getDeleteButton() {
return this.deleteButton;
}


public String getSelected() {

if (getSaveButton().isSelected()) {
return "save";
}

if (getDeleteButton().isSelected()) {
return "delete";
}

return null;
}

In your ActionClass

String selected = manageForm.getSelected();
if ("save".equals(selected)) {
//do something
return forward = mapping.findForward("savethankyou");
}
else if ("delete".equals(selected)) {
//do something
forward = mapping.findForward("deletethankyou");
}
else{
forward = mapping.findForward("error");
}


in your struts-config.xml
<form-bean name="manageForm" type="your.package.forms.ManageForm">
</form-bean>

<action name="manageForm" path="/ManageAction" scope="request" type="your.package.actions.ManageAction" validate="false" >

<forward name="deletethankyou" path="/deletethankyou.jsp"/>
<forward name="savethankyou" path="/savethankyou.jsp"/>
<forward name="error" path="/error.jsp"/>
</action>
[ July 27, 2005: Message edited by: rangababu chakravarthula ]
18 years ago
great! thank you very much Merrill. Will try out a sample and test.
18 years ago
Hi

Is is possible to have a action form bean which will have common form elements and have separate action form beans for each kind of report that will inherit the base action form and use the form elements.

If yes, do I have to have the base action form entry in struts-config.xml

Same question with Action class. Can I have a base action class and have report specific action classes that inherit the base action class. because in my case for every report that the application needs to generate it has to check roles that will be available in request cookies. (jaas roles is not possible in this case. has to be request cookies) can I have that functionality in base action class and have report specific actions in their respective action classes. And also what configuration needs to be done in struts-config.xml

thanks
18 years ago
lets take an example of login error.

In your action class
ActionMessages messages = new ActionMessages();

if(invalid userid/pwd combination){
messages.add("logininvalid", new ActionMessage("invalid.user"));
saveMessages(request,messages);
return forward = mapping.findForward("error");
}

if(usernamenotpresent){
messages.add("missingusername", new ActionMessage("username.missing"));
saveMessages(request,messages);
return forward = mapping.findForward("error");
}

In your Applicationresources.properties file add this line
invalid.user=Invalid Username/Password combination
username.missing=Username is required

In your JSP

In this case the message is going to be displayed if present
<html:messages id="msg1" message="true" property="logininvalid">
<bean:write name="msg1"/><br>
</html:messages>

In this case you are not displaying the error message yet. just defining a bean to store the error message if present

<html:messages id="msg0" message="true" property="missingusername">
<bean:write name="msg0"/><br>
<bean efine id="usernameerror" name="msg0" />
</html:messages>

<logic resent name="usernameerror">
<font color="red">User Name:</font>
</logic resent>

<logic:notPresent name="usernameerror">
User Name:
</logic:notPresent>
18 years ago