SessionManager with XML deployment project problem - TopLink/JPA

I switched over from DatabaseSession to using SessionManager. In my DatabaseSession code I had code like this to add two descriptors to the project:
        m_project = XMLProjectReader.read(fileName,
                RepositoryFactoryTLImpl.class.getClassLoader());
        m_project.addDescriptor(buildHoleToFlangeLimitDTOImplDescriptor());
        m_project.addDescriptor(buildHoleToWebLimitDTOImplDescriptor());
        m_session = m_project.createDatabaseSession();After changing to using SessionManager I have:
        m_serverSession = (ServerSession)SessionManager.
                getManager().getSession("FPRSAcceptanceRepos");
       
        m_project = m_serverSession.getProject();
        m_project.addDescriptor(buildHoleToFlangeLimitDTOImplDescriptor());
        m_project.addDescriptor(buildHoleToWebLimitDTOImplDescriptor());HOWEVER... all my tests work fine EXCEPT those whose descriptors are added in the Java code. I get 'Invalid query key in expression' errors like this one below.
LOCAL EXCEPTION STACK:
EXCEPTION [TOPLINK-6015] (TopLink - 9.0.3.1 (Build 426)): oracle.toplink.exceptions.QueryException
EXCEPTION DESCRIPTION: Invalid query key [materialCode] in expression.
QUERY: ReadAllQuery(com.metalsa.orator.fprs.db.HoleLimitDTOImpl$Flange)
     oracle.toplink.exceptions.QueryException oracle.toplink.exceptions.QueryException.invalidQueryKeyInExpression(java.lang.Object)
     oracle.toplink.expressions.Expression oracle.toplink.internal.expressions.RelationExpression.normalize(oracle.toplink.internal.expressions.ExpressionNormalizer)
     oracle.toplink.expressions.Expression oracle.toplink.internal.expressions.CompoundExpression.normalize(oracle.toplink.internal.expressions.ExpressionNormalizer)
     void oracle.toplink.internal.expressions.SQLSelectStatement.normalize(oracle.toplink.publicinterface.Session, oracle.toplink.publicinterface.Descriptor)
     oracle.toplink.internal.expressions.SQLSelectStatement oracle.toplink.internal.queryframework.ExpressionQueryMechanism.buildNormalSelectStatement()
     void oracle.toplink.internal.queryframework.ExpressionQueryMechanism.prepareSelectAllRows()
     void oracle.toplink.queryframework.ReadAllQuery.prepareSelectAllRows()
     void oracle.toplink.queryframework.ReadAllQuery.prepare()
     void oracle.toplink.queryframework.DatabaseQuery.checkPrepare(oracle.toplink.publicinterface.Session, oracle.toplink.publicinterface.DatabaseRow)
     java.lang.Object oracle.toplink.queryframework.DatabaseQuery.execute(oracle.toplink.publicinterface.Session, oracle.toplink.publicinterface.DatabaseRow)
     java.lang.Object oracle.toplink.queryframework.ReadQuery.execute(oracle.toplink.publicinterface.Session, oracle.toplink.publicinterface.DatabaseRow)
     java.lang.Object oracle.toplink.publicinterface.Session.internalExecuteQuery(oracle.toplink.queryframework.DatabaseQuery, oracle.toplink.publicinterface.DatabaseRow)
     java.lang.Object oracle.toplink.threetier.ServerSession.internalExecuteQuery(oracle.toplink.queryframework.DatabaseQuery, oracle.toplink.publicinterface.DatabaseRow)
     java.lang.Object oracle.toplink.threetier.ClientSession.internalExecuteQuery(oracle.toplink.queryframework.DatabaseQuery, oracle.toplink.publicinterface.DatabaseRow)
     java.lang.Object oracle.toplink.publicinterface.Session.executeQuery(oracle.toplink.queryframework.DatabaseQuery, oracle.toplink.publicinterface.DatabaseRow)
     java.lang.Object oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(oracle.toplink.queryframework.DatabaseQuery, oracle.toplink.publicinterface.DatabaseRow)
     java.lang.Object oracle.toplink.publicinterface.Session.executeQuery(oracle.toplink.queryframework.DatabaseQuery, oracle.toplink.publicinterface.DatabaseRow)
     java.lang.Object oracle.toplink.publicinterface.Session.executeQuery(oracle.toplink.queryframework.DatabaseQuery)
     java.util.Collection com.metalsa.orator.fprs.db.HoleSetupReposTLImpl.getHoleLimits(java.lang.Class, java.lang.String, java.lang.String)
          HoleSetupReposTLImpl.java:105
     java.util.Collection com.metalsa.orator.fprs.db.HoleSetupReposTLImpl.getHoleToFlangeLimits(java.lang.String, java.lang.String)
          HoleSetupReposTLImpl.java:73
     void com.metalsa.orator.fprs.db.HoleSetupReposTest.getHoleLimits(com.metalsa.orator.fprs.db.HoleSetupReposTest$GetHoleLimitsParms, java.util.Collection)
          HoleSetupReposTest.java:462
     void com.metalsa.orator.fprs.db.HoleSetupReposTest.testGetHoleToFlangeLimits()
          HoleSetupReposTest.java:427
          native code
          TestCase.java:166
          TestCase.java:139
          TestResult.java:106
          TestResult.java:123
          TestResult.java:109
          TestCase.java:131
          TestSuite.java:173
          TestSuite.java:168
          TestRunner.java:644 

