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 ,
Dharmendra
Hi,
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
Similar Messages
-
Autocasting and session.getAttribute() in Java 1.5
I am trying to migrate an application to Java 1.5 and I'm having difficulties with the session.getAttribute() method and autocasting.
I have a Hashtable which I declare like below:
Hashtable<String,AdmUserData> data = new Hashtable<String,AdmUserData>();
AdmUserData is a class I use. This declaration works fine.
I use the HttpSession object to store this Hashtable:
session.setAttribute("user_data", data);
The problem I have is when I try to get the Hashtable from the session object:
Hashtable<String,AdmUserData> data = session.getAttribute("user_data");
This gives me an error of "incompatible types":
incompatible types
found : java.lang.Object
required: java.util.Hashtable<java.lang.String,cy.com.netinfo.util.AdmUserData>
session.getAttribute() method returns Object; why doesn't autocasting work in this case and how can I manage to overcome this problem?
I tried the following with no success:
Hashtable<String,AdmUserData> data = (Hashtable)session.getAttribute("user_data");
I also tried the following again with no success:
Hashtable<String,AdmUserData> data = (Hashtable<String,AdmUserData>)session.getAttribute("user_data");
Thanx
Demetris.incompatible types
found : java.lang.Object
required:
java.util.Hashtable<java.lang.String,cy.com.netinfo.ut
il.AdmUserData>I would suggest you not to use generics here. I doubt if the J2EE libraries still support / use that. -
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!!!!1i 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);
%> -
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 -
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 -
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) -
Target Unreachable " beanInstanceName " returned Null
Hi All,
I am attending ADF training from Oracle University. Today is last day of training. I am having problem with running a simple application and couldn't get proper answer for the below issue.
Created a Fusion WebApplication "Test" with Model and ViewController Project.
Created a ManagedBean "TestBean", Taskflow "TestFlow", Jsff page in taskflow "TestJsff" and one "TestJspx" page.
Registered the TestBean with Taskflow in request Scope.
Created a property String name ="Ram" in Managed Bean with accessor for the property.
Created a outputText Component on TestJsff and set the value property to "#{requestScope.TestBean.name}".
Dragged the TestJsff to Taskflow and TestFlow to TestJspx.
Running the TestJspx page and I see the error " Target Unreachable TestBean returned null."
I don't know what to do ???
Thanks in Advance ...........
RajdeepThis is a common mistake using EL.
The problem is that #{requestScope.Beanname.attribute} references only objects (beans) in memory, but don't create them when they are not there. So you get a NPE if you refer to a bean the first time (when it's not instantiated already). This is true for all JSF scopes (session, request and application).
The other scopes added by the ADFrc life cycle (view, pageflow and backingbean) behave different because of the extended ADFrc controller. The controller looks for these special scopes and handles them (e.g. create the object if it's not there).
Frank Nimphius recorded a screen cast about common mistakes using ADF. If you like you can watch it here:
http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/classic_api_mistakes_part2/classic_api_mistakes_part2.html
Timo -
Hi!
I use Kodo 3.0 + Weblogic 7.4 + MySQL.
I followed the tutorial, and deployed a session bean to query the database.
The connection was OK, but the result returned null.
Did I miss something?
Here is the server log:
====
CategorySessionBean : Contruct CategorySessionBean
CategorySessionBean : getCategoryList :
[INFO] JDBC - -Using dictionary class "kodo.jdbc.sql.MySQLDictionary" (MySQL
4.0.14-nt ,MySQL-AB JDBC Driver 3.0.8-stable ( $Date: 2003/05/19 00:57:19 $,
$Revision: 1.27.2.18 $ )).
CategorySessionBean : Extent : kodo.jdbc.runtime.JDBCExtent@3a0946
====
Here is the test log:
====
-- Initializing bean access.
-- Succeeded initializing bean access through Home interface.
-- Execution time: 5484 ms.
-- Calling create()
-- Succeeded: create()
-- Execution time: 141 ms.
-- Return value from create():
[email protected]23756.
-- Calling getCategoryList()
-- Succeeded: getCategoryList()
-- Execution time: 1000 ms.
-- Return value from getCategoryList(): [].
====
The query code is:
====
pm = connectionFactory.getPersistenceManager();
Extent categoryExtent = pm.getExtent(Category.class, true);
out("Extent : " + categoryExtent.toString());
for (Iterator i = categoryExtent.iterator (); i.hasNext ();)
categoryList.add((Category) i.next());
categoryExtent.closeAll ();
====
The connection code is:
====
Properties properties = new Properties();
properties.put("kodo.LicenseKey","*****");
properties.put("javax.jdo.PersistenceManagerFactoryClass",
"kodo.jdbc.runtime.JDBCPersistenceManagerFactory");
properties.put("javax.jdo.option.ConnectionDriverName",
"com.mysql.jdbc.Driver");
properties.put("javax.jdo.option.ConnectionURL",
"jdbc:mysql://localhost/nccudb");
properties.put("javax.jdo.option.ConnectionUserName", "root");
properties.put("javax.jdo.option.ConnectionPassword", "****");
properties.put("javax.jdo.option.Optimistic","true");
properties.put("javax.jdo.option.RetainValues","true");
properties.put("javax.jdo.option.NontransactionalRead","true");
connectionFactory = JDOHelper.getPersistenceManagerFactory(properties);
====
The JDO metadata is:
====
<jdo>
<package name="nccu.petstore.jdo">
<class name="Category" objectid-class="CategoryId">
<extension vendor-name="kodo" key="jdbc-class-map" value="base">
<extension vendor-name="kodo" key="table" value="category"/>
</extension>
<field name="catid" primary-key="true">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="catid"/>
</extension>
</field>
<field name="descn">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="descn"/>
</extension>
</field>
<field name="image">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="image"/>
</extension>
</field>
<field name="name">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column" value="name"/>
</extension>
</field>
</class>
</package>
</jdo>
====
Any help is appreciated,
Ceilo Huang.Can you see if the iterator is returning anything in your bean? You
should also try setting the SQL logging channel to TRACE (see the
Logging section of our docs) to see if the SQL generated is valid.
Ceilo Huang wrote:
Hi!
I use Kodo 3.0 + Weblogic 7.4 + MySQL.
I followed the tutorial, and deployed a session bean to query the database.
The connection was OK, but the result returned null.
Did I miss something?
Here is the server log:
====
CategorySessionBean : Contruct CategorySessionBean
CategorySessionBean : getCategoryList :
[INFO] JDBC - -Using dictionary class "kodo.jdbc.sql.MySQLDictionary" (MySQL
4.0.14-nt ,MySQL-AB JDBC Driver 3.0.8-stable ( $Date: 2003/05/19 00:57:19 $,
$Revision: 1.27.2.18 $ )).
CategorySessionBean : Extent : kodo.jdbc.runtime.JDBCExtent@3a0946
====
Here is the test log:
====
-- Initializing bean access.
-- Succeeded initializing bean access through Home interface.
-- Execution time: 5484 ms.
-- Calling create()
-- Succeeded: create()
-- Execution time: 141 ms.
-- Return value from create():
[email protected]23756.
-- Calling getCategoryList()
-- Succeeded: getCategoryList()
-- Execution time: 1000 ms.
-- Return value from getCategoryList(): [].
====
The query code is:
====
pm = connectionFactory.getPersistenceManager();
Extent categoryExtent = pm.getExtent(Category.class, true);
out("Extent : " + categoryExtent.toString());
for (Iterator i = categoryExtent.iterator (); i.hasNext ();)
categoryList.add((Category) i.next());
categoryExtent.closeAll ();
====
The connection code is:
====
Properties properties = new Properties();
properties.put("kodo.LicenseKey","*****");
properties.put("javax.jdo.PersistenceManagerFactoryClass",
"kodo.jdbc.runtime.JDBCPersistenceManagerFactory");
properties.put("javax.jdo.option.ConnectionDriverName",
"com.mysql.jdbc.Driver");
properties.put("javax.jdo.option.ConnectionURL",
"jdbc:mysql://localhost/nccudb");
properties.put("javax.jdo.option.ConnectionUserName", "root");
properties.put("javax.jdo.option.ConnectionPassword", "****");
properties.put("javax.jdo.option.Optimistic","true");
properties.put("javax.jdo.option.RetainValues","true");
properties.put("javax.jdo.option.NontransactionalRead","true");
connectionFactory = JDOHelper.getPersistenceManagerFactory(properties);
====
The JDO metadata is:
====
<jdo>
<package name="nccu.petstore.jdo">
<class name="Category" objectid-class="CategoryId">
<extension vendor-name="kodo" key="jdbc-class-map" value="base">
<extension vendor-name="kodo" key="table" value="category"/>
</extension>
<field name="catid" primary-key="true">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="catid"/>
</extension>
</field>
<field name="descn">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="descn"/>
</extension>
</field>
<field name="image">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="image"/>
</extension>
</field>
<field name="name">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column" value="name"/>
</extension>
</field>
</class>
</package>
</jdo>
====
Any help is appreciated,
Ceilo Huang.
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com
Maybe you are looking for
-
Need some urgent help // Streaming windows and Mac Pro
HI , I have a nice "issue" here. At present I am in a project. We save the video images and sound by capture in FCP PRO with Mac Intel. Ans next to that using a Windows PC to stream live to internet. We send the video by using a converter from analog
-
How do I clear the error in Safari? I've reinstalled Lion 3 times and the error won't clear.
-
Output type not getting defaulted in PO
Hi..... I have configured output type as printout for purchase order, i have set the default value for message type NEU, even than when i create a PO system is not picking the message type NEU.. i have also mainatined condition record in MN04 for the
-
ALV edit (qty field is not convertable)
in my ALV program i have used one field MENGE (13,3) (QTY field) in the out put it is showing as 1.000, when user going to enter a value (5) it is showing as 0.005 but user need it as 5.000. please solve this question experts..... Regards Prasad.EV
-
How can I increase the size of the images in the media gallery?
I'm a novice. I would like to see larger images in the media gallery. Is there a weay to increase their size?