Problem in getting Home object of EJB in WebLogic 6.1
Hello,
I have deployed my stateless session bean with remote interfaces on my weblogic server but when i tried to access it from my client which is also present in the same application (ear) then it gives the following exception.
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:42)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:30)
at java.lang.reflect.Constructor.newInstance(Constructor.java:277)
at java.lang.Class.newInstance0(Class.java:301)
at java.lang.Class.newInstance(Class.java:254)
at javax.rmi.CORBA.Util.createDelegateIfSpecified(Util.java:342)
at javax.rmi.CORBA.Util.<clinit>(Util.java:54)
at javax.rmi.PortableRemoteObject.createDelegateIfSpecified(PortableRemoteObject.java:182)
at javax.rmi.PortableRemoteObject.<clinit>(PortableRemoteObject.java:61)
at jsp_servlet.__login._jspService(__login.java:123)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2495)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Caused by: java.lang.RuntimeException: could not find or instantiate any UtilDelegate class
at weblogic.iiop.UtilDelegateImpl.<clinit>(UtilDelegateImpl.java:73)
... 18 more
My code is like :
UserRegistrationHome loginuser;
Context initial = new InitialContext();
Object objref = initial.lookup("ejb/SimpleUserRegistration");
loginuser =(UserRegistrationHome) PortableRemoteObject.narrow(objref,UserRegistrationHome.class);
UserRegistration userlogin = loginuser.create();
It comes at line with PortableRemoteObject.......
Will some one help me in this regard, as why this exception generally comes and in what settings....
Thanks in advance.
SAC
Can you tell me how resolve the problem?
Thanks,
Michael
[email protected]
Similar Messages
-
ClassCastException - While type casting Home object after EJB JNDI Lookup
Sun One Application Server throws a ClassCastException when I try to type cast Home object to it's respective interface type.
Here is the code ---
==============================================
Object obj = PortableRemoteObject.narrow( context.lookup( jndiName ), homeClass);
System.out.println("Remote Object - obj : "+obj);
if (obj != null) {
System.out.println("obj.getClass().getName() : "+obj.getClass().getName());
System.out.println("obj.getClass().getSuperclass() : "+obj.getClass().getSuperclass());
Class[] interfaces = obj.getClass().getInterfaces();
if (interfaces != null) {
for (int count = 0; count < interfaces.length; count++) {
System.out.println("interfaces[ " + count + " ].getName() : " + interfaces[ count ].getName());
}==============================================
The class name is dislpayed as the Stub class name.
While displaying the interfaces, the Home Interface name is displayed.
But later when I try to type cast it into Home Interface type, it throws a ClassCastException.
Can somebody please check this?Please post the stack trace. Also, take a look at our EJB FAQ to make sure you're doing the
recommended lookup :
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html -
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? -
Problem in getting an object in JSP page.
Hi experts,
I am forming a javabean object in the controller(servlet) and passing the object to a JSP page by setting that object as an attribute. But in that jsp page, when i compile, its not able to locate the class. At the beginning itself while typecasting the attribute as that bean object, i get an error. All the servlet, bean files are in the default package only.
This is how i used..
<%
String m = (String) request.getAttribute("mode");
//My bean object below.
adjuster_bean res=(adjuster_bean)request.getAttribute("data");
%>
And i am using like, calling the bean object's get method to set values of the text boxes in the JSP page. I need help please....Vigsen wrote:
Hi experts,
I am forming a javabean object in the controller(servlet) and passing the object to a JSP page by setting that object as an attribute. But in that jsp page, when i compile, its not able to locate the class. At the beginning itself while typecasting the attribute as that bean object, i get an error. All the servlet, bean files are in the default package only.
This is how i used..
<%
String m = (String) request.getAttribute("mode");
//My bean object below.
adjuster_bean res=(adjuster_bean)request.getAttribute("data");
%>
And i am using like, calling the bean object's get method to set values of the text boxes in the JSP page. I need help please....Are you importing the bean class in your jsp? Something like this...
<%@ page import="java.util.*, yourpackage.YourBeanClass" %> Secondly, I see standards not followed in your code...
a) Firstly, as someone else pointed out in this same post. Avoid as much as possible using java scriplets in JSPs. Instead try use JSTL and EL expressions.
b) A java class name should always start with capital letter for every word in the class name and with no underscores. Your bean class name (adjuster_bean) should be changed to something like AdjusterBean
If you want to become a good Java programmer then standards are essential. But, again, it is totally up to you to follow. -
Hi,
Can anyone pls tell me,what are the objects are created in Server after the Deployment of EJB.
Is the EJB Home Object,EJB Home Object Stub,EJB Home Object Skeleton, EJB Local Home Object, EJB LocalHome Object Stub,Ejb LocalHome Object Skeleton.And Finally both the Stub objects and Skeleton Objects will be stored in the Jndi Registry ?
Thanks in Advance,
VenkatNic,
Caching the home object is a comon practice.
Take a look here:
http://www.theserverside.com/resources/patterns_review.jsp
Look at the EJB Home Factory Pattern.
Regards,
-Dat -
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 advanceThe 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 -
Exception when invoking create method on entity ejb's home object
I have a simple entity bean. I am able to get the reference to the entity's home object. But when I run create method on entity's home interface, I get the following exception. The create method takes no arguments as the primary key is Auto-Increment field in MYSQL database. Here is the exception. I am using jdeveloper and embedded OC4J as server.
07/06/22 15:51:15 java.lang.NullPointerException
07/06/22 15:51:15 at EmployeeHome_EntityHomeWrapper2.create(EmployeeHome_EntityHomeWrapper2.java:1168)
07/06/22 15:51:15 at com.pd.EmpAddInput.addEmployee(EmpAddInput.java:64)
07/06/22 15:51:15 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
07/06/22 15:51:15 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
07/06/22 15:51:15 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
07/06/22 15:51:15 at java.lang.reflect.Method.invoke(Method.java:585)
07/06/22 15:51:15 at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
07/06/22 15:51:15 at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
07/06/22 15:51:15 at javax.faces.component.UICommand.broadcast(UICommand.java:332)
07/06/22 15:51:15 at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
07/06/22 15:51:15 at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)
07/06/22 15:51:15 at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
07/06/22 15:51:15 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:268)
07/06/22 15:51:15 at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
07/06/22 15:51:15 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
07/06/22 15:51:15 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:712)
07/06/22 15:51:15 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:369)
07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:865)
07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447)
07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:215)
07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
07/06/22 15:51:15 at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
07/06/22 15:51:15 at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
07/06/22 15:51:15 at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
07/06/22 15:51:15 at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
07/06/22 15:51:15 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
07/06/22 15:51:15 at java.lang.Thread.run(Thread.java:595)
What may be causing this exception.I have solved the problem. It had to do with the autocommit=true feature of the MYSQL connection. However I have ran into another trouble. I am getting the following exception.
java.lang.IllegalStateException: Can not call getPrimaryKey() inside ejbCreate(...) methods, the entity does not have an identity yet, see the EJB 2.0 specification chapter 10.5.4
at com.evermind.server.ejb.EJBUtils.throwGetPrimaryKeyInEJBCreateException(EJBUtils.java:892)
at EmployeeRemote_EntityBeanWrapper0.getPrimaryKey(EmployeeRemote_EntityBeanWrapper0.java:1686)
at EmployeeHome_EntityHomeWrapper2.create(EmployeeHome_EntityHomeWrapper2.java:1055)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
java.lang.IllegalStateException: Can not call getPrimaryKey() inside ejbCreate(...) methods, the entity does not have an identity yet, see the EJB 2.0 specification chapter 10.5.4
at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:109)
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:125)
at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:517)
at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:461)
at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
at __Proxy0.create(Unknown Source)
at com.pd.model.EmployeeRemoteClient.main(EmployeeRemoteClient.java:37)
I am not calling getPrimaryKey() in ejbCreate() then why this exception -
I am having problems connecting to home wifi. It was working, but now all I get is a blank white screen. I re-booted with no success.
Hi, blank white screen where exactly?
Make a New Location, Using network locations in Mac OS X ...
http://support.apple.com/kb/HT2712
10.5, 10.6, 10.7 & 10.8…
System Preferences>Network, top of window>Locations>Edit Locations, little plus icon, give it a name.
10.5.x/10.6.x/10.7.x/10.8.x instructions...
System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
The interface that connects to the Internet should be dragged to the top of the list.
If using Wifi/Airport...
Instead of joining your Network from the list, click the WiFi icon at the top, and click join other network. Fill in everything as needed.
For 10.5/10.6/10.7/10.8, System Preferences>Network, unlock the lock if need be, highlight the Interface you use to connect to Internet, click on the advanced button, click on the DNS tab, click on the little plus icon, then add these numbers...
208.67.222.222
208.67.220.220
(There may be better or faster DNS numbers in your area, but these should be a good test).
Click OK. -
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.
-
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 -
I have the Numbers-applications on both Mac mini and Macbook Air. My problem is that they don't sync so when I create a Numbers-file on the MacBook while travelling, it will not be on my Mac mini when I get home :(((
Hey iWeb plubishing problems,
I would first check to make sure that you meet the system requirements for OS X to support Documents in the Cloud. For that your Mac’s needs to be running at least OS X Lion 10.7.5 or later to make sure that everything syncs. Take a look at the article below for more information.
iCloud: Troubleshooting Documents in the Cloud
http://support.apple.com/en-us/HT203517
Take care,
-Norm G. -
Hi,
I have a question on using EJB / or RMI servers with CORBA clients using
RMI-IIOP transport, which in theory should work, but in practice has few
glitches.
Basically, I have implemented a very simple server, StockTreader, which
looks up for a symbol and returns a 'Stock' object. In the first example, I
simplified the 'Stock' object to be a mere java.lang.String, so that lookup
would simply return the 'synbol'.
Then I have implemented the above, as an RMI-IIOP server (case 1) and a
CORBA server (case 2) with respective clients, and the pair of
client-servers work fine as long as they are CORBA-to-CORBA and RMI-to-RMI.
But the problem arises when I tried using the RMI server (via IIOP) with the
CORBA client, when the client tries to narrow the object ref obtained from
the naming service into the CORBA idl defined type (StockTrader) it ends up
with a class cast exception.
This is what I did to achieve the above results:
[1] Define an RMI interface StockTrader.java (extending java.rmi.Remote)
with the method,
public String lookup( String symbol) throws RMIException;
[2] Implement the StorckTrader interface (on a PortableRemoteObject derived
class, to make it IIOP compliant), and then the server to register the stock
trader with COS Naming service as follows:
String homeName =....
StockTraderImpl trader =new StockTraderImpl();
System.out.println("binding obj <" homeName ">...");
java.util.Hashtable ht =new java.util.Hashtable();
ht.put("java.naming.factory.initial", args[2]);
ht.put("java.naming.provider.url", args[3]);
Context ctx =new InitialContext(ht);
ctx.rebind(homeName, trader);
[3] Generate the RMI-IIOP skeletons for the Implementation class,
rmic -iiop stock.StockTraderImpl
[4] generate the IDL for the RMI interface,
rmic -idl stock.StockTraderImpl
[5] Generate IDL stubs for the CORBA client,
idlj -v -fclient -emitAll StockTraderImpl.idl
[6] Write the client to use the IDL-defined stock trader,
String serverName =args[0];
String symList =args[1];
StockClient client =new StockClient();
System.out.println("init orb...");
ORB orb =ORB.init(args, null);
System.out.println("resolve init name service...");
org.omg.CORBA.Object objRef
=orb.resolve_initial_references("NameService");
NamingContext naming =NamingContextHelper.narrow(objRef);
... define a naming component etc...
org.omg.CORBA.Object obj =naming.resolve(...);
System.out.println("narrow objRef: " obj.getClass() ": " +obj);
StockTrader trader =StockTraderHelper.narrow(obj);
[7] Compile all the classes using Java 1.2.2
[8] start tnameserv (naming service), then the server to register the RMI
server obj
[9] Run the CORBA client, passing it the COSNaming service ref name (with
which the server obj is registered)
The CORBA client successfully finds the server obj ref in the naming
service, the operation StockTraderHelper.narrow() fails in the segment
below, with a class cast exception:
org.omg.CORBA.Object obj =naming.resolve(...);
StockTrader trader =StockTraderHelper.narrow(obj);
The <obj> returned by naming service turns out to be of the type;
class com.sun.rmi.iiop.CDRInputStream$1
This is of the same type when stock trader object is registered in a CORBA
server (as opposed to an RMI server), but works correctly with no casting
excpetions..
Any ideas / hints very welcome.
thanks in advance,
-hariOn the contrary... all that is being said is that we needed to provide clearer examples/documentation in the 5.1.0 release. There will be no difference between the product as found in the service pack and the product found in the 5.1.1. That is, the only substantive will be that 5.1.1 will also
include the examples.
"<=one way=>" wrote:
With reference to your and other messages, it appears that one should not
expect that WLS RMI-IIOP will work in a complex real-life system, at least
not now. In other words, support for real-life CORBA clients is not an
option in the current release of WLS.
TIA
"Eduardo Ceballos" <[email protected]> wrote in message
news:[email protected]...
We currently publish an IDL example, even though the IDL programmingmodel in Java is completely non-functional, in anticipation of the support
needs for uses who need to use IDL to talk to the Weblogic server,
generically. This example illustrates the simplest connectivity; it does not
address how
to integrate CORBA and EJB, a broad topic, fraught with peril, imo. I'llnote in passing that, to my knowledge, none of the other vendors attempt
this topic either, a point which is telling if all the less happy to hear.
For the record then, what is missing from our distribution wrt RMI-IIOPare a RMI-IIOP example, an EJB-IIOP example, an EJB-C++. In this you are
correct; better examples are forth coming.
Still, I would not call our RMI-IIOP implementation fragile. I would saythat customers have an understandably hard time accepting that the IDL
programming model is busted; busted in the sense that there are no C++
libraries to support the EJB model, and busted in the sense that there is
simply no
support in Java for an IDL interface to an EJB. Weblogic has nothing to doit being busted, although we are trying to help our customers deal with it
in productive ways.
For the moment, what there is is a RMI (over IIOP) programming model, aninherently Java to Java programming model, and true to that, we accept and
dispatch IIOP request into RMI server objects. The way I look at it is this:
it's just a protocol, like HTTP, or JRMP; it's not IDL and it has
practically nothing to do with CORBA.
ST wrote:
Eduardo,
Can you give us more details about the comment below:
I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult ot
use an idl client in java to work.It seems to me that Weblogic's RMI-IIOP is a very fragile
implementation. We
don't need a "HelloWorld" example, we need a concrete serious example(fully
tested and seriously documented) that works so that we can get a betteridea
on how to integrate CORBA and EJB.
Thanks,
Said
"Eduardo Ceballos" <[email protected]> wrote in message
news:[email protected]...
Please post request to the news group...
As I said, you must separate the idl related classes (class files and
java
files) from the rmi classes... in the rmic step, you must set a newtarget
(as you did), emit the java files into that directory (it's not clearyou
did this), then remove all the rmi class files from the class path... ifyou
need to compile more classes at that point, copy the java files to theidl
directly is you must, but you can not share the types in any way.
I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult otuse
an idl client in java to work.
Harindra Rajapakshe wrote:
Hi Eduardo,
Thanks for the help. That is the way I compiled my CORBA client, by
separating the IDL-generated stubs from the RMI ones, but still I
get a
CORBA.BAD_PARAM upon narrowing the client proxy to the interfacetype.
Here's what I did;
+ Define the RMI interfaces, in this case a StockTrader interface.
+ Implement RMI interface by extendingjavax.rmi.PortableRemoteObject
making
it IIOP compliant
+ Implemnnt an RMI server, and compile using JDK1.2.2
+ use the RMI implementation to generate CORBA idl, using RMI-IIOPplugin
utility rmic;
rmic -idl -noValueMethods -always -d idl stock.StockTraderImpl
+ generate Java mappings to the IDL generated above, using RMI-IIOPplugin
util,
idlj -v -fclient -emitAll -tf src stocks\StockTrader.idl
This creates source for the package stock and also
org.omg.CORBA.*
package, presumably IIOP type marshalling
+ compile all classes generated above using JDK1.2.2
+ Implement client (CORBA) using the classes generated above, NOTthe
RMI
proxies.
+ start RMI server, with stockTrader server obj
+ start tnameserv
+ start CORBA client
Then the client errors when trying to narrow the obj ref from the
naming
service, into the CORBA IDL defined interface using,
org.omg.CORBA.Object obj =naming.resolve(nn);
StockTrader trader =StockTraderHelper.narrow(obj); // THIS
ERRORS..!!!
throwing a CORBA.BAD_PARAM exception.
any ideas..?
Thanks in advance,
-hari
----- Original Message -----
From: Eduardo Ceballos <[email protected]>
Newsgroups: weblogic.developer.interest.rmi-iiop
To: Hari Rajapakshe <[email protected]>
Sent: Wednesday, July 26, 2000 4:38 AM
Subject: Re: problem using CORBA clients with RMI/EJBservers..!!!???
Please see the post on june 26, re Errors compiling... somewherein
there,
I suspect, you are referring to the rmi class file when you are
obliged
to
completely segregate these from the idl class files.
Hari Rajapakshe wrote:
Hi,
I have a question on using EJB / or RMI servers with CORBA
clients
using
RMI-IIOP transport, which in theory should work, but in practice
has
few
glitches.
Basically, I have implemented a very simple server,
StockTreader,
which
looks up for a symbol and returns a 'Stock' object. In the firstexample, I
simplified the 'Stock' object to be a mere java.lang.String, so
that
lookup
would simply return the 'synbol'.
Then I have implemented the above, as an RMI-IIOP server (case
1)
and a
CORBA server (case 2) with respective clients, and the pair of
client-servers work fine as long as they are CORBA-to-CORBA andRMI-to-RMI.
But the problem arises when I tried using the RMI server (via
IIOP)
with
the
CORBA client, when the client tries to narrow the object ref
obtained
from
the naming service into the CORBA idl defined type (StockTrader)
it
ends
up
with a class cast exception.
This is what I did to achieve the above results:
[1] Define an RMI interface StockTrader.java (extending
java.rmi.Remote)
with the method,
public String lookup( String symbol) throws RMIException;
[2] Implement the StorckTrader interface (on a
PortableRemoteObject
derived
class, to make it IIOP compliant), and then the server to
register
the
stock
trader with COS Naming service as follows:
String homeName =....
StockTraderImpl trader =new StockTraderImpl();
System.out.println("binding obj <" homeName ">...");
java.util.Hashtable ht =new java.util.Hashtable();
ht.put("java.naming.factory.initial", args[2]);
ht.put("java.naming.provider.url", args[3]);
Context ctx =new InitialContext(ht);
ctx.rebind(homeName, trader);
[3] Generate the RMI-IIOP skeletons for the Implementation
class,
rmic -iiop stock.StockTraderImpl
[4] generate the IDL for the RMI interface,
rmic -idl stock.StockTraderImpl
[5] Generate IDL stubs for the CORBA client,
idlj -v -fclient -emitAll StockTraderImpl.idl
[6] Write the client to use the IDL-defined stock trader,
String serverName =args[0];
String symList =args[1];
StockClient client =new StockClient();
System.out.println("init orb...");
ORB orb =ORB.init(args, null);
System.out.println("resolve init name service...");
org.omg.CORBA.Object objRef
=orb.resolve_initial_references("NameService");
NamingContext naming=NamingContextHelper.narrow(objRef);
... define a naming component etc...
org.omg.CORBA.Object obj =naming.resolve(...);
System.out.println("narrow objRef: " obj.getClass() ":"
+obj);
StockTrader trader =StockTraderHelper.narrow(obj);
[7] Compile all the classes using Java 1.2.2
[8] start tnameserv (naming service), then the server to
register
the
RMI
server obj
[9] Run the CORBA client, passing it the COSNaming service ref
name
(with
which the server obj is registered)
The CORBA client successfully finds the server obj ref in the
naming
service, the operation StockTraderHelper.narrow() fails in thesegment
below, with a class cast exception:
org.omg.CORBA.Object obj =naming.resolve(...);
StockTrader trader =StockTraderHelper.narrow(obj);
The <obj> returned by naming service turns out to be of the
type;
class com.sun.rmi.iiop.CDRInputStream$1
This is of the same type when stock trader object is registeredin a
CORBA
server (as opposed to an RMI server), but works correctly with
no
casting
excpetions..
Any ideas / hints very welcome.
thanks in advance,
-hari -
10g XE - 404 error when I click on Home Object Browser (in IE)
Greetings
I use 10g XE with my xp/sp3 system, with IE7 (initially IE8RC1-also problematic).
The problem is that if I click on Home>Object Browser
I always get a "HTTP 404 Not Found"/The "Webpage cannot be found" error message
I've followed the instructions from htp://download.oracle.com/docs/cd/B25329_01/doc/install.102/b25143/toc.htm#BABFHAEC,
I've uninstalled my antivirus (Kaspersky Internet Security 2009) and have Windows Firewall disabled
I've setup the ports needed by Oracle to my router (1521,2030,8080)
I have even started IE in safe mode(=without addons) --- iexplore -extoff
I've tried almost anything...
With other browsers (Firefox,Google Chrome, Opera)
that "Object Browser" button works ok,
BUT at other points (eg. "SQL>SQL Scripts>Create")
they all have more or less display problems (while IE shows all other things ok).
Please help :(
PS. I've read in http://kr.forums.oracle.com/forums/thread.jspa?threadID=554359
that there is a patch (#5648872) that could fix the problem,
but unfortunately http://metalink.oracle.com/ is only for Oracle's paying customers,
while I need/use Oracle 10gxe (free download) for my university lessons :( :(Yes, of course.
Here is what I get in IE now instead of a plain 404:
the first few lines:
Mon, 23 Feb 2009 23:17:20 GMT
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "FLOWS_020100.WWV_FLOW", line 11227
ORA-06512: at "FLOWS_020100.WWV_FLOW_CONDITIONS", line 392
ORA-06512: at "FLOWS_020100.WWV_FLOW_DISP_PAGE_PLUGS", line 717
ORA-06512: at "FLOWS_020100.WWV_FLOW_DISP_PAGE_PLUGS", line 309
ORA-06512: at "FLOWS_020100.WWV_FLOW", line 3098
ORA-06512: at "FLOWS_020100.WWV_FLOW", line 2422
ORA-06512: at "FLOWS_020100.WWV_FLOW", line 9357
ORA-06512: at "FLOWS_020100.F", line 236
ORA-06512: at line 30
DAD name: apex
PROCEDURE : f
+URL : [http://XDB|http://xdb/]+ HTTP Server:8080/apex/f?p=4500:1001:4320649656424332::NO:::
PARAMETERS :
+===========+
p:
+4500:1001:4320649656424332::NO:::+
the full page:
[http://pastebin.com/f39c20e60]
?:| -
Failed to lookup home for other EJB in ejbCreate()
I am trying to lookup the home for other EJB deployed on separate weblogic server in ejbCreate() of my stateless session bean.But its not doing so and doesnt throw any exception either.Can anybody explain why?
I am having the same problem too....I am using WL8.1 SP3.
I am following a Service Manager pattern which works as a Service Locator instantiating remote EJBs on a different domain.
Since I am located on Server A, I use reflection to get the EJBHome located on Server B.
I successfully get the reference to the EJBHome successfully with my InitialContext().
When I try to invoke the create() method of the EJBHome that I got using Reflection, I get the following exception:
InvocationTargetException - Target is [Could not generate mx.com.inbursa.sii.estructura.corporativa.invoker.SynchronousCommandInvokerXXXXX due to the following error: weblogic.utils.AssertionError ****** ASSERTION FAILED [InvocationTargetException - Target is [NoClassDefFoundError in class com.esiglo.comun.exception.CommandException]]
Note that I wrote it as I remember it (I will send the exact exception as soon as I can).
It seems to me that the InvocationTargetException is generated when trying to create the EJB on Server B container, as I show it is done by reflection, but it does not recognize the CommandException class. It is strange since I made sure that the JAR which contains the CommandException class is deployed in the EAR on server B.
Any ideas around this issue?
Regards
Tomas Flores -
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.
Maybe you are looking for
-
Problem in Logic for Customer Ageing Report
Hi, I am developing a Customer Ageing Report in which i am facing a problem i.e. i am taking tables BSID,BSAD in which i ham taking the open items first and then i am using for all entries in it on the open items and i had debugged it and data pickin
-
Hello Apple People, Im managing a large number of apple computers, and have recently noticed that some clients have some questionable material that they are sharing in their iTunes library. I was wandering how do you track down the user who is supply
-
Block Storage location for particular material
Hi, We gave defined storage location for finished product as follows> 1050 - 2-8° 1040 - RT When I have created one material, wrongly i have created it in 1050 instead of 1040. Then i have extend that material to 1040. Now that material is showing bo
-
Unpack Items in Handling Units
Hi, Is there any function modules or BAPI that can be used to unpack items in Handling Units that have been assigned to Outbound Delivery. Most of the FMs like BAPI_HU_UNPACK, HU_PACKING_AND_UNPACKING supports only unassigned HUs. Standard Transact
-
Disconnected Distributed Computing in Java
Hi, the organization I work for is heavily into JSP/Servlet applications. However, there are a large number of computers which have very slow network links, so they want to find some technology in which we can develop applications which are disconnec