Hi,
Using the SessionManager you already logged into the DB and run the TopLink validate before you tried to add your query key.
Option # 1 -
Please try to use the preLogin event. It should look something like this:
1) In sessions.xml <event-listener-class>EventDemo</event-listener-class>
2) In EventDemo.java you should have something like
public class EventDemo extends SessionEventAdapter
{
public void preLogin(SessionEvent evt) {
evt.getSession().getProject().addDescriptor(buildHoleToFlangeLimitDTOImplDescriptor());
evt.getSession().getProject().addDescriptor(buildHoleToWebLimitDTOImplDescriptor());
}
}
Option # 2
Build the ServerSession in the code
m_project = XMLProjectReader.read(fileName, RepositoryFactoryTLImpl.class.getClassLoader());
m_project.addDescriptor(buildHoleToFlangeLimitDTOImplDescriptor());
m_project.addDescriptor(buildHoleToWebLimitDTOImplDescriptor());
m_session = m_project.createServerSession(1, 2);
m_session.useExclusiveReadConnectionPool(2, 5);
m_session.logMessages();
. Etc .
m_session.login();
Raanan.

Thanks. I finally tried Option 1. It worked!

Related

WEBSTORE: getCategories Table or view not found

Neelesh,
When I run the Webstore Sample, I am getting an error message that a 'table or view cannot be found'. Prior to this message, I am getting several 'auto-creation' error messages where the code seems to be attempting to create the webstore tables, of course, they already exist. I went ahead and included the last of the auto-create, and then included the 'notfound' message
Here is my error message. Any ideas???......
Auto-creating table: create table USERS (USER_NAME VARCHAR2(255) not null primary key, ADDRESS
VARCHAR2(255) null, CARD_EXPIRY_DATE DATE null, CARD_NUMBER VARCHAR2(255) null, CARD_PROVIDER
VARCHAR2(255) null, CITY VARCHAR2(255) null, COUNTRY NUMBER null, E_MAIL VARCHAR2(255) null,
FIRST_NAME VARCHAR2(255) null, LAST_NAME VARCHAR2(255) null, PASSWORD VARCHAR2(255) null, PHONE
VARCHAR2(255) null, ROLE VARCHAR2(255) null, STATE VARCHAR2(255) null, ZIP NUMBER null)
Warning: Error creating table: ORA-00955: name is already used by an existing object
done.
Oracle9iAS (9.0.2.0.0) Containers for J2EE initialized
Target URL -- http://127.0.0.1:8988/vsm/jsps/main.jsp
oracle.otnsamples.mvc.BusinessException: Exception in mainPage method of CatalogueController class
of given status : Categories could not be found in getCategoryInformation method of
CatalogueController class of given status :
Exception thrown in getCategories() method of CategoryManager class of given status :Unable to
execute the SQL Query in execute method of DBBroker class of given status : ORA-00942: table or
view does not exist
     oracle.otnsamples.mvc.UserResponse
oracle.otnsamples.vsm.controllers.CatalogueController.mainPage(java.util.Hashtable,
oracle.otnsamples.mvc.UserSession)
     java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
     oracle.otnsamples.mvc.UserResponse oracle.otnsamples.mvc.Command.execute(java.lang.String,
java.util.Hashtable, oracle.otnsamples.mvc.UserSession, java.lang.String)
     oracle.otnsamples.mvc.UserResponse
oracle.otnsamples.mvc.CommandCache.executeCommand(java.lang.String, java.util.Hashtable,
oracle.otnsamples.mvc.UserSession)
     void oracle.otnsamples.mvc.RouterServlet.service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
     void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
     void com.evermind.server.http.ResourceFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
     void oracle.otnsamples.vsm.business.FileUploadFilter.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, javax.servlet.FilterChain)
     void com.evermind.server.http.EvermindFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
     void
oracle.otnsamples.vsm.business.AccessControlFilter.checkPrivileges(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, javax.servlet.FilterChain)
     void oracle.otnsamples.vsm.business.AccessControlFilter.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, javax.servlet.FilterChain)
     void com.evermind.server.http.EvermindFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
     void oracle.otnsamples.vsm.business.HitCounterFilter.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, javax.servlet.FilterChain)
     void com.evermind.server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
     void
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest,
javax.servlet.http.HttpServletResponse)
     boolean
com.evermind.server.http.HttpRequestHandler.processRequest(com.evermind.server.ApplicationServerThread,
com.evermind.server.http.EvermindHttpServletRequest,
com.evermind.server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream,
boolean)
     void com.evermind.server.http.HttpRequestHandler.run(java.lang.Thread)
     void com.evermind.util.ThreadPoolThread.run()

