Problem in getting handle to EJB Object
Hi All,
I am getting following exception when i try to get handle on my ejb object.
My Client Program:
import synch.*;
import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;
import javax.ejb.*;
import java.io.*;
public class SearlizeClient
public static void main(String[] args) throws Exception
Context ic = new InitialContext();
Object o = ic.lookup("NameBean"); // replace with YOUR JNDI name for the bean
NameHome nameHome = (NameHome) PortableRemoteObject.narrow(o, NameHome.class);
synch.Name obj1 = nameHome.create();
obj1.setName("Balaji");
Handle myHandle= obj1.getHandle();// Getting exception at this place
FileOutputStream out = new FileOutputStream("MyHandle.txt");
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeObject(obj1);
s.flush();
out.close();
I got following excetion when i try to get handle on EJBObject
Dec 6, 2005 11:20:19 AM com.sun.corba.se.impl.encoding.CDRInputStream_1_0 read_value
WARNING: "IOP00810257: (MARSHAL) Could not find class"
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
at com.sun.corba.se.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemExcep
tion.java:7756)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1013
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:879)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_
1_0.java:873)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_
1_0.java:863)
at com.sun.corba.se.impl.encoding.CDRInputStream.read_abstract_interface(CDRInputStream.java
:269)
at synch._Name_Stub.getHandle(Unknown Source)
at SearlizeClient.main(SearlizeClient.java:20)
Caused by: java.lang.ClassNotFoundException
... 7 more
Exception in thread "main" java.rmi.MarshalException: CORBA MARSHAL 1398079745 Maybe; nested excepti
on is:
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
at com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:197)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:67)
at synch._Name_Stub.getHandle(Unknown Source)
at SearlizeClient.main(SearlizeClient.java:20)
Caused by: org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
at com.sun.corba.se.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemExcep
tion.java:7756)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1013
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:879)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_
1_0.java:873)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_
1_0.java:863)
at com.sun.corba.se.impl.encoding.CDRInputStream.read_abstract_interface(CDRInputStream.java
:269)
at synch._Name_Stub.getHandle(Unknown Source)
... 1 more
Caused by: java.lang.ClassNotFoundException
... 7 more
Enviroment: This bean is hosted on Sun J2ee Appserver 8.0 and normal client prg is working fine .. But it is failing in getting handle
Please suggest,
Thanks in advance
The only way is to create your own equivalent of HttpSessionContext.
Its simple enough, just create a class that implements HttpSessionListener (responds to session creation, and destruction)
You can get the sessions as they are created, and keep a global reference to them, and manipulate it as much as you like. In your case you would probably want to index the sessions by userId rather than sessionId for easy access.
Good luck,
evnafets
Similar Messages
-
Problem in getting the function template object from the repository.
Hi all,
I have created a par file. I have a JCO connection in that. I am facing problems in getting the function template object from the repository. This thing is running successfully when i try to deploy it in Tomcat. But i am facing problems when i try to deploy it in SAP EP 6.0.
Below is statement which is giving error after being deployed to SAP EP6.
This is executing fine when executed in Tomcat Server.
// getting the object of function template
IFunctionTemplate functionTemplate =
aRepository.getFunctionTemplate("YADDNEWUSER");
Note : YADDNEWUSER is the name of the RFC which I am calling from my JAVA Code.
Thanks in advance,
DivijaThis sounds like a bug in the smart upload code. I have used this stuff before, but it's probably an older version, so maybe they broke something. Enumerations aren't usually guaranteed to keep things in any particular order. I would say for now, make a method to take the enumeration and a param name to find the value. And write to the JSPSmart people.
-
Authorization Scheme - Getting handle on which object is calling the scheme
Hi
I'm currently trying to write a custom authorization scheme using a plsql returning boolean. What I'm wondering is whether there is a way to reference the application object (e.g. page, region, page item, button etc) that has triggered the authorization plsql to run.
What I'm ultimately wanting to do is to create a generic authorization scheme that can be applied to any object, and that auth scheme will look up a database table containing what users can access what object. I can only do this if I know at run-time which object the plsql is currently checking authorization for. (I can get the user from :APP_USER.
For example I have an authorization scheme "test_scheme". I have applied test_scheme to the button "CREATE" on page 1. This button has a button_id which I can find from APEX_APPLICATION_PAGE_BUTTONS view.
During page rendering the buttons authorization scheme will be checked (and so the plsql returning boolean will be triggered). When the plsql is triggered I want to reference the fact that the CREATE button on page 1 (or better the button_id) has triggered the plsql, from within the plsql itself.
I hope this makes sense.
Many thanks in advance.Hi Scott,
Looks like there are a few others out there encountering the limiatations of authorization schemes.
Hopefully there will be an enhancement at some point to enable referencing the component id which has triggered the authorization scheme to run.
Until then I will go down the route of creating an authorization scheme for each component that needs one.
Many thanks for pointing me to that discussion.
Jimbo -
Problems in getting userid from Appscontext object
Hi,
Just a novice on OA ..Need a way to get userid .Currently i initiate an appsContext object using a DBC filepath. and then call getUserID() on the initialized object but I get it as -1 .
WebAppsContext app = new WebAppsContext("dbc file name along with the path");
app.getUserID(); // Gets me -1
As a cross check on the appsContext object app I acquired a jdbc connection from the appscontext object and fired a dummy query , which did worked implying the object app has been initialized.
Hopin for a quick resolution or an alternate way of doin this,.Hi .
sorry i hadnt made my reqmt clear ...
the thing is i m hitting a servlet from OA. And in this servlet i need to fetch userid so that i can query on fnd_users for getting the logged in user description , letz say i get user desc as abc ..so as to display welcome abc on top of the my custom page.
as itz a normal servlet ..i dont have pagecontext object ..just the usual servlet stuff like httpRequest . So how to get userid / user desc in this case...
any alternate way .. does an OA exception trace has userid info that can be extracted....
just a quest ..does AppsContext.getUserID() return -1 if itz initialized thru DBC filepath ?
Regards,
Ashley. -
Problem in getting Updated EJB methods in JSC for a Same Project
I'm Using Sun Studio Enterprise for developing EJB sets.After that i'm importing the EJB set in to JSC & using it my Project.
If i need to add some more business methods/edit the business method i'm able to do that in the Sun Enterprise IDE.After editing the EJB ,redeploying & reimporting to JSC i couldn't get the updated version of EJB in my Current Project.
We could be able to get the updated EJBs,if we are using it in a new project other than using it in the Previous one.
It's being a great problem for me.Vat shall i do for this problem?Please help me,a project is in Pending stage because of this problem.
Regards
KajananHi MWH@Keystroke,
Thanks for your consideration of my problem.I also use an EJB layer built in Sun Enterprise for the backend to my Creator-based web application.My Current problem is getting the updated EJB sets to my current project.
For Ex:
If i add a new Business method called doSomething( ),then i should be able to get that method in JSC using FinalFacadeRemoteClient1.doSomething().
But after typing FinalFacadeRemoteClient. , doSomething() method is not displaying.
If i use that in a new project [Previously not used Same Session Facades]all the updated EJB business methodss are coming.I want to use updated EJBs in the project i'm already working.
Regards
Kajanan -
Et_FORM_DATA_ADD, problem in getting Line object
Hi,
This is my first time using the et_FORM_DATA_ADD event. Objective: upon Add the Quotation, check each UnitPrice in the Document line. Problem: unable to get the children (lines) object from the parent (Documents) object. The For - Next loop is always skipped. Anybody can point out the problem? Appreciate your help. Below is the code.
Private Sub SBO_Application_FormDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean) Handles SBO_Application.FormDataEvent
Try
If BusinessObjectInfo.BeforeAction Then
If BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD Then
Select Case BusinessObjectInfo.Type
'Case SAPbobsCOM.BoObjectTypes.oOrders.ToString
Case SAPbobsCOM.BoObjectTypes.oQuotations
Dim Doc, Doc1 As SAPbobsCOM.Documents
Dim Lines As SAPbobsCOM.Document_Lines
Dim DocEntry, DocNum, LineNum, ItemCode, sErrMsg As String
Dim UnitPrice, MinPrice As String
Dim i, j As Integer
Dim bRetVal As Boolean
Dim lErrCode As Long
Doc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oQuotations)
Doc.Browser.GetByKeys(BusinessObjectInfo.ObjectKey)
DocEntry = Doc.DocEntry
DocNum = Doc.DocNum
Lines = Doc.Lines
For i = 0 To Lines.Count - 1
Lines.SetCurrentLine(i)
ItemCode = Lines.ItemCode
UnitPrice = Lines.UnitPrice
Dim Item As SAPbobsCOM.Items
Dim ItemPrice As SAPbobsCOM.Items_Prices
Item = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)
'Item.Browser.GetByKeys(ItemCode)
bRetVal = Item.GetByKey(ItemCode)
If Not bRetVal Then
oCompany.GetLastError(lErrCode, sErrMsg)
SBO_Application.MessageBox("Failed to Retrieve the record " & lErrCode & " " & sErrMsg)
Exit Sub
End If
ItemPrice = Item.PriceList
ItemPrice.SetCurrentLine(1)
MinPrice = ItemPrice.Price
If UnitPrice < MinPrice Then
Lines.UserFields.Fields.Item("U_Approve").Value = "TRUE"
End If
Dim oRecSetLines As SAPbobsCOM.Recordset
Dim sSQLtext As String
oRecSetLines = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
sSQLtext = "SELECT Price FROM ITM1 WHERE ItemCode = '" & ItemCode & "' AND PriceList = '2'"
oRecSetLines.DoQuery(sSQLtext)
If oRecSetLines.RecordCount = 1 Then
'Get the MinPrice here
oRecSetLines.MoveFirst()
MinPrice = oRecSetLines.Fields.Item(0).Value
If CDbl(oRecSetLines.Fields.Item(0).Value) < CDbl(UnitPrice) Then
'Price below MinPrice, write QUT1.U_Approve --> change to write file
Doc.UserFields.Fields.Item("U_Approve").Value = "TRUE"
Lines.UserFields.Fields.Item("U_Approve").Value = "TRUE"
End If
Else
SBO_Application.MessageBox("Error.")
End If
Next
Doc.Update()
End Select
End If
Else
End If
Catch ex As Exception
End Try
End SubAre you shure the business object does already exist in db on et_FORM_DATA_ADD beforeAction (Does getByKey return true)? Do DocNum and DocEntry make sense?
Maybe you change
If BusinessObjectInfo.BeforeAction Then
to
If Not BusinessObjectInfo.BeforeAction Then
or does that affect your idea of approving? -
I'm trying to get a handle to an object using CVI_ActiveApp. It works, but it opens a new CVI application when it is run using the command line. Is it possible to get a handle to an object without a new CVI application opening up?
Hi,
In the help documentation for the CVI_ActiveApp function, it states:
"If the server application is already running, this function may or may not start another copy of the application. This is determined by the server application."
http://zone.ni.com/reference/en-XX/help/370051P-01/cvi/usermanual/actxappactiveapp/
I don't believe you have control over whether or not a second instance is started.
Regards,
Lindsey W. | Applications Engineer | National Instruments -
Unable to handle Handle(In EJB)!!!!
hi,
i have a problem in EJBObject interface getHandle method.
i have two clients.
client one is doing
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
p.put(Context.PROVIDER_URL, "localhost:11099");
c = new InitialContext(p);
HelloHomeInterface hhi = (HelloHomeInterface) PortableRemoteObject
.narrow(c.lookup("Raghu"), HelloHomeInterface.class);
//HelloHomeInterface hhi = //(HelloHomeInterface)c.lookup("Raghu");
HelloComponentInterface hci = hhi.create();
Handle h = hci.getHandle();
FileOutputStream out = new FileOutputStream("Handlefile");
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeObject(h);while the client2 is reading that handle and try to get back the EJBObject out of it
ie
FileInputStream in = new FileInputStream("Handlefile");
ObjectInputStream s = new ObjectInputStream(in);
Handle h = (Handle) s.readObject();
Object o = h.getEJBObject();//error here
HelloComponentInterface hci = (HelloComponentInterface) PortableRemoteObject
.narrow(o, HelloComponentInterface.class);but I am getting the exception
java.rmi.ServerException: Could not get EJBObject; nested exception is:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at org.jboss.proxy.ejb.handle.StatelessHandleImpl.getEJBObject(StatelessHandleImpl.java:83)
at client.TestClint2.main(TestClint2.java:50)
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at org.jboss.proxy.ejb.handle.StatelessHandleImpl.getEJBObject(StatelessHandleImpl.java:76)
... 1 more
why so??
how to give the initial Context to the handle???no one knows the answer??????????????????????
-
Declare the factory class as a startup class. In the main() method, create a new initial context and bind a new instance of the factory class into the jndi tree under an agreed on name. Youi client code should look for the factory calss under the agreed on name.
Hope that helps.
Narendra Pasuparthy wrote:
Hi Eduardo,
Thanks for looking into my problem, I have been trying to do this thing for
the last 2 weeks and you help comes as a new sign of life to me.
Anyway i understand the problem better now, but i am still far away from
having to solve it. you say something about adding the object factory to the
JNDI tree
What you can do is add your object factory to the jndi tree. Your >bean
could look it up, etc.How can i do this, i presume that when you say jndi tree you ae referring to
the JNDI tree provided by the weblogic server; right?
If you can shed more light on how i can add my object factory to the JNDI
tree and how i can look it up i would appreciate your help.
Looking forward to hearing form you soon.
Bye,
Naren
From: [email protected] (Eduardo Ceballos)
To: narendra <[email protected]>
Subject: Re: EJB object factory
Date: Mon, 21 Aug 2000 08:42:34 -0700
MIME-Version: 1.0
Received: from [63.96.160.4] by hotmail.com (3.2) with ESMTP id
MHotMailBB6A99B0002AD820F39D3F60A0049AF50; Mon Aug 21 08:45:56 2000
Received: from san-francisco.beasys.com (san-francisco.beasys.com
[192.168.9.10])by beamail.beasys.com (8.9.1b+Sun/8.9.1) with ESMTP id
IAA08176for <[email protected]>; Mon, 21 Aug 2000 08:45:54 -0700 (PDT)
Received: from ashbury.weblogic.com (ashbury.beasys.com [172.17.8.3])by
san-francisco.beasys.com (8.9.1b+Sun/8.9.1) with ESMTP id IAA13707for
<[email protected]>; Mon, 21 Aug 2000 08:46:05 -0700 (PDT)
Received: from weblogic.com ([192.168.11.197]) by ashbury.weblogic.com
(Post.Office MTA v3.5.3 release 223 ID# 0-53833U200L200S0V35)
with ESMTP id com for <[email protected]>; Mon, 21 Aug 2000
09:03:01 -0700
From [email protected] Mon Aug 21 08:47:42 2000
Message-ID: <[email protected]>
X-Mailer: Mozilla 4.73 [en] (WinNT; I)
X-Accept-Language: en
Newsgroups: weblogic.developer.interest.rmi-iiop
References: <[email protected]>
There is no provision for a generic object factory in the public api, and
none is supported.
What you can do is add your object factory to the jndi tree. Your bean
could look it up, etc. I would urge you to
make sure that there are appropriate acls on the factory, for obvious
security reasons.
narendra wrote:
My problem is that i want to invoke a service running on another APPserver form an EJB bean,
the other app server provides some client APIwhich i can use and invokethe service. Due to the
security restriction in EJB container i was not able to do this, theapproach i am thinking
about is establishing an object factory to create an object of theother app server client
class and use that from the bean.
the weblogic server seems to handle,"javax.sql.DataSource,""javax.jms.QueueConnectionFactory,"
"javax.jms.TopicConnectionFactory" or "java.net.URL" how can it supportgeneric object factories, since I
have a obect factory that does not construct any of the objects usingthe weblogic supported object
factory.
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com -
Hello all,
I have a problem with event handling. I have two buttons in my GUI application with the same name.They are instance variables of two different objects of the same class and are put together in the one GUI.And their actionlisteners are registered with the same GUI. How can I differentiate between these two buttons?
To be more eloborate here is a basic definition of my classes
class SystemPanel{
SystemPanel(FTP ftp){ app = ftp};
FTP app;
private JButton b = new JButton("ChgDir");
b.addActionListener(app);
class FTP extends JFrame implements ActionListener{
SystemPanel rem = new SystemPanel(this);
SystemPanel loc = new SystemPanel(this);
FTP(){
add(rem);
add(loc);
pack();
show();
void actionPerformed(ActionEvent evt){
/*HOW WILL I BE ABLE TO KNOW WHICH BUTTON WAS PRESSED AS THEY
BOTH HAVE SAME ID AND getSouce() ?
In this case..it if was from rem or loc ?
} It would be really helpful if anyone could help me in this regard..
Thanks
Hari VigenshHi levi,
Thankx..
I solved the problem ..using same concept but in a different way..
One thing i wanted to make clear is that the two buttons are in the SAME CLASS and i am forming 2 different objects of the SAME class and then putting them in a GUI.THERE IS NO b and C. there is just two instances of b which belong to the SAME CLASS..
So the code
private JButton b = new JButton("ChgDir");
b.setActionCommand ("1");
wont work as both the instances would have the label "ChgDir" and have setActionCommand set to 1!!!!
Actually I have an array of buttons..So I solved the prob by writting a function caled setActionCmdRemote that would just set the action commands of one object of the class differently ..here is the code
public void setActionCommandsRemote()
for(int i = 0 ; i <cmdButtons.length ; i++)
cmdButtons.setActionCommand((cmdButtons[i].getText())+"Rem");
This just adds "rem" to the existing Actioncommand and i check it as folows in my actionperformed method
if(button.getActionCommand().equals("DeleteRem") )
deleteFileRemote();
else if(button.getActionCommand().equals("Delete") )
deleteFileLocal();Anyway thanx a milion for your help..this was my first posting and I was glad to get a prompt reply!!! -
One EJB object accessed by two clients.
One client access a EJB object another client access the same EJB
object, when the first client releases the ejb object, then second
client loses data or gets null.
Any body knows what is happening?
Thankshey,
is this with StatefulSession Bean. I too am experiencing the same problem. When two users are trying to access the same bean the same time, one is returing null. This being a UserSession Bean, one user is getting the session object as null..
Can anyone answer this problem....
cheers,
prasad. -
Need sample code to get handle of Selected rows from ADF Table
Hi,
I am new to ADF. I have an ADF table based on VO object.On some button action,I need to get handle of selected rows in application module.
If anybody is having sample code to do this then please share with me.
Thanks,
ashokwow now link http://blogs.oracle.com/smuenchadf/examples/#134 is working.thanks a lot.
also the link http://baigsorcl.blogspot.com/2010/06/deleting-multi-selected-rows-from-adf.html is very useful. Thanks a lot for Sameh Nassar too.He made it clear that in 11g Select column is not available for a ADF table and provided a solution to get Select column.
Thanks,
ashok -
Problem in getting the database connection from a connection pool
Hai All,
I am facing a problem in getting the database connection from a connection pool created on weblogic server 8.1.
I am using the Oracle database 8.1.7.
I have configured my connection pool, datasource and JNDI in weblogic.
In my java program i have the following code to retrieve the connection.
import java.sql.*;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
class jdbcshp1 {
public static void main(String[] args) {
Connection connection = null;
try {
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory"); // Wanna get rid of this.
ht.put(Context.PROVIDER_URL,"t3://localhost:7001"); // wanna get rid of this.
// Get a context for the JNDI look up
Context ctx = new InitialContext(ht);
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("myjndi1");
//Create a connection object
connection = ds.getConnection();
The above code is working fine but, the two ht.put statements are creating problem.
The problem is, after converting the application into WAR file it can be deployed
on any machine or different port on same machine. My application fails if its deployed on
weglogicserver which is at different port.
Is there any way that i can get rid of those ht.put statements or any other way to solve the problem.
any help is appreciated.
Thanks in advance
Pooja.Hai All,
Firstly, thanks for ur reply.
Even i have seen some code which uses context constructor with out any parameter and works fine.
i dont understand why its not working for my code.
When i remove those ht.put code and use context constructor with out any parameter, it giving an error.
Context ctx = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("ocjndi");
connection = ds.getConnection();The error is as follows:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
the above error is forcing me to include those code but if the port number is changed the code will not work. Plz let meknow if some setting have to be made.
I appreciate all ur valuable help.
Thanks once again.
Pooja. -
How do I get to the request object in a webflow.
How do I get to the request object in a webflow.
I created a input process and one function it needs to do is create a cookie.
Problem is I don't have a response object.
How do I create/get the response object so I can create a cookie.
Thanks
Michael C Ford
------------------ Code Line ------------------------------------
public Object process(HttpServletRequest req, Object requestContext)
throws ProcessingException
// get the pipeline and namespace info for the process
PipelineSession pSession = null;
String namespace = null;
String username = req.getRemoteUser();
pSession = getPipelineSession(req);
namespace = getCurrentNamespace(pSession);
/* ***** DO THE INITIAL CREATE OF THE BEAN *** */
try {
Properties props = new Properties();
props.put(
Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
Context ctx = new InitialContext(props);
Object homeObject = ctx.lookup("com.??.??PortalMgr");
SeechangePortalMgrHome seechangePortalMgrHome =
(SeechangePortalMgrHome) javax.rmi.PortableRemoteObject.narrow(
homeObject,
SeechangePortalMgrHome.class);
SeechangePortalMgr portalMgr = seechangePortalMgrHome.create();
/* Set the initail user */
portalMgr.setUser(username);
UserRuntime userRuntime = (UserRuntime)portalMgr.getRuntimeObject();
System.out.print("Run Time User is " + userRuntime.getUserName());
System.out.print("Run Time User is " + userRuntime.getOrgSeq());
// ** cookies for Actuate XXX=(customer sequence ID), YYY=ZZZ is a dummy per
their requirement
Cookie cCustSeqNumber = new Cookie("XXX",userRuntime.getOrgSeq());
Cookie cPassword = new Cookie("YYY","ZZZ");
cCustSeqNumber.setPath("/");
cPassword.setPath("/");
??response.addCookie(cCustSeqNumber);
??response.addCookie(cPassword);
} catch (Exception ee) {
System.out.print("Unable to create Portal Manager" + ee);
// at this point we add the logic to produce the bean
return "success";Thanks
Just what I needed, except I needed to caste response.
Michael C
"Daniel Selman" <[email protected]> wrote:
Michael,
// get the HttpServletResponse from the HttpServletRequest
HttpServletResponse response =
equest.getAttribute( WebflowConstants.HTTP_SERVLET_RESPONSE );
Cookie cPassword = new Cookie("YYY","ZZZ");
cCustSeqNumber.setPath("/");
cPassword.setPath("/");
response.addCookie(cCustSeqNumber);
response.addCookie(cPassword);
You HAVE the HttpServletRequest...
public Object process(HttpServletRequest req, ObjectrequestContext)
throws ProcessingExceptionMake sense?
Dan
"michael C Ford" <[email protected]> wrote in message
news:[email protected]...
How can I get to the response this way ?
this just stored the response as an attribute did it now ?
If I don't have it, how can I use it in a setAttribute ?
Sorry just a little slow
I can't do this can I ?
request.setAttribute(WebflowConstants.HTTP_SERVLET_RESPONSE,response);
Cookie cPassword = new Cookie("YYY","ZZZ");
cCustSeqNumber.setPath("/");
cPassword.setPath("/");
response.addCookie(cCustSeqNumber);
response.addCookie(cPassword);
"Daniel Selman" <[email protected]> wrote:
Michael,
I found this handy snippet in our code:
// Put the httpServletResponse into the request, this is done
in
case IPs want to
// use the response to deposit cookies. The IPs maynot howeverwrite
// anything to the response as this will cause an
IllegalStateException
request.setAttribute(WebflowConstants.HTTP_SERVLET_RESPONSE,
response);
So, the HttpServletResponse is bound into the HttpServletRequest usingthe
key, WebflowConstants.HTTP_SERVLET_RESPONSE.
Magic!
Sincerely,
Daniel Selman
"michael C Ford" <[email protected]> wrote in message
news:[email protected]...
How do I get to the request object in a webflow.
I created a input process and one function it needs to do is create
a
cookie.
Problem is I don't have a response object.
How do I create/get the response object so I can create a cookie.
Thanks
Michael C Ford
------------------ Code Line ------------------------------------
public Object process(HttpServletRequest req, Object
requestContext)
throws ProcessingException
// get the pipeline and namespace info for the process
PipelineSession pSession = null;
String namespace = null;
String username = req.getRemoteUser();
pSession = getPipelineSession(req);
namespace = getCurrentNamespace(pSession);
/* ***** DO THE INITIAL CREATE OF THE BEAN *** */
try {
Properties props = new Properties();
props.put(
Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
Context ctx = new InitialContext(props);
Object homeObject = ctx.lookup("com.??.??PortalMgr");
SeechangePortalMgrHome seechangePortalMgrHome =
(SeechangePortalMgrHome) javax.rmi.PortableRemoteObject.narrow(
homeObject,
SeechangePortalMgrHome.class);
SeechangePortalMgr portalMgr = seechangePortalMgrHome.create();
/* Set the initail user */
portalMgr.setUser(username);
UserRuntime userRuntime = (UserRuntime)portalMgr.getRuntimeObject();
System.out.print("Run Time User is " + userRuntime.getUserName());
System.out.print("Run Time User is " + userRuntime.getOrgSeq());
// ** cookies for Actuate XXX=(customer sequence ID), YYY=ZZZ isa
dummy per
their requirement
Cookie cCustSeqNumber = new
Cookie("XXX",userRuntime.getOrgSeq());
Cookie cPassword = new Cookie("YYY","ZZZ");
cCustSeqNumber.setPath("/");
cPassword.setPath("/");
??response.addCookie(cCustSeqNumber);
??response.addCookie(cPassword);
} catch (Exception ee) {
System.out.print("Unable to create Portal Manager" + ee);
// at this point we add the logic to produce the bean
return "success"; -
ODS Activation Problem - Error getting SID
Hi All,
I am facing the problem while activating the request,
"Error getting SID for ODS object xxxx.i know lot of threads are there in forum but those all are taking about while loading the data to ODS,Here i loaded the data into my first ODS(here fine) and then transferring the data to another ODS while activation of Data in second ODS i am getting problem.the second ODS checked the Bex reporting.
If masterdata not existis then it can be a problme in my first ODS but i didn't face any problem in First ODS.First ODS loaded the data from R/3 and second ODS using the datamarts.
Any ideas how to solve this problem.
Thanks,Use Tcode RSRV Tests in Transaction RSRV All Elementary Tests ODS Objects Foreign Key relationship of reporting-relevant ODS object and SID table characteristics (Dbl Click)
From the right side window, expand u201CForeign Key relationship of reporting-relevant ODS object and SID table characteristics & Enter second ODS name, and click u201CTransferu201D
Now, click u201CExecuteu201D (Toolbar)u2026 and check whether the results displayed in green icon..
Otherwise, go back and click u201CCorrect erroru201D (Toolbar)...then try to activate second ODS
Maybe you are looking for
-
Cannot add music from hard disk to itunes
Help me i cant add music from my seagate freeagent go to my itunes. i tried to drag it in but it doesnt appear in the library
-
Problem with local class, static private attribute and public method
Hello SDN, Consider the following situation: 1) I have defined a LOCAL class airplane. 2) This class has a private static attribute "type table of ref to" airplane (array of airplanes) 3) A public method should return the private static table attribu
-
What happened to this thread: "Persistence and Transient fields"? I tried replying and got a 500; later on I came back and tried to refresh the thread and it no longer exists. Btw jschell, here was my reply: jschell wrote: I don't know if it always k
-
Any DVD to Ipod prog. converts final file that is only one
is there any dvd to ipod programs out there will convert the actual final file to play in your ipod that is only one file. asking this question because right now im running videora converter and just wondering if its going to be only one file to add
-
This is something I have never dealt with much less heard of before - Our home network is an AX (n) working off of a Comcast cable modem, the AX is also tied into two small (5 port) Leviton hubs in a structured media panel. So through the AX we get w