Session.getAttribute returning null
i set the session attribute in one jsp file using session.setAttribute() and retrieve it in another using session.getAttribute..The return value for session.getAttribute is null,
I also tried using HTTP session,the result is same.
First jsp file
<%@ page import="database.DBFunctions" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page import="javax.servlet.http.HttpSession" %>
<%@ page import="read.Create" %>
<%@ page language="java" %>
<%
PrintWriter writer = response.getWriter();
//HttpSession varSession = request.getSession();
String uname = request.getParameter("UserName");
String pword = request.getParameter("PassWord");
DBFunctions func = new DBFunctions();
int bool = func.validate(uname);
if(bool==1){
func.insertLogin(uname, pword);
ResultSet rs = func.getUid(uname, pword);
if(rs.next()){
int userid = rs.getInt("uid");
writer.println(userid);
System.out.println("adduser"+userid);
session.setAttribute("uid",userid);
//varSession.setAttribute("uid", new Integer(userid));
Create cnew = new Create();
cnew.createUser(userid);
writer.println(bool);
else{
writer.println(bool);
%>2nd jsp file:
<%@ page import="read.Json" %>
<%@ page import="read.Create" %>
<%@ page import="org.json.JSONObject" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page language="java" session="true" %>
<%
PrintWriter writer = response.getWriter();
//HttpSession varSession = request.getSession();
//Object uid1 = session.getAttribute("uid");
/*if(varSession.isNew()){
System.out.println("new user");
}else{
String a = (String) session.getAttribute("uid");
writer.println(a);
//Object uid1 = varSession.getAttribute("uid");
Object uid1 = session.getAttribute("uid");
String sheetName = request.getParameter("SheetName");
String bookName = request.getParameter("WorkBook");
writer.println(bookName);
writer.println((String)uid1);
Create cdoc = new Create();
int docid1 = cdoc.createDoc(uid1,bookName,sheetName);
session.setAttribute("docid", new Integer(docid1));
//varSession.setAttribute("docid", new Integer(docid));
writer.println(bookName);
%>I used the suggestions given in a similar thread:
http://forum.java.sun.com/thread.jspa?threadID=219818&messageID=767466
It didnt work for me...
please help!!!!1
i tried converting it into integer before setting it.. and retrieving in the form of Integer, the result remains the same.
AddUser.jsp(setting userid attribute of session here)
<%@ page import="database.DBFunctions" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page import="javax.servlet.http.HttpSession" %>
<%@ page import="read.Create" %>
<%@ page language="java" session="true" %>
<%
PrintWriter writer = response.getWriter();
//HttpSession varSession = request.getSession();
String uname = request.getParameter("UserName");
String pword = request.getParameter("PassWord");
DBFunctions func = new DBFunctions();
int bool = func.validate(uname);
if(bool==1){
func.insertLogin(uname, pword);
ResultSet rs = func.getUid(uname, pword);
if(rs.next()){
int userid = rs.getInt("uid");
//writer.println(userid);
System.out.println("adduser"+userid);
session.setAttribute("uid",new Integer(userid));
//varSession.setAttribute("uid", new Integer(userid));
Create cnew = new Create();
cnew.createUser(userid);
func.insertInActiveusers(userid, uname);
writer.println(bool);
else{
writer.println(bool);
%>Create.jsp (Getting attribute from session in integer)
<%@ page import="read.Json" %>
<%@ page import="read.Create" %>
<%@ page import="org.json.JSONObject" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page language="java" session="true" %>
<%
PrintWriter writer = response.getWriter();
//HttpSession varSession = request.getSession();
//Object uid1 = session.getAttribute("uid");
/*if(varSession.isNew()){
System.out.println("new user");
}else{
Integer a = (Integer) session.getAttribute("uid");
System.out.println("getAttribute a value : " + a);
//Object uid1 = varSession.getAttribute("uid");
Integer uid1 = (Integer) session.getAttribute("uid");
String sheetName = request.getParameter("SheetName");
String bookName = request.getParameter("WorkBook");
writer.println(bookName);
writer.println((Integer)uid1);
Create cdoc = new Create();
int docid1 = cdoc.createDoc(uid1,bookName,sheetName);
session.setAttribute("docid", new Integer(docid1));
//varSession.setAttribute("docid", new Integer(docid));
writer.println(bookName);
%>
Similar Messages
-
Stateful session bean returns null
Hi,
I call a stateful session bean which should return a Long object. Everything works fine while the bean executes and the Long object is returned by the bean.
But in the EJB-Client I get a null object.
The EJB-Client is a OC4J 10g standalone server and the EJB-Server is a OC4J 9.03 server, both running on the same machine.
Here are the JNDI properties:
java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
java.naming.provider.url=ormi://localhost:23791/ws
java.naming.security.principal=admin
java.naming.security.credentials=slash
dedicated.rmicontext=true
dedicated.connection=true
Thanks for your help,
A.Hi,
Store HomeObject or EJB Object in the Session in the WebTier.
Anil -
I'm encountering a rather perplexing issue when using the getAttribute method of the Row interface.
I have a view object defined and it returns 13 columns worth of data.
Once I have executed the query and attempt to read the results using the getAttribute method, I receive a null on a field that I know is not blank.
The following is the query that is executing for the view:
ViewObject vPri = getDBTransaction().getRootApplicationModule().findViewObject("Priority_WRST_View");
vPri.setWhereClause("WucstormPr.PRIORITY >= " + nPri);
vPri.executeQuery();
System.out.println(vPri.getQuery());
SELECT wucstormpr.CALL, wucstormpr.priority, wucstorm.locdescription,
wucstorm.CALL AS call1, wucstorm.quadrant, wucstorm.codetype,
wucstorm.idplant, wucstorm.circuit, wucstorm.feeder,
wucstorm.transformer, wucstorm.MAP, wucstorm.description,
wucstorm.status
FROM wucstorm_pr wucstormpr, wucstorm wucstorm
WHERE (wucstormpr.CALL = wucstorm.CALL)
AND wucstorm.status = 'WRST'
AND (wucstormpr.priority >= 10)
ORDER BY wucstormpr.priority
The query returns 6 rows of data.
When I attempt to run the following code, the value returned is a null, which I know is not true since the query is limiting the records based on this field.
Row rPri = null;
while (vPri.hasNext())
rPri = vPri.next();
Object oOldNum = rPri.getAttribute("Priority");
String sOldNum = String.valueOf(oOldNum);
System.out.println("***** " + sOldNum);
When I run the above code for any one of the other 12 fields, the anticipated value is returned. It just doesn't seem to work for the "Priority" field. I've verified that the Attribute name is correct and I've also tried to access the value using its' index instead of the name...with the same result.
Does anyone have any ideas why this would be occuring?
Thanx in advance,
ElderHere is the stack trace being generated when I attempt to retrieve the value in the Priority field using the appropriate accessor method.
Does anyone have any ideas on why this is occurring?
oracle.jbo.AttrSetValException: JBO-27020: Set method for attribute "Status" in Wucstorm could not be resolved.
at oracle.jbo.server.EntityImpl.setAttribute(EntityImpl.java:863)
at oracle.jbo.server.ViewRowStorage.setAttributeValue(ViewRowStorage.java:952)
at oracle.jbo.server.ViewRowStorage.setAttributeInternal(ViewRowStorage.java:873)
at oracle.jbo.server.ViewRowImpl.setAttributeInternal(ViewRowImpl.java:1011)
at oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(ViewRowImpl.java:988)
at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:753)
at oracle.jbo.uicli.binding.JUCtrlValueBinding.setAttributeInRow(JUCtrlValueBinding.java:469)
at oracle.jbo.uicli.binding.JUCtrlValueBinding.setAttribute(JUCtrlValueBinding.java:552)
at oracle.jbo.uicli.jui.JUTextFieldBinding.setDataValueAt(JUTextFieldBinding.java:209)
at Wucstorm_app.Wucstorm_Main_Panel.MaxButton_Status_actionPerformed(Wucstorm_Main_Panel.java:706)
at Wucstorm_app.Wucstorm_Main_Panel.access$5000371(Wucstorm_Main_Panel.java:39)
at Wucstorm_app.Wucstorm_Main_Panel$4.actionPerformed(Wucstorm_Main_Panel.java:356)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
## Detail 0 ##
java.lang.NumberFormatException: For input string: "null"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:468)
at java.lang.Integer.valueOf(Integer.java:574)
at Wucstorm_bcPack.WucstormImpl.setStatus(WucstormImpl.java:213)
at Wucstorm_bcPack.WucstormImpl.setAttrInvokeAccessor(WucstormImpl.java:801)
at oracle.jbo.server.EntityImpl.setAttribute(EntityImpl.java:816)
at oracle.jbo.server.ViewRowStorage.setAttributeValue(ViewRowStorage.java:952)
at oracle.jbo.server.ViewRowStorage.setAttributeInternal(ViewRowStorage.java:873)
at oracle.jbo.server.ViewRowImpl.setAttributeInternal(ViewRowImpl.java:1011)
at oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(ViewRowImpl.java:988)
at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:753)
at oracle.jbo.uicli.binding.JUCtrlValueBinding.setAttributeInRow(JUCtrlValueBinding.java:469)
at oracle.jbo.uicli.binding.JUCtrlValueBinding.setAttribute(JUCtrlValueBinding.java:552)
at oracle.jbo.uicli.jui.JUTextFieldBinding.setDataValueAt(JUTextFieldBinding.java:209)
at Wucstorm_app.Wucstorm_Main_Panel.MaxButton_Status_actionPerformed(Wucstorm_Main_Panel.java:706)
at Wucstorm_app.Wucstorm_Main_Panel.access$5000371(Wucstorm_Main_Panel.java:39)
at Wucstorm_app.Wucstorm_Main_Panel$4.actionPerformed(Wucstorm_Main_Panel.java:356)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100) -
Is there a way to put session.getAttribute() in a variable
Hi, title says it all.
I'm trying to put session.getAttribute("xxx") in an integer variable and it does not work.
int NoTech = Integer.parseInt(session.getAttribute("noTech"));
does not seems to work.
thanks, any help is appreciated :)What is the type of "xxx"
Is it a String, and Integer, an Object?
session.getAttribute() returns an Object.
You need to cast that object to its proper type before you can use it.
It would complain about parseInt, because that expects a String as an argument not an Object.
If the attribute is an Integer object then:
int noTech = ((Integer)session.getAttribute("noTech")).intValue();
if the attribute is a String then:
int noTech = Integer.parseInt( (String)session.getAttribute("noTech"));
Cheers,
evnafets -
Session.getAttribute("somekey") returning NULL in SessionDestroyed
Hi all,
session.getAttribute("somekey") is returning null in SessionDestroyed() method of flex listener.
Below are the steps I am following
1) I am adding flexLister in contextInitialized method of ServletContextListener
FlexSession.addSessionCreateListener(myListener)
2) In sessionCreate method
sessionCreated(FlexSession session) {
session.addSessionDestroyListener(this)
3) some where in applicaion I am putting a key vlaue pair in session like this
FlexContext.getSession().setAttribute("somekey" , someVlue) ;
The issue is when I try to retreive vale from session
her is how I m retreiving value
sessionDestroyed(FlexSession session) {
session.getAttribute("somekey"); this return null WHY ?
This is always returning me null
Pls note that I am RTMP channel and version of LCDS is 2.6
I also tried RTMPFlexSession
RTMPFlexSession.addSessionCreateListener(myListener)
but no luck , still got null
Am I doing anything wrong ?
One more doubt, how to explicitly put data in RTMPFlexSeesion. FlexContex.getSession () always return HttpSession and I always hence I always end up putting attribute in unintended place.
Thanks ,
DharmendraHi,
I really apologize for posting irrelevant question. I was not really aware of what do you mean by Lingo Director..
Thanks for suggestions and reply.
Regards,
Dharmendra -
Existing session is becoming null when returning from jsp
Hi Guys !
I have an urgent requirement to meet in few days from now and got stuck with session problem in servlet.
Scenario :-
For the first time when i call a servlet a new sessoin is created and after some validations i forward to a jsp which has some links.
I have printed sessoin ids from both the servlet and jsp and they are same.
Now when i clicked on the link in jsp , the servlet is called but session is lost its becoming null.
Servlet Code :
HttpSession session = request.getSession(false);
if(session ==null){
// create session code ....using getSession(true)
RequestDispatcher r = servletcontext.getRequestDispatcher(resp.encodeURL("/user.jsp"));
jsp code:-
<a href="<%=response.encodeURL(/application/servlet/ViewUser") %">" > View User </a>
GUYS GIVE ME A SUGGESTION IN THIS REGARD AS SOON AS POSSIBLE .....
Thanks in advance !
Aparna</a>Hi,
Session Create Code in Login file
HttpSession hs = req.getSession( true );
hs.setAttribute( "user", lb.getUsername() ); // username() is ur unique id
Session Tracking code in all file
HttpSession hs=request.getSession();
if ( hs == null || hs.getAttribute( "user" ) == null )
response.sendRedirect ( "./index.jsp" );
Logout code
HttpSession hs=req.getSession(false);
hs.setAttribute( "user", null );
hs.invalidate();
res.sendRedirect ( "./index.jsp" );
// I hope this snippet will help u.. -
GetAttribute() method of a view object is returning NULL
Hi ,
I am trying to implement PPR in one of my OAF page and I have taken the following approach.
I have declared the follwing transient boolean attribute in the VO() apart from the existing attribute "Meaning" .
1.MfgEnttity
2.MfgAcct
3.MfgSubAcct
4.MfgCc
5.MfgProj
In the page I have used these attributes in the rendered property as "${oa.XXR2RMfgproSegVO.MfgSubAcct}" like this.
Now in the CO I have written the following code.
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("initializeXXR2RMfgproSegVO");
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
String event = pageContext.getParameter(EVENT_PARAM);
String source = pageContext.getParameter(SOURCE_PARAM);
OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
am.invokeMethod("handleSegmentChangeEvent");
And the AM code is as follows:
public void initializeXXR2RMfgproSegVO()
OAViewObject vo = getXXR2RMfgproSegVO();
if(!vo.isPreparedForExecution())
vo.executeQuery();
Row row = vo.createRow();
vo.insertRow(row);
row.setNewRowState(Row.STATUS_INITIALIZED);
public void handleSegmentChangeEvent()
OAViewObject pVO = (OAViewObject)findViewObject("XXR2RMfgproSegVO");
OARow hdrRow = (OARow)pVO.getCurrentRow();
String status = (String)hdrRow.getAttribute("Meaning");
System.out.println("poRow "+ hdrRow.toString());
System.out.println("value of the status is "+ status);
if("Entity".equals(status))
hdrRow.setAttribute("MfgEnttity", Boolean.TRUE);
hdrRow.setAttribute("MfgAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgSubAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgCc", Boolean.FALSE);
hdrRow.setAttribute("MfgProj", Boolean.FALSE);
} else
if("Account".equals(status))
hdrRow.setAttribute("MfgEnttity", Boolean.FALSE);
hdrRow.setAttribute("MfgAcct", Boolean.TRUE);
hdrRow.setAttribute("MfgSubAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgCc", Boolean.FALSE);
hdrRow.setAttribute("MfgProj", Boolean.FALSE);
}else
if("Subaccount".equals(status))
hdrRow.setAttribute("MfgEnttity", Boolean.FALSE);
hdrRow.setAttribute("MfgAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgSubAcct", Boolean.TRUE);
hdrRow.setAttribute("MfgCc", Boolean.FALSE);
hdrRow.setAttribute("MfgProj", Boolean.FALSE);
}else
if("Cost Center".equals(status))
hdrRow.setAttribute("MfgEnttity", Boolean.FALSE);
hdrRow.setAttribute("MfgAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgSubAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgCc", Boolean.TRUE);
hdrRow.setAttribute("MfgProj", Boolean.FALSE);
} else
if("Project".equals(status))
hdrRow.setAttribute("MfgEnttity", Boolean.FALSE);
hdrRow.setAttribute("MfgAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgSubAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgCc", Boolean.FALSE);
hdrRow.setAttribute("MfgProj", Boolean.TRUE);
else
hdrRow.setAttribute("MfgEnttity", Boolean.FALSE);
hdrRow.setAttribute("MfgAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgSubAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgCc", Boolean.FALSE);
hdrRow.setAttribute("MfgProj", Boolean.FALSE);
Now when in the page I am changing the value of the attribute "Meaning" it is always getting into the else part i.e. where all the attributes are "False".
The two System.out.Println statements are returning the follwing values.
10/03/22 15:41:08 poRow [email protected]3
10/03/22 15:41:08 value of the status is null
Can you please suggest why this "Status" is returning NULL and how I can get the current row selected in the page?
Thanks
SubhabrataHi Pratap,
Thanks a lot for your reply.
Can you please suggest how can I rectify the code.I have tried commenting the AM code as follows
public void initializeXXR2RMfgproSegVO()
OAViewObject vo = getXXR2RMfgproSegVO();
if(!vo.isPreparedForExecution())
vo.executeQuery();
//Row row = vo.createRow();
//vo.insertRow(row);
//row.setNewRowState(Row.STATUS_INITIALIZED);
But in the page when I am selecting any segment its throwing Null pointer Exception.
I am new in OAF and this is an urgent client requirement.Please suggest me Where exactly I need to make change in my code.
Thanks in advance...
Thanks
Subhabrata -
SelectedItem return null when hit the NEXT page or Submit
Hello All,
I try to add the paging to the open source Alfresco content management. We need to process a large dataset (e.g. > 50K files) so after we gather a list of data files we display them with the checkbox and each checkbox has default checked status.
If the value="#{FixItemList.selectedItems} is omitted in the <h:selectManyCheckbox> then the paging is fine when hitting the NEXT page or Submit button. If we set the value in the selectManyCheckbox then it returns null for selectedItems.
Would please point out what I have done wrong? Appreciate for all yours helps.
This is the managed bean object.
public class ToolsContext
private FixItemList fixItemList;
private ToolsContext()
this.fixItemList = new FixItemList();
public void addFix(Fix fix) {
if(fix != null) {
fixItemList.addFixItem(new SelectItem(fix, fix.getPath(), fix.getDetails(), false));
fixItemList.addFixSelectedItems("" + fix + "");
public class FixItemList implements Serializable
private static final long serialVersionUID = 123784764562L;
private List<SelectItem> items;
private List<String> selectedItems;
private int displayItemPerPage;
public FixItemList() {
displayItemPerPage = 100;
items = new ArrayList<SelectItem>();
selectedItems = new ArrayList<String>();
public void setItems(List<SelectItem> items) {
this.items = items;
public List<SelectItem> getItems() {
return this.items;
public int getItemsSize() {
return this.items.size();
public int getDisplayItemPerPage() {
return this.displayItemPerPage;
public void setDisplayItemPerPage(int displayItemPerPage) {
this.displayItemPerPage = displayItemPerPage;
public void addFixItem(SelectItem selectItem) {
items.add(selectItem);
public List<String> getSelectedItems() {
return selectedItems;
public void setSelectedItems(List<String> selectedItems) {
this.selectedItems = selectedItems;
public void addFixSelectedItems(String selectedItem) {
selectedItems.add(selectedItem);
}My faces-config.xml
<managed-bean>
<description>
This bean is to display in the Web Project tool as the pagination. HOPEFULLY SO
</description>
<managed-bean-name>FixItemList</managed-bean-name>
<managed-bean-class>org.alfresco.module.websitetools.util.FixItemList</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>The JSP page.
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ taglib uri="/WEB-INF/wcm.tld" prefix="w" %>
<w:avmList id="files-list" viewMode="details" pageSize="#{FixItemList.displayItemPerPage}" styleClass="recordSet"
headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
value="#{FixItemList.items}" var="row">
<%-- checkbox column --%>
<a:column id="col1" primary="true" width="5" style="padding:2px;text-align:left">
<h:selectManyCheckbox id="wpt" value="#{FixItemList.selectedItems}">
<f:selectItem itemLabel="#{row.label}" itemValue="#{row.value}" />
</h:selectManyCheckbox>
</a:column>
<%-- file name column --%>
<a:column id="col2" primary="true" width="50%" style="padding:2px;text-align:left">
<h:outputText value="#{row.description}" />
</a:column>
<a:dataPager id="pager1" styleClass="pager" />
</w:avmList>When I hit the NEXT page the #FixItemList.selectedItem return null. We use myface version 1.1.5. And below is the stack error
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException
at javax.faces.component._SelectItemsIterator.hasNext(_SelectItemsIterator.java:73)
at javax.faces.component.UISelectMany.validateValue(UISelectMany.java:268)
at javax.faces.component.UIInput.validate(UIInput.java:354)
at javax.faces.component.UISelectMany.validate(UISelectMany.java:297)
at javax.faces.component.UIInput.processValidators(UIInput.java:184)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:627)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:627)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:627)
at javax.faces.component.UIForm.processValidators(UIForm.java:73)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:627)
at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:149)
at org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:32)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:104)Appreciate for all yours helps,
AnhI put the print out statement in the _SelectItemsIterator and found out that the selected item's value doesn't binding. How would I be able to select an item? Attached is the code with debug print out in the SelectItemsIterator.
Would some one please point me a direction? Appreciate.
public boolean hasNext()
if(_nextItem != null)
return true;
if(_nestedItems != null)
if(_nestedItems.hasNext())
return true;
_nestedItems = null;
if(_childs.hasNext())
UIComponent child = (UIComponent)_childs.next();
getLogger().debug("-----_SelectItemsIterator---child is UIComponent---" + child.getChildCount());
getLogger().debug("-----_SelectItemsIterator---child is UIComponent---" + child.getAttributes());
Map m = child.getAttributes();
Set s = m.keySet();
Iterator i= s.iterator();
while (i.hasNext()) {
getLogger().debug("value = " + m.get(i.next()));
if(child instanceof UISelectItem)
UISelectItem uiSelectItem = (UISelectItem)child;
Object item = uiSelectItem.getValue();
getLogger().debug("-----_SelectItemsIterator---child is UISelectItem---getValue()--" + item);
if(item == null)
Object itemValue = ((UISelectItem)child).getItemValue();
String label = ((UISelectItem)child).getItemLabel();
String description = ((UISelectItem)child).getItemDescription();
boolean disabled = ((UISelectItem)child).isItemDisabled();
if(label == null)
label = itemValue.toString(); //////////////////////IT THROWS THE EXCEPTION HERE, BECAUSE THE
///itemValue is null
item = new SelectItem(itemValue, label, description, disabled);
getLogger().debug("-----_SelectItemsIterator---create item - label---" + label);
getLogger().debug("-----_SelectItemsIterator---create item - descp---" + description);
getLogger().debug("-----_SelectItemsIterator---create item - disable---" + disabled);
getLogger().debug("-----_SelectItemsIterator---create item - itemValue--" + itemValue);
} -
Kff.where returns 'null' and causes sql error - looking for a work around
Hello,
I am using BI 5.6.3 in EBS (11.5.10.2)
I have created a kff.where as follows:
<lexical
type="oracle.apps.fnd.flex.kff.where"
name="lp_location_where_clause"
comment="Comment"
application_short_name="OFA"
id_flex_code="LOC#"
id_flex_num=":lp_location_flex_structure"
code_combination_table_alias="loc"
segments="ALL"
operator="BETWEEN"
operand1=":p_location_low"
operand2=":p_location_high"/>
</lexicals>
Everything works fine, as long as I have a values for the p_location_low and p_location_high. However, this is a parameter that comes in from a concurrent program and is optional. When the user doesn't pick a value, :p_location_low is the concatenated delimiters for the location '..'.
When this runs, the kff.where is returning null which causes 'Invalid Relational Operation error' because 'AND null' is not valid.
Warning in the log is :[091910_025232517][][STATEMENT] !!Warning: FlexAPI returns null for 'x_where_expression' lexical definition...
Does anyone have a workaround for this since making the parameter required is not an option for my users?
Thanks for reading.In your SQL*Plus session, make sure you
SQL> set define offbefore trying to create the Java stored procedure. SQL*Plus assumes that any string that begins with an & is a substitution variable unless you tell it that you have no substitution variables (via set define off).
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Managed bean returns null on SetActionListener
Hi,
I'm trying to implement a filter for my table (something similar to what's done in the "OracleAS 10g R3: Oracle ADF for Forms/4GL Developers/Volume II" student guide, practice 9-5). The idea is to have a request-scoped managed bean which holds the filter value - the value is set using a SetActionListener, and later bound to a bind variable in a view with a view criteria. I have problem re-creating this in Trinidad (JDev 11 TP3, to be exact).
I have created a request-scoped bean in adfc-config.xml (called 'ecnStatusBean'), with a managed property (named 'Status'). I am referencing it from my SetActionListener: setting #{'E'} to #{requestScope.ecnStatusBean.Status}. The reference compiles fine in the Expression Builder (it didn't before I created the managed bean), but when running and clicking the CommandLink with the SetActionListener, I get a runtime error:
oracle.security.jazn.JAZNRuntimeException: Target Unreachable, 'ecnStatusBean' returned null
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:480)
To make things more interesting, I tried changing the scope to session, and got a different error:
oracle.adf.controller.ControllerException: ADFC-10001: Cannot instantiate class 'pelephone.cdma_ecn.ecn_manager.model.ecnStatusMB'.
at oracle.adfinternal.controller.util.Utils.createAndLogFacesException(Utils.java:169)
Am I doing a rookie's mistake? Is this a Trinidad issue? Something else?
Thanks in advance for any help,
BorisAre you sure about the reference you use here: #{requestScope.ecnStatusBean.Status}.
Here is a simple sample of what works for me:
The first page has this:
<af:form binding="#{backing_start.form1}" id="form1">
<af:inputText label="Label 1" binding="#{backing_start.inputText1}"
id="inputText1"/>
<af:commandButton text="commandButton 1"
binding="#{backing_start.commandButton1}"
id="commandButton1" action="go">
<af:setActionListener from="#{backing_start.inputText1.value}"
to="#{backing_start.paramToPass}"/>
</af:commandButton>
</af:form>It references a bean that has this:
private RichInputText inputText1;
public void setInputText1(RichInputText inputText1) {
this.inputText1 = inputText1;
public RichInputText getInputText1() {
return inputText1;
public String paramToPass;
public void setParamToPass(String paramToPass) {
this.paramToPass = paramToPass;
public String getParamToPass() {
return paramToPass;
}And then I can see it in the next page that I navigated to like this:
<af:outputText value="the current value is #{backing_start.paramToPass}"/>In the adf-config.xml I have this:
<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
<view id="start">
<page>/start.jspx</page>
</view>
<view id="end">
<page>/end.jspx</page>
</view>
<control-flow-rule>
<from-activity-id>start</from-activity-id>
<control-flow-case>
<from-outcome>go</from-outcome>
<to-activity-id>end</to-activity-id>
</control-flow-case>
</control-flow-rule>
<managed-bean>
<managed-bean-name>backing_start</managed-bean-name>
<managed-bean-class>backing.backing_start</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</adfc-config> -
User Exists but APEX_UTL.GET_USER_ID returns null
Hi,
I am fairly new to APEX especially the API, I have created a user via the workspace admin pages (application is using standard apex authentication scheme). I want a page to open with data shown restricted by an attribute that has been set for the user. The page computation code is simply:
begin
return apex_util.get_attribute(p_username => 'JONES', p_attribute_number => 2);
end;
(hard coding added for debug, does not work with :APP_USER):
However this is always returning null.
If I do this in SQL Developer:
apex_util.get_user_id('JONES');
I get null
If I do this :
select *
from APEX_WORKSPACE_APEX_USERS
where user_name = 'JONES'
I get data.
What am I doing wrong?? The JONES user was created via the APEX system not SQL.
Thanks in advance
ChrisChris,
the point is that you can't get values from some APEX functions running it from SQL Developer or some other tool, you can only see it in runtime of your APEX application (because of APEX session).
Here's example:
[http://apex.oracle.com/pls/apex/f?p=43478:3]
User: user
Password: xxx
apex_util.set_attribute is not a function and you can't run it from SQL, only PL/SQL...
On the other hand, you can see values from SQL developer (without APEX session) through APEX views...
Br,
Marko -
Component binding return null value
I'm migrating a JSF 1.2 application to JSF 2.1, specificly I'm currently using mojorra 2.1.24.
The application consists of request scoped beans, and in order to pass data between requests, it embeds the data inside UI components.
The following behaviour works well with JSF 1.2, but not with JSF 2.1.
The application has the following configuration:
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
The page contains the following snippet:
<h:form prependId="false">
<h:inputHidden binding="#{bean.inputHidden}" />
<h:panelGroup rendered="#{bean.rendered}">
<h:commandLink value="onAction" action="#{bean.onAction}" />
</h:panelGroup>
</h:form>
The bean is the following:
@ManagedBean
@RequestScoped
public class Bean {
private UIInput inputHidden;
private AItem item;
public setInputHidden(UIInput inputHidden){
this.inputHidden = inputHidden;
if(item != null){ this.inputHidden.setValue(item); }
public AItem getItem(){
return (AItem) getInputHidden().getValue();
// other getter/setter
public String onNavToPage(AItem item){ this.item = item; return "page"; }
public String onAction(){ //... do something return ""; }
public boolean isRendered(){ return getProcessItem() != null; }
The steps are the following:
to navigate to page page the method bean.onNavToPage is invoked from within another page;
upon page rendering the bean.item is set as bean.inputHidden value;
after the page is diplayed, the command link is pressed.
At this point no command link is invoked, because the bean.inputHidden.getValue() returns null, and the command link is not processed.
I noticed that the inputHidden parameter passed to the setInputHidden method during restore view phase has, inputHidden.getValue() == null, no value has been saved previously in the view.
I would guess that something has changed in the component state management, but debugging the JSF code I didn't find what.
Debugging JSF code I found that the component state has been masked before the state has been saved in the view, so the ComponentStateHelper.saveState saves the deltaMap and not the defaultMap, where all the state has been put.
public Object saveState(FacesContext context) {
if (context == null) {
throw new NullPointerException();
if(component.initialStateMarked()) {
return saveMap(context, deltaMap);
else {
return saveMap(context, defaultMap);
is this a bug?
If not, how can I restore JSF 1.2 behaviuor and save the defaultMap?
Thanks in advance for the help.0.10: Saved session state: 6385226710016200 "P327_OU_NAME" changedValue="test"
0.10: ...P327_FK_ORGUNIT session state saving same value: "%null%"
0.15: Saved session state: 6388922235040486 "P327_OU_DESC" changedValue=""
0.15: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
0.15: Branch point: BEFORE_COMPUTATION
0.15: Computation point: AFTER_SUBMIT
0.15: Perform Branching for Tab Requests
0.15: Branch point: BEFORE_VALIDATION
0.15: Perform validations:
0.16: Branch point: BEFORE_PROCESSING
0.16: Processing point: AFTER_SUBMIT
0.16: ...PLSQL (AFTER_SUBMIT) INSERT INTO INDIT_PS_ORGUNIT ( OU_ID, FK_ORGUNIT, OU_NAME, OU_DESC ) VALUES ( INDIT_PASS_SEQ_GENERIC_ID.NEXTVAL, :P327_FK_ORGUNIT, :P327_OU_NAME, :P327_OU_DESC )
0.16: Show ERROR page...
0.17: Processing point: AFTER_ERROR_HEADER
0.18: Processing point: BEFORE_ERROR_FOOTER
ORA-01722: invalid number
the table was created with:
CREATE TABLE INDIT_PS_ORGUNIT (
OU_ID NUMBER(15) PRIMARY KEY,
FK_ORGUNIT NUMBER(15) NULL,
OU_NAME VARCHAR2(30) NOT NULL,
OU_DESC VARCHAR2(30) NULL,
OU_DELETED DATE NULL
what i see is that the status is "%null%" and not really "" (NULL, nothing, ...).
so what can i do to insert a null value from a select list?
i gave up RTFM. because i found nothing (NULL) ?!?! -
ViewLink Accessor returning null when VO has a BindParameter
I have DeptView and EmpView that is link with a DempEmpViewLink. the link is two way so DeptView has a RowIterator Viewlink accessor and EmpView has a Row ViewLInk accessor.
However inside the employeViewRow code, I always get a Null value when I access the Dept accessor.
//inside Employee View Row.java
Row row = this.getDeptView(); //returns null
...This happens when The DeptView has a bindvariable because I need to filter the DeptView so I have a where clause on the SQL statement. However, when I remove the whereclause and the bindvariable, the Dept ViewLInk accessor returns the correct row.
regards,
AntonHi Chris,
My scenario is actually a Invoice Header and Details screen.
I have a HeaderView, DetailsView, and a HeaderDetailLink defined by a Composition Assoc. The headerView has a BindParameter on it. So on my page, I can view/navigate invoices and its details. but at the same time using the same viewobjects and same page, I need to be able to create and save a record on the header and details at the same time by just one Commit/Save. (Similar to a Forms application (header Form, and Details table).
On pageload i execute a methodaction that inserts a row on the header and the detail at the same time. Then on the jsp page, I put some values on the header. Next i put a value on a fieldA on the detail. But when I put a value on fieldA, I need to compute the value of fieldB on the detail based on fieldA and a field of the Header row, fieldHeader.
So to compute fieldB, I put a code on the settermethod of fieldA in the DetailRowImpl.java file:
//detailRowImp.java, setFieldA()
public void setFieldA(Number value) {
setAttributeInternal(FIELDA, value);
... Row row = getHeaderRow(); //returns null
Number fieldbValue = compute(value, row.getAttribute("FieldC")); //NullPointerException
}What are your thoughts? any suggestions?
regards,
Anton -
GetContextURL returns null using the default ECM repository
Hello experts,
This is the scenario.
We are using the SAP ECM repositoy for document storage in our BPM proyect. In this case we are using the default configuration and repository location (ecm/default and DefaultUser), but after the upload, when i try to get the document URL with the method getContentURL(), returns null.
The ECM documentarion saids than this condition is expected when using a third party repostiory, but this is not the case.
I appreciate a lot your advices and recomendations,
Best regards!
Julio C. LeyvaHi Vasil,
We didn't resolve this issue by this method, because we are using the default ECM repository witch doesn't support the operation getContextURL() and gets the "null" result. If you are using a different repository maybe works.
Re-checking the API specification, saids:
getContentURL
java.lang.String getContentURL() throws InvalidStateException, RepositoryException Returns a URL that can be used to retrieve the content directly from the respective backend, thus bypassing ECM. Note that this URL might have several restrictions which depend on the connector's backend store, such as a limited lifetime or requiring a user to authenticate with different credentials than the ones used to connect to ECM. Other stores might provide no content URL at all, in which case this method returns null. Applications might want to consider utilizing the ECM WebDAV server to present their users a URL that is located on the same system as ECM.
Finally, you would consider to expose a webservice (EJB Session Bean) witch encapsulates the ECMI implementation and extract your file content as a binary array (encode/decode), sending as the input your path/fileName for lookup in the ECM repository.
Regards! -
EJBs cannot return null when used in Model?
Hi,
hopefully this question is in the right place.
I´ve spent now a few days on tracking a single problem. I am trying to create an web dynpro application with the functionality contained in EJBs. One of my methods in a stateless SessionBean returns an object or null. This SessionBean is bound via model binding to the context of a component controller. Everything works fine as along as the method call returns an object, but if it does not (which is the usual case) the application throws an empty exception without any description. Thanks to this forum i checked the defaultTrace log and found this information:
[EXCEPTION]
{0}#1#java.lang.NullPointerException
at com.sap.tc.webdynpro.model.ejb.model.EJBGenericModelClassExecutable.setPropertiesForModelClass(EJBGenericModelClassExecutable.java:429)
at com.sap.tc.webdynpro.model.ejb.model.EJBGenericModelClassExecutable.fillReturnParameterToMc(EJBGenericModelClassExecutable.java:634)
at com.sap.tc.webdynpro.model.ejb.model.EJBGenericModelClassExecutable.execute(EJBGenericModelClassExecutable.java:135)
at com.test.testprog.testprogwebdynpro.main.Main.doLogin(Main.java:243)
at com.test.testprog.testprogwebdynpro.main.wdp.InternalMain.doLogin(InternalMain.java:213)
at com.test.testprog.testprogwebdynpro.main.LoginView.onActionButtonEinloggen(LoginView.java:189)
at com.test.testprog.testprogwebdynpro.main.wdp.InternalLoginView.wdInvokeEventHandler(InternalLoginView.java:139)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:131)
at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:72)
at com.sap.tc.webdynpro.clientserver.phases.ProcessingEventPhase.doHandleActionEvent(ProcessingEventPhase.java:156)
at com.sap.tc.webdynpro.clientserver.phases.ProcessingEventPhase.execute(ProcessingEventPhase.java:91)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequestPartly(WindowPhaseModel.java:161)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doProcessRequest(WindowPhaseModel.java:109)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:96)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:469)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:52)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.doExecute(ClientApplication.java:1431)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.doProcessing(ClientApplication.java:1251)
at com.sap.tc.webdynpro.serverimpl.core.sessionctx.AbstractExecutionContextDispatcher.delegateToApplicationDoProcessing(AbstractExecutionContextDispatcher.java:158)
at com.sap.tc.webdynpro.serverimpl.wdc.sessionctx.DispatchHandlerForAppProcessing.doService(DispatchHandlerForAppProcessing.java:35)
at com.sap.tc.webdynpro.serverimpl.wdc.sessionctx.AbstractDispatchHandler.service(AbstractDispatchHandler.java:116)
at com.sap.engine.services.servlets_jsp.server.deploy.impl.module.IRequestDispatcherImpl.dispatch(IRequestDispatcherImpl.java:93)
at com.sap.tc.webdynpro.serverimpl.wdc.sessionctx.ExecutionContextDispatcher.dispatchToApplicationDoProcessing(ExecutionContextDispatcher.java:114)
at com.sap.tc.webdynpro.serverimpl.core.sessionctx.AbstractExecutionContextDispatcher.dispatch(AbstractExecutionContextDispatcher.java:81)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.dispatch(ApplicationSession.java:507)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.dispatch(ApplicationSession.java:527)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doApplicationProcessingStandalone(ApplicationSession.java:458)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:249)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:699)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:231)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:231)
at com.sap.tc.webdynpro.serverimpl.core.sessionctx.AbstractExecutionContextDispatcher.delegateToRequestManager(AbstractExecutionContextDispatcher.java:205)
at com.sap.tc.webdynpro.serverimpl.wdc.sessionctx.DispatchHandlerForRequestManager.doService(DispatchHandlerForRequestManager.java:38)
at com.sap.tc.webdynpro.serverimpl.wdc.sessionctx.AbstractDispatchHandler.service(AbstractDispatchHandler.java:116)
at com.sap.engine.services.servlets_jsp.server.deploy.impl.module.IRequestDispatcherImpl.dispatch(IRequestDispatcherImpl.java:93)
at com.sap.tc.webdynpro.serverimpl.wdc.sessionctx.ExecutionContextDispatcher.dispatchToRequestManager(ExecutionContextDispatcher.java:140)
at com.sap.tc.webdynpro.serverimpl.core.sessionctx.AbstractExecutionContextDispatcher.dispatch(AbstractExecutionContextDispatcher.java:93)
at com.sap.tc.webdynpro.serverimpl.core.sessionctx.AbstractExecutionContextDispatcher.dispatch(AbstractExecutionContextDispatcher.java:105)
at com.sap.tc.webdynpro.serverimpl.core.AbstractDispatcherServlet.doContent(AbstractDispatcherServlet.java:87)
at com.sap.tc.webdynpro.serverimpl.core.AbstractDispatcherServlet.doPost(AbstractDispatcherServlet.java:61)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:66)
at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:32)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:431)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:289)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:376)
at com.sap.engine.services.servlets_jsp.filters.ServletSelector.process(ServletSelector.java:85)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
at com.sap.engine.services.servlets_jsp.filters.ApplicationSelector.process(ApplicationSelector.java:160)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
at com.sap.engine.services.httpserver.filters.WebContainerInvoker.process(WebContainerInvoker.java:67)
at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
at com.sap.engine.services.httpserver.filters.ResponseLogWriter.process(ResponseLogWriter.java:60)
at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
at com.sap.engine.services.httpserver.filters.DefineHostFilter.process(DefineHostFilter.java:27)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
at com.sap.engine.services.httpserver.filters.MonitoringFilter.process(MonitoringFilter.java:29)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
at com.sap.engine.services.httpserver.server.Processor.chainedRequest(Processor.java:309)
at com.sap.engine.services.httpserver.server.Processor$FCAProcessorThread.run(Processor.java:222)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:152)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:247)
The request has the cardinality 1..1, the response 0..1 and the return value 1..1. The last one cannot be changed.
Is that correct that an EJB method call must return an valid object or do i have to change something in order to allow the return of null? Or is this a bug?
Thanks for any answer in advanceHi,
what are you returning? Objects or basic types? When the methods says it returns a string, a null object is no problem. Btw. i cannot set the cardinality of the of the return node. It´s fixed as 1..1.
My session bean looks so
@Stateless(name="TestBean")
@WebService
public class TestBean implements TestLocal {
public int add(int zahl1, int zahl2)
return zahl1 + zahl2;
public String concat(String text1, String text2)
return text1.concat(text2);
public String zeroString(String text1)
return null;
public User zeroUser(String text1)
return null;
The WDP Controller Method looks like this
public void doejbtest( ) {
//@@begin doejbtest()
try
IZeroStringRequestElement req = wdContext.currentZeroStringRequestElement();
Request_TestLocal_zeroString obj = req.modelObject();
req.setText1("test");
obj.execute();
wdComponentAPI.getMessageManager().reportWarning("String request was successful");
catch(Exception e)
wdComponentAPI.getMessageManager().reportException("String request failed");
wdComponentAPI.getMessageManager().raisePendingException();
try
IZeroUserRequestElement req = wdContext.currentZeroUserRequestElement();
Request_TestLocal_zeroUser obj = req.modelObject();
req.setText1("test");
obj.execute();
wdComponentAPI.getMessageManager().reportWarning("User request was successful");
catch(Exception e)
wdComponentAPI.getMessageManager().reportException("User request failed");
wdComponentAPI.getMessageManager().raisePendingException();
//@@end
The result of the call is
Warning: String request was successful
Error: User request failed
The Cardinalities are:
Request Cardinality : 1..1
Response Cardinality : 0..1
Return Cardinaliy : 1..1 (no value for the string, fixed for the user)
Maybe you are looking for
-
How to avoid duplication of mails on Mac book and I phone
Am using Apple mail on Mac Book Lion version & I phone 4 with IOS. Am using corporate mail server ie [email protected] Despite having done the mail settngs with the option - Delete mail immediately on removing the mail from Inbox, the same ma
-
Aperture - Unable to share photos, by email and or Facebook
When trying to share a photo/s using Aperture 3.4.1 on a MacBook Air version OSX 10.8.2 1. by email, nothing happens - despite having set Microsoft Outlook and tried different sizes of jpg photos 2. by trying to send to Facebook, after trying to logi
-
New notebook only has headphone out and mic in -- Will any Creative speakers work?
Hello all: My new notebook only has a headphone out and mic in, and no audio out as you see on desktop PCs. I prefer not to use my USBs as I have other devices using them. Are there any Creative speakers which can use the headphone output and convert
-
Reconcilation BOM and WIP to GL
Hi, Can any one of you please tell me how to reconcile BOM and WIP to GL Regards Swetha
-
hello all, workin on my first ever flash website, and its pretty much finished. im having problems with centering my site. i know its an issue that has allready alot of posts and i have looked then all up but all i managed to do from what i learned f