Problem in advance table in advance table.

Hi Everybody,
I have creeated a advance table in a advamce table in ehich when i press show/hide the detail table corresponing to the paticular line should open.Now my doubt is ,Is it always necessary to have a view link between both the tables, to pass a parameter from outer table to inner table ,if no then how can we pass the parameter then.Please help.
Thanks 
It is mandatory to have ViewLink created for adv.Table-in-adv.Table to work properly. Without the viewLink the table-in-table will throw exceptions. 
Hi Suvama,
Thanks for your reply,suppose i wnat that when i press show in the header table i want to pass a parameter to the detail table VO as a bind parameter , Can you please tell me how to do that.
Thanks 
What is the scenario you are trying to solve? Why do you need to pass a parameter to the detail VO?
The innerTable VO is not handled as you do with normal VO set on the outerTable. Any manipulation on innerTable should be done to the DataObjectEnumerator.
// get a handle to inner table
OATableBean innerTable =
(OATableBean)webBean.findChildRecursive("InnerTableBean");
// create an enumerator
OAInnerDataObjectEnumerator enum =
new OAInnerDataObjectEnumerator(pageContext, innerTable); 
Hi,
We get a handle to inner table then we use the code
// create an enumerator
OAInnerDataObjectEnumerator enum =
new OAInnerDataObjectEnumerator(pageContext, innerTable);
Actually am not able to understand why we are using enum and where are we passing parameter from outer to inner table.
Thanks 
what is the scenario that you need to pass parameter to the inner table's VO? 
Hi,
My outer table stores details about various vehicle.Now when i click apaticular row in the outer table it should show the complete details about that paticular vehicle code for different places in india.So i have to pass the vehicle code from outer table to inner table,and according to that the inner table should populate.
thanks 
The scenario could be easily handled by creating a viewlink between outer and inner table VO's with viewLink source and destination attributes being set as vehicle code.
why do you want to avoid the ViewLink? 
HI my problem is am getting error while creating the view link having a stck trace like
java.lang.nullpoint exception
java.lang.NullPointerException
     void oracle.jbo.dt.objects.JboAttribute.generateAttributeImports(java.lang.Object)
          JboAttribute.java:1507
     int oracle.jbo.dt.objects.JboView.generateAttributeMethods(int, java.lang.Object[], java.lang.StringBuffer)
          JboView.java:2623
     void oracle.jbo.dt.objects.JboView.createViewRowFile()
          JboView.java:1904
     void oracle.jbo.dt.objects.JboView.saveToJavaFile(boolean, boolean)
          JboView.java:1809
     void oracle.jbo.dt.objects.JboBaseObject.saveObject(boolean, boolean)
          JboBaseObject.java:2078
     void oracle.jbo.dt.objects.JboView.saveObject(boolean, boolean)
          JboView.java:1715
     void oracle.jbo.dt.objects.JboViewLink.saveAssociationRelatedObjects()
          JboViewLink.java:1072
     void oracle.jbo.dt.objects.JboViewLink.saveObject(boolean, boolean)
          JboViewLink.java:1024
     boolean oracle.jbo.dt.ui.main.DtuUtil.saveObject(java.awt.Component, oracle.jbo.dt.objects.JboBaseObject, boolean, boolean, boolean)
          DtuUtil.java:711
     boolean oracle.jbo.dt.ui.main.dlg.DtuWizard.saveWizardObject(oracle.jbo.dt.objects.JboBaseObject, boolean)
          DtuWizard.java:786
     boolean oracle.jbo.dt.ui.viewlink.VLWizard.finishAction()
          VLWizard.java:228
     void oracle.jbo.dt.ui.main.dlg.DtuWizard.wizardFinished(oracle.bali.ewt.wizard.WizardEvent)
          DtuWizard.java:1590
     void oracle.bali.ewt.wizard.BaseWizard.processWizardEvent(oracle.bali.ewt.wizard.WizardEvent)
     void oracle.bali.ewt.wizard.BaseWizard.processEventImpl(java.awt.AWTEvent)
     void oracle.bali.ewt.LWComponent.processEvent(java.awt.AWTEvent)
     void oracle.bali.ewt.wizard.BaseWizard.doFinish()
     void oracle.bali.ewt.wizard.BaseWizard$Action.actionPerformed(java.awt.event.ActionEvent)
     void javax.swing.AbstractButton.fireActionPerformed(java.awt.event.ActionEvent)
          AbstractButton.java:1450
     void javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(java.awt.event.ActionEvent)
          AbstractButton.java:1504
     void javax.swing.DefaultButtonModel.fireActionPerformed(java.awt.event.ActionEvent)
          DefaultButtonModel.java:378
     void javax.swing.DefaultButtonModel.setPressed(boolean)
          DefaultButtonModel.java:250
     void javax.swing.plaf.basic.BasicButtonListener.mouseReleased(java.awt.event.MouseEvent)
          BasicButtonListener.java:216
     void java.awt.Component.processMouseEvent(java.awt.event.MouseEvent)
          Component.java:3715
     void java.awt.Component.processEvent(java.awt.AWTEvent)
          Component.java:3544
     void java.awt.Container.processEvent(java.awt.AWTEvent)
          Container.java:1164
     void java.awt.Component.dispatchEventImpl(java.awt.AWTEvent)
          Component.java:2593
     void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
          Container.java:1213
     void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
          Component.java:2497
     void java.awt.LightweightDispatcher.retargetMouseEvent(java.awt.Component, int, java.awt.event.MouseEvent)
          Container.java:2451
     boolean java.awt.LightweightDispatcher.processMouseEvent(java.awt.event.MouseEvent)
          Container.java:2216
     boolean java.awt.LightweightDispatcher.dispatchEvent(java.awt.AWTEvent)
          Container.java:2125
     void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
          Container.java:1200
     void java.awt.Window.dispatchEventImpl(java.awt.AWTEvent)
          Window.java:922
     void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
          Component.java:2497
     void java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent)
          EventQueue.java:339
     boolean java.awt.EventDispatchThread.pumpOneEventForHierarchy(java.awt.Component)
          EventDispatchThread.java:131
     void java.awt.EventDispatchThread.pumpEventsForHierarchy(java.awt.Conditional, java.awt.Component)
          EventDispatchThread.java:98
     void java.awt.Dialog.show()
          Dialog.java:380
     void java.awt.Component.show(boolean)
          Component.java:946
     void java.awt.Component.setVisible(boolean)
          Component.java:903
     boolean oracle.bali.ewt.wizard.WizardDialog.runDialog()
     void oracle.jbo.dt.ui.main.dlg.DtuWizard.createBaliWizard()
          DtuWizard.java:330
     void oracle.jbo.dt.ui.main.dlg.DtuWizard.setVisible(boolean)
          DtuWizard.java:272
     boolean oracle.jbo.dt.ui.main.dlg.DtuWizard.showDialog()
          DtuWizard.java:254
     oracle.jbo.dt.objects.JboViewLink oracle.jbo.dt.jdevx.ui.JdxMenuManager.invokeVLWizard(java.awt.Frame, oracle.jbo.dt.objects.JboPackage, oracle.jbo.dt.objects.JboViewLink)
          JdxMenuManager.java:649
     oracle.jbo.dt.objects.JboViewLink oracle.jbo.dt.jdevx.ui.JdxMenuManager.invokeViewLinkWizard(oracle.jbo.dt.objects.JboPackage, oracle.jbo.dt.objects.JboViewLink)
          JdxMenuManager.java:630
     void oracle.jbo.dt.ui.main.DtuMenuManager.doMenuAction(java.lang.String)
          DtuMenuManager.java:882
     void oracle.jbo.dt.jdevx.ui.JdxMenuManager.doMenuAction(java.lang.String)
          JdxMenuManager.java:533
     void oracle.jbo.dt.ui.main.DtuMenuManager.doAction(java.lang.String)
          DtuMenuManager.java:838
     void oracle.jbo.dt.ui.main.DtuMenuManager.doAction(oracle.jbo.dt.objects.JboApplication, java.lang.Object, java.lang.String)
          DtuMenuManager.java:823
     void oracle.jbo.dt.jdevx.ui.JdxMenuManager.doActionPerformed(java.awt.event.ActionEvent)
          JdxMenuManager.java:391
     void oracle.jbo.dt.jdevx.ui.JdxMenuInvoker.run()
          JdxMenuManager.java:1076
     void java.awt.event.InvocationEvent.dispatch()
          InvocationEvent.java:154
     void java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent)
          EventQueue.java:337
     boolean java.awt.EventDispatchThread.pumpOneEventForHierarchy(java.awt.Component)
          EventDispatchThread.java:131
     void java.awt.EventDispatchThread.pumpEventsForHierarchy(java.awt.Conditional, java.awt.Component)
          EventDispatchThread.java:98
     void java.awt.EventDispatchThread.pumpEvents(java.awt.Conditional)
          EventDispatchThread.java:93
     void java.awt.EventDispatchThread.run()
          EventDispatchThread.java:85 
Which Jdev patch are you using? What is the apps instance's framework level to which you are connected?
--Shiv                                                                                                                                                                                                                                    
Hi,
Am not having the jdevloper zip file with me now , so i may not be able to give to the correct version of jdevloper,

TextMessage received from Oracle AQ using JMS contains just '???'

I need to connect to two Oracle AQ queues in different databases. I'm using exactly similar code in both cases, except for the connection string of course. One of the queues is working fine, but the second one not.
     String db_string = "jdbc:oracle:thin:#(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=x.y.z.2)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=x.y.z.3)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=DBNAME)))";
     
     String name = "scott";
     String pwd = "tiger";
     
     Properties info = new Properties();
     info.put("name", name);
     info.put("password", pwd);
     QueueConnectionFactory q_cf = AQjmsFactory.getQueueConnectionFactory(db_string, info);
     QueueConnection q_conn q_conn = q_cf.createQueueConnection(name, pwd);
          
     QueueSession q_sess = q_conn.createQueueSession(true, Session.CLIENT_ACKNOWLEDGE);
     q_conn.start();
     Queue queue = ((AQjmsSession) q_sess).getQueue("test","myaq");
     ((AQjmsDestination) queue).start(q_sess, true, true);
     QueueReceiver q_recvr = q_sess.createReceiver(queue);
     TextMessage message = (TextMessage) q_recvr.receive();
     System.out.println(message.getText());
When I use the code to connect to the AQ which works fine, it correctly prints the text included in the message. The second AQ prints just three quotation marks, regardless of what the message contains.
I'm using aqapi 10.2.0.2 and I've tested with both ojdbc14 10.2.0.2.0 and ojdbc5 11.1.0.6.0. AQ which is working is running on Oracle 11.1.0.0.0, and the one which is causing the issues on 10.2.0.4.0. I've analyzed the TNS packets with Wireshark, and packets containing the AQ messages look pretty much similar with both databases.
Reflection dump of TextMessage object of the working case looks like this:
     {text_data=MY_TEXT_MESSAGEtext_msg_cont=oracle.jms.AQjmsTextMessage_C#1a7508agen_msg_cont=oracle.jms.AQjmsGenMessage_C#198cb3dtext_lob=m_boolClass=class java.lang.Booleanm_byteClass=class java.lang.Bytem_shortClass=class java.lang.Bytem_intClass=class java.lang.Integerm_longClass=class java.lang.Longm_floatClass=class java.lang.Floatm_doubleClass=class java.lang.Doublem_strClass=class java.lang.Stringm_systemProperties={JMSXDeliveryCount=class java.lang.Integer, JMS_OracleConnectionID=class java.lang.String, JMSXGroupSeq=class java.lang.Integer, JMSXAppID=class java.lang.String, JMSXRecvTimestamp=class java.lang.Long, JMS_OracleExcpQ=class java.lang.String, JMS_OracleHeaderOnly=class java.lang.String, JMS_OracleOriginalMessageID=class java.lang.String, JMSXGroupID=class java.lang.String, JMSXUserID=class java.lang.String, JMS_OracleDeliveryMode=class java.lang.String, JMS_OracleTimestamp=class java.lang.Long, JMS_OracleDelay=class java.lang.Long, JMSXState=class java.lang.Integer}m_settableSystemProperties=[JMSXGroupID, JMSXGroupSeq]header_ext=oracle.jms.AQjmsMessageHeaderExt#472d48message_id=oracle.jms.AQjmsMessageID#edf3f6enqueue_time=1265887454000corr_id=msg_dest=test.myaqdel_mode=2redelivered=trueexpiration=0priority=1msg_properties={JMS_OracleDeliveryMode=oracle.jms.AQjmsPropDatum#2bc3f5}access_mode=0prop_read_only=truerecv_time=1265891032384msg_state=0excp_queue=msg_delay=0orig_msg_id=sender_id=attempts=5m_signature=session=oracle.jms.AQjmsSession#a613f8m_hdrOnly=falsem_isjmsbody=truecompliant=falseJMS_REPLY_TO=JMSReplyTo}
And the broken one:
          
{text_data=???text_msg_cont=oracle.jms.AQjmsTextMessage_C#1bf3d87gen_msg_cont=oracle.jms.AQjmsGenMessage_C#60991ftext_lob=m_boolClass=class java.lang.Booleanm_byteClass=class java.lang.Bytem_shortClass=class java.lang.Bytem_intClass=class java.lang.Integerm_longClass=class java.lang.Longm_floatClass=class java.lang.Floatm_doubleClass=class java.lang.Doublem_strClass=class java.lang.Stringm_systemProperties={JMSXDeliveryCount=class java.lang.Integer, JMS_OracleConnectionID=class java.lang.String, JMSXGroupSeq=class java.lang.Integer, JMSXAppID=class java.lang.String, JMSXRecvTimestamp=class java.lang.Long, JMS_OracleExcpQ=class java.lang.String, JMS_OracleHeaderOnly=class java.lang.String, JMS_OracleOriginalMessageID=class java.lang.String, JMSXGroupID=class java.lang.String, JMSXUserID=class java.lang.String, JMS_OracleDeliveryMode=class java.lang.String, JMS_OracleTimestamp=class java.lang.Long, JMS_OracleDelay=class java.lang.Long, JMSXState=class java.lang.Integer}m_settableSystemProperties=[JMSXGroupSeq, JMSXGroupID]header_ext=oracle.jms.AQjmsMessageHeaderExt#1e4f7c2message_id=oracle.jms.AQjmsMessageID#145f0e3enqueue_time=1265890738000corr_id=msg_dest=test.myaqdel_mode=2redelivered=trueexpiration=0priority=1msg_properties={???=oracle.jms.AQjmsPropDatum#c9d92c}access_mode=0prop_read_only=truerecv_time=1265891388844msg_state=0excp_queue=msg_delay=0orig_msg_id=sender_id=attempts=1m_signature=session=oracle.jms.AQjmsSession#60e128m_hdrOnly=falsem_isjmsbody=truecompliant=falseJMS_REPLY_TO=JMSReplyTo}

How to fill a Tree in Java?

Hello,
I have a tree to realize the navigation on my site and now I want to build this tree in a dataProvider. I found the class SimpleTreeData which seems to link to the <nodes>-Tag but I can't get it work. Here are some code extracts:
DataProvider:
private SimpleTreeData createShopNode(String text, String description)
{
 SimpleTreeData data = new SimpleTreeData();
 data.setText( text );
 if ( description != null )
   data.setDescription( description);
 data.setDestination( "http://bali.us.oracle.com");
 data.setDestinationText( "More Information");
 return data;
}
private DataObject createData(RenderingContext context, String ns, String name)
{
  SimpleTreeData treeRoot = new SimpleTreeData();
  SimpleTreeData shop = createShopNode("Shop", "Spend some money!");
  SimpleTreeData books = createShopNode("Books", null);
  SimpleTreeData umbrellas = createShopNode("Umbrellas", "Rain, rain go away");
  SimpleTreeData art = createShopNode("Art", "Picasso et al");
  books.addChild( art);
  shop.addChild(books);
  shop.addChild(umbrellas);
DictionaryData lDictionaryData = new DictionaryData();
lDictionaryData.put( "dynamicNode", shop);
return lDictionaryData;
}
This is my UIX Page:
...
<provider>
<data name="TreeProxy">
<method class="test.DataTrees" method="getTreeProxy"/>
</data>
<data name="treeData">
<method class="test.NavigationNodes"
method="createData"/>
</data>
</provider>
...
<tree data:proxy="proxy#TreeProxy">
<include data:node="dynamicNode#treeData"/>
</tree>
Thanks,
Christian 
Perhaps it is helpful, I get this Exception:
java.lang.IllegalAccessException: de/oc/vera/navigation/NavigationNodes
java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
native code
oracle.cabo.ui.data.DataObject oracle.cabo.ui.data.provider.MethodDataProvider.getDataObject(oracle.cabo.ui.RenderingContext, java.lang.String, java.lang.String)
oracle.cabo.ui.data.DataObject oracle.cabo.ui.data.provider.TableDataProvider.getDataObject(oracle.cabo.ui.RenderingContext, java.lang.String, java.lang.String)
oracle.cabo.ui.data.DataObject oracle.cabo.ui.data.provider.CachingDataProvider.getDataObject(oracle.cabo.ui.RenderingContext, java.lang.String, java.lang.String)
oracle.cabo.ui.data.DataObject oracle.cabo.ui.data.provider.DataProviderStack.getDataObject(oracle.cabo.ui.RenderingContext, java.lang.String, java.lang.String)
oracle.cabo.ui.data.DataObject oracle.cabo.ui.laf.base.TryRenderer$CatchContext.getDataObject(oracle.cabo.ui.RenderingContext, java.lang.String, java.lang.String)
oracle.cabo.ui.data.DataObject oracle.cabo.ui.RenderingContextProxy.getDataObject(java.lang.String, java.lang.String)
java.lang.Object oracle.cabo.ui.data.DataBoundValue.getValue(oracle.cabo.ui.RenderingContext)
java.lang.Object oracle.cabo.ui.BaseUINode.getAttributeValueImpl(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.AttributeKey, boolean)
java.lang.Object oracle.cabo.ui.BaseUINode.getAttributeValue(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.AttributeKey)
oracle.cabo.ui.data.DataObjectList oracle.cabo.ui.laf.base.BaseLafRenderer.getDataObjectListAttributeValue(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode, oracle.cabo.ui.AttributeKey)
void oracle.cabo.ui.laf.browser.TreeRenderer.renderContent(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)
void oracle.cabo.ui.BaseRenderer.render(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)
void oracle.cabo.ui.laf.xhtml.XhtmlLafRenderer.render(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)
void oracle.cabo.ui.BaseUINode.render(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)
void oracle.cabo.ui.BaseUINode.render(oracle.cabo.ui.RenderingContext)
void oracle.cabo.ui.BaseRenderer.renderChild(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)
void oracle.cabo.ui.BaseRenderer.renderIndexedChild(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode, int) 
Sorry about that entry, it was a privileg problem, no uix problem. 
I'm also working on it.
I want to put HGrid to handle dynamic data, which uses trees.
Check JDeveloper Help -> Data Binding.
You must implement a java class to create a SimpleTreeData, so you put the object in a DictionaryData that can be read by UIX parser.
Sorry the english...
Stan.
Christian -
I believe the problem is that you are binding the tree's "nodes" attribute to a DataObject (SimpleTreeData) - but the nodes attribute should actually be bound to a DataObjectList (or an array of DataObjects/JavaBeans). Although to be honest, I am not certain whether this is the only problem here... if it were, I believe that UIX would have reported a more specific error messages - such as "Cannot convert SimpleTreeData to DataObjectList) - which I assume you have not seen.
In any case, I believe that you'll need to change the following line of code in your createData() method:
  lDictionaryData.put( "dynamicNode", shop);to something like this:
  SimpleTreeData[] nodes = new SimpleTreeData[1];
  nodes[0] = shop;
  lDictionaryData.put( "dynamicNode", shop);Can you try his out and let us know the results?
Andy 
Christian -
I believe the problem is that you are binding the tree's "nodes" attribute to a DataObject (SimpleTreeData) - but the nodes attribute should actually be bound to a DataObjectList (or an array of DataObjects/JavaBeans). Although to be honest, I am not certain whether this is the only problem here... if it were, I believe that UIX would have reported a more specific error messages - such as "Cannot convert SimpleTreeData to DataObjectList) - which I assume you have not seen.
In any case, I believe that you'll need to change the following line of code in your createData() method:
  lDictionaryData.put( "dynamicNode", shop);to something like this:
  SimpleTreeData[] nodes = new SimpleTreeData[1];
  nodes[0] = shop;
  lDictionaryData.put( "dynamicNode", shop);Can you try his out and let us know the results?
Andy 
Christian -
I believe the problem is that you are binding the tree's "nodes" attribute to a DataObject (SimpleTreeData) - but the nodes attribute should actually be bound to a DataObjectList (or an array of DataObjects/JavaBeans). Although to be honest, I am not certain whether this is the only problem here... if it were, I believe that UIX would have reported a more specific error messages - such as "Cannot convert SimpleTreeData to DataObjectList) - which I assume you have not seen.
In any case, I believe that you'll need to change the following line of code in your createData() method:
  lDictionaryData.put( "dynamicNode", shop);to something like this:
  SimpleTreeData[] nodes = new SimpleTreeData[1];
  nodes[0] = shop;
  lDictionaryData.put( "dynamicNode", shop);Can you try his out and let us know the results?
Andy 
Let me tell you how i'm working with hGridBeans and Java:
I created a method that returns a dictionaryData.
// TREEDATA_KEY = "treeKey"
static private DataObject _getData()
{
DictionaryData data = new DictionaryData();
data.put(_TREE_DATA_KEY, _getDataForTree());
return data;
}
The method _getDataForTree() builds a tree (SimpleTreeData object) like UIX's example describes.
==== UIX code to link a Java class ====
<data name="hgridtree:treeData" >
<method class="mypackage.DataHGrid" method="_getData" />
</data>
...
<hGrid id="hg1" name="hgrid"
data:treeData="treeKey#hgridtree:treeData"
data:proxy="hGridProxy#ctrl:eventResult">
... 
Sorry - didn't mean to spam the thread with multiple responses. The forums were a bit flaky over the weekend. :-(

Error when use FamilyStep and TopBottomStep together

I want to specify all Children of one member based on the top data values in a particular measure.
I used TopBottomStep following FamilyStep, Specifying the Action for Steps as Step.KEEP.
But the code as following occurred Exception BIB-9527.
<orabi:Presentation id="topbottom_Presentation" location="topbottom" />
<%
Query objTableQuery =(Query)topbottom_Presentation.getModel().getDataSource();
MetadataManagerServices metadataService = objTableQuery.getMetadataManager();
String strDimensionUniId = objTableQuery.getLayout()[1][0];
MDDimension objDimension = metadataService.getDimensionByUniqueID(strDimensionUniId);
MDHierarchy objHierarchy = objDimension.getDefaultHierarchy();
String strHierarchyUniId = objHierarchy.getUniqueID();
Selection objSelection = objTableQuery.findSelection(strDimensionUniId);
objSelection.setHierarchy(strHierarchyUniId);
String strMemberValue = "2003Q1";
java.util.Vector objFamilyValues = new java.util.Vector ();
objFamilyValues.addElement (strMemberValue);
FamilyStep objFamilyStep = new FamilyStep ( strDimensionUniId, strHierarchyUniId, FamilyStep.OP_DESCENDANTS, objFamilyValues, true);
objFamilyStep.setAction (Step.KEEP);
int iStepCount = objSelection.addStep(objFamilyStep);
System.out.println("Dimension:"+strDimensionUniId+" Add FamilyStep");
String strMeasureUniId = objTableQuery.getMeasures()[0];
String strLevel = objHierarchy.getLevels()[1].getUniqueID();
java.util.Vector m_levels = new java.util.Vector();
m_levels.addElement(strLevel);
int iTopFlag = TopBottomStep.TOP;
int iTopPosition = 10;
TopBottomStep objTopBottomStep = new TopBottomStep(strDimensionUniId, strHierarchyUniId,
m_levels, strMeasureUniId,
iTopFlag, new Integer(iTopPosition), false);
objTopBottomStep.setAction (Step.KEEP);
int iTotalStep = objSelection.addStep(objTopBottomStep);
System.out.println("Dimension:"+strDimensionUniId+" Add TopBottomStep");
objTableQuery.applySelection(objSelection );
%>
</orabi:BIThinSession>
oracle.dss.dataSource.common.OLAPTransactionException: BIB-9527 �޷�׼�� OLAP ������
oracle.express.olapi.data.full.ExpressNotCommittableException������: δ֪����
���������˵��:
DPR: ����δ֪����, һ�� λ�� TxsOqDefinitionManager::prepare
oracle.express.olapi.data.full.ExpressNotCommittableException������: δ֪����
���������˵��:
DPR: ����δ֪����, һ�� λ�� TxsOqDefinitionManager::prepare
     void oracle.dss.dataSource.QueryUtilities.commit(boolean)
          QueryUtilities.java:143
     oracle.express.olapi.data.full.ExpressSpecifiedCursorManager[] oracle.dss.dataSource.QueryUtilities.setUpCursors(oracle.dss.dataSource.SourceTemplate[], oracle.dss.dataSource.common.CubeCursor[], oracle.olapi.data.source.Source[], oracle.express.olapi.data.full.ExpressSpecifiedCursorManager[], boolean, boolean, boolean, boolean)
          QueryUtilities.java:331
     oracle.express.olapi.data.full.ExpressSpecifiedCursorManager[] oracle.dss.dataSource.QueryServer._setUpCursorsForMainQuery(oracle.dss.dataSource.SourceTemplate[], oracle.dss.dataSource.common.CubeCursor[], boolean, boolean, boolean, boolean)
          QueryServer.java:6996
     void oracle.dss.dataSource.QueryServer._getCursorForCube(oracle.dss.dataSource.common.DimTree, boolean, boolean, boolean, boolean, boolean)
          QueryServer.java:4056
     void oracle.dss.dataSource.QueryServer._updateCube(oracle.dss.selection.Selection[], java.lang.Object, boolean, boolean, boolean)
          QueryServer.java:4013
     void oracle.dss.dataSource.QueryServer._applySelections(oracle.dss.selection.Selection[], oracle.dss.util.Operation, oracle.dss.dataSource.common.QueryState)
          QueryServer.java:2621
     java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
          native code
     java.lang.Object oracle.dss.util.Operation.execute(java.lang.Object)
          Operation.java:69
     java.lang.Object oracle.dss.dataSource.OperationQueue.update()
          OperationQueue.java:68
     java.lang.Object oracle.dss.dataSource.common.BaseOperationQueue.addOperation(oracle.dss.util.Operation, int)
          BaseOperationQueue.java:176
     java.lang.Object oracle.dss.dataSource.common.BaseOperationQueue.addOperation(oracle.dss.util.Operation)
          BaseOperationQueue.java:146
     java.lang.Object oracle.dss.dataSource.QueryServer.queueOperation(java.lang.String, oracle.dss.util.Parameter[], boolean, oracle.dss.dataSource.common.QueryEvent, java.lang.String, oracle.dss.util.Parameter[], oracle.dss.dataSource.common.QueryState)
          QueryServer.java:7033
     void oracle.dss.dataSource.QueryServer.applySelection(oracle.dss.selection.Selection)
          QueryServer.java:2152
     java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
          native code
     java.lang.Object oracle.dss.util.Operation.execute(java.lang.Object)
          Operation.java:69
     java.lang.Object oracle.dss.dataSource.QueryManagerServer.sendQueue(oracle.dss.dataSource.common.BaseOperationQueue)
          QueryManagerServer.java:1442
     java.lang.Object oracle.dss.dataSource.common.OperationQueue.update()
          OperationQueue.java:198
     java.lang.Object oracle.dss.dataSource.common.BaseOperationQueue.addOperation(oracle.dss.util.Operation, int)
          BaseOperationQueue.java:176
     java.lang.Object oracle.dss.dataSource.common.BaseOperationQueue.addOperation(oracle.dss.util.Operation)
          BaseOperationQueue.java:146
     java.lang.Object oracle.dss.dataSource.common.OperationQueue.addOperation(oracle.dss.util.Operation, oracle.dss.dataSource.common.EventList)
          OperationQueue.java:127
     void oracle.dss.dataSource.client.QueryClient.applySelection(oracle.dss.selection.Selection)
          QueryClient.java:968
Who can help me?
Thanks! 
Hi,
Are you trying to create a selection on the Time dimension?
Select descendants of Q1, 2003
Keep top 10 months based on Sales for ...
First of all, you ned to specify the QDR for your measure in the top bottom step.
Also, your first step always has to have the action Step.SELECT.
What is your Time hierarchy? It looks like you ae trying to select descendants of a quarter level, and the keep at the level 1 - what level is that? Can you list your Time levels please?
Here is an example of creating a QDR:
// Create a QDR that qualifies Sales to
// Time: January 2001, Geography: World, Channel: Retail.
OlapQDR qdr1 = new OlapQDR(strSalesMeasureDim);
qdr1.addDimMemberPair(strTimeDim, "JAN01");
qdr1.addDimMemberPair(strGeogDim, "WORLD");
qdr1.addDimMemberPair(strChannelDim, "RETAIL");
qdr1.addDimMemberPair(strSalesMeasureDim,strSalesMeasure);
Hope this helps
Katia

Categories

Resources