Problem calling a EJB Java Client from Java Activity Agent

Hi,
We have a wrapper java class that calls to an EJB through a JNDI lookup. The wrapper class is called from a workflow. The problem is that the call fail with the following message error:
Error : getRemoteHome Lugar: ServiceLocator NamingException Mensaje Error: Receive timed out
Mon Jan 09 15:32:13 EST 2006 Enqueuing VIC/97513 com.tallion.tax.workflow.assessment.Update
F_FN_ERROR (MODULE=com.tallion.tax.workflow.assessment.Update) (ITEMTYPE=VIC) (ITEMKEY=97513) (ACTID=10617) (FUNCMODE=RUN) (ERRMESSAGE=getRemoteHome Lugar: ServiceLocator NamingException Mensaje Erro
The wrapper class has in their classpath a jndi.properties as follows:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=69.0.137.120:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
The call just works fine when we restart the Java Activity Agent and then, after a while it fails again with the same error.
Any ideas/workaround?
Thanks.

I have a situation that is a bit similar. I have successfully used beans for storing methods used in JSPs and used by other methods in the same class as was suggested above. Now I would like to break some methods into another (utility) class since they are lower level and can be used by lots of things. They are for database operations (given a String query and String dbname, it queries and returns ResultSet for example). I want to have them in a separate class for reusability and OOP.
I am having problems calling those public static methods in the public class from my bean that communicates with the JSP. I can't compile the class that calls the method in the database ops class. I get an error like :
loginHelper.java:45: cannot find symbol
symbol : variable sqlHelper
location: class dbHelperBean.loginHelper
and when I include the package name in the call I get
loginHelper.java:45: cannot find symbol
symbol : class sqlHelper
location: package dbHelperBean
That's strange since the package of both classes is dbHelperBean and the class is indeed called sqlHelper. I tried to compile it in the same directory as sqlHelper as well. What am I doing wrong?
Thanks for any help.

Similar Messages

  • Write a file on client from java procedure

    Hello to all, my problem is that i want to write a file from a java procedure using the normal java class. But when i try to write
    File file=new File("C:\\DiscoD\\myFile.txt");
    FileWriter fw=new FileWriter(file);
    fw.write("ciao");
    nothing happens and no file is created. How can i write a file on my pc client from java procedure?
    Thanks to anyone that want helps me.

    I want to write a java procedure loading java class on oracle with utility loadjava and this work for example for classical Hello World. Now i want to write data on a text file on my hard disk using class java calling the procedure for example in this mode:
    begin
    procedure('ciao'); //this procedure have to write on a file located on my pc the word ciao
    end;
    But nothing happens. Why? There is a special reason related to how oracle works(privileges, permission etc)?
    Thanks

  • Missing " Create Sample Java Client" from the context menu when debugging

    Jdev 11.1.1.3 on Windows 7 x64
    I have created an EJB - Session Bean from the ADF components and have put some logic into it with one public method.
    I have exposed the method in the local interface.
    I start the integrated server in the debug mode
    When I right-click there is no option to do the sample client.
    Am I missing a plug-in - like JUnit or something?
    From the manual:
    The integrated Oracle WebLogic Server runs within JDeveloper. You can run and test EJBs quickly and easily using this server, and then deploy your EJBs with no changes to them. You do not need to create a deployment profile to use this server, nor do you have to initialize it.
    To run a sample client on the integrated Oracle WebLogic Server: In the Application Navigator, right-click on an EJB and choose Run.
    Notice in the Message pane that Oracle WebLogic Server has been launched. Right-click on an EJB and choose Create Sample Java Client from the context menu. The default choice is to create a client for the integrated Oracle WebLogic Server, so click OK.
    The client is created and opens in the code editor. If your session bean serves as a facade over JPA entities, code is generated to instantiate the query methods. If you exposed methods on your bean, the generated client contains methods that can be uncommented to call them.
    After your EJB has been successfully started from the Application Navigator, right-click on the sample client and choose Run.

    Shay,
    Pretty much what I did exactly - except - since my apps are all using the local interface - I did not create the remote.
    This may be an old habit - but generally it is not a good practice to do both - though this may have changed lately.
    I have this app working and the EJBs are executing fine.
    I used a testview and drug the method onto it - and was able to debug it that way - but still no create java client in the menu.
    Is there any other place to find this other than the context menu? Then I can check to see if it is available.
    I am using WLS 10.3 that ships with Jdev 11.1.1.3 (forgot that little bit) without any changes.

  • Calling a PL/SQL function from java

    I would like to call a pl/sql function from java. My pl/sql function is taking arrays of records as parameters. How do i proceed? Which specific oracle packages do I have to import?
    Please send an example.
    TIA,
    Darko Guberina

    Documentation here: http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref185
    says JPublisher can publish records too.
    But when I change the example given at http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref190 as following:
    PACKAGE "COMPANY" AS
    type emp_rec is record (empno number, ename varchar2(10));
    type emp_list is varray(5) of emp_rec;
    type factory is record (
    name varchar(10),
    emps emp_list
    function get_factory(p_name varchar) return factory;
    END;
    then I see <unknown type or type not found> at sql or java files generated. Any ideas?

  • Calling native Objective C code from Java Script

    Hi,
    I want to call native objective C code from Java script.
    I know one way by using : webView:shouldStartLoadWithRequest:navigationType
    Is there another way of doing same?
    Thanks,
    Ganesh Pisal
    Vavni Inc

    Are any of those threads calling java code? If yes then are you calling the Attach method?

  • Problem calling AS3 class's methods from Flex Project

    Sorry if this is a stupid question, but after 2 days of Web
    searching and 2 books give up; I am a Java and c# programmer and am
    having problems calling AS3 classes (in packages) from Flex Builder
    2 Flex Projects; the AS3 classes work great as Flex Builder "AS3
    Projects", but when I try to use the classes in a Flex Builder
    "Flex Project" I am able to see and set their properties, but
    cannot see (through "code completion") their methods (unless the
    class extends another AS3 class; and in that case I can see the
    base class's methods). Here is the code:
    AS3 Example Class:
    package asText {
    public class CheckWord {
    public var strData:String;
    public var strAProperty:String;
    public var intAProperty:int;
    // Constructor
    public function CheckWord() {
    public function TestMethod():void {
    trace("test...");
    public function WordLength():int {
    var intLength:int = 0;
    trace(strData);
    intLength = strData.length;
    return intLength;
    } // From Method WordLength
    } // From Class CheckWord
    } // From Package asText
    The MXML code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    width="442" height="488" horizontalAlign="center"
    verticalAlign="middle"
    backgroundGradientColors="[#c0c0c0, #c0c0c0]"
    xmlns:asTheText="asText.*"
    >
    <asTheText:CheckWord strData="Test words" />
    <mx:Panel title="Welcome to ........" width="337"
    height="393" horizontalAlign="center" verticalAlign="middle"
    layout="absolute" y="15" x="50">
    <mx:Text text="First Name" enabled="true" width="68"
    fontWeight="bold" x="27.25" y="36"/>
    <mx:TextInput id="txtFName" x="112.25" y="34"/>
    <mx:Text text="Last Name" enabled="true" width="68"
    fontWeight="bold" x="27.25" y="66"/>
    <mx:TextInput x="112.25" y="64" id="txtLName"/>
    <mx:Text text="email address" enabled="true" width="87"
    fontWeight="bold" x="17.25" y="96"/>
    <mx:TextInput width="189" id="txtEmail" left="112.25"
    top="94"/>
    <mx:Button id="butSubmit" label="Submit" x="95" y="194"
    click="asTheText:TestMethod();"/>
    ..............and so on ............
    All this does is give me an 1180 error:
    1180: Call to a possibly undefined method TestMethod.
    flexConveyMovie1.mxml

    Thanks, I have it working; I was not assigning an "ID" to the
    "MXML use of the class" (whatever the formal name for that is;
    like: <asTheText:CheckWord id="MyText" strData="The Data" />
    ) and then I was not referencing that ID in what I am refering to
    as calling methods for the Class; like:
    <mx:Button id="butTest" label="Test Function" x="39"
    y="208" click="MyText.TestMethod();"/>
    Also, I did some tests on this, and I am shocked that
    apparently neither of these two "uses"(?) of a custom AS3 class
    actually "call" the Class's constructor. Does that make sense or is
    that the result of how I am structuring this?
    Phil

  • Starting exetutable java file from java code

    Hi I was wondering how I can start a executable java file from java code?
    thanks

    Hi Mkaveli,
    Yes, it's possible. If you have a JAR executable, you've just to call the main method of its starter class. For a simple executable class, just call its main method.
    This way :
    SomeStarter.main(null); // if there's no argumentSmall precision : the executable JAR or class must be specified in the classpath of your application.

  • Can we run EXE file/ Another Java Program from Java Application? How?

    Can we run EXE file and another java program from java application?
    Thanks in advance

    Example running adobe acrobat
    String command = "C:\\Program Files\\Adobe\\Acrobat 5.0\\Reader\\AcroRd32.exe /t "+selectedDocument+" \\\\CONTROL\\HP LaserJet 4L";
    Runtime rn = Runtime.getRuntime();
    Process process = rn.exec(command);
    process.waitFor();rykk

  • Error running My Web Service Client From java

    Hi,
    I have developed and successfully compiled my webservice using the fromjava programming model that comes pre-packed with Jwsdp 2.0. I ran the sample/from java sucessfully and it rn okay. I also wrote a small weservice that just concatenated 2 strings and that worked well as also. However when I implemented more complex functionality in my IMPL clas i.e calling other classes in the IMPL's package and other imported packages, I get the error below when I run my client, which was built successfully.
    Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Unknown fault type:class java.lang.NoClassDefFoundError
    [java] at com.sun.xml.ws.encoding.soap.ClientEncoderDecoder.toMessageInfo(ClientEncoderDecoder.java:82).............
    I built both the server and the client with the ant tool e.g
    <install DIR>\Sun\jwsdp-2.0\apache-ant\bin\ant server
    <install DIR>\Sun\jwsdp-2.0\apache-ant\bin\ant client
    and then ran the client like below...
    <install DIR>\Sun\jwsdp-2.0\apache-ant\bin\ant run
    Please if anyone has encountered this problem or if you know the cause of this problem, please drop a note.
    Thanks
    Dennis

    I narrowed down the problem to the fact that from my webservices impl class, I am trying to call classes and libraries that perform tasks like database calls etc....
    I think that I am not adding these classes or libraries to the jaxws environment as I should. I have ploughed through the documentation, and I noticed the <classpath> tag under <wsimport> which I added to the build.xml file pointing to my specific classes and libraries. Doing this enabled me to build the server sucessfully. However at runtime it throws that NoClassDef exception. Can some one offer some tips on how I can get the my classes to be executed at run time...
    Thanks

  • Calling an EJB 3.1 from an Application-Client

    Hello,
    I'm currently learning to use the GlassFish3-Features with help of the book "Beginning Java EE 6 Platform with GlassFish 3: From Novice to Professional (Expert's Voice in Java Technology)" from Antonio Goncalves. He says that i should use the following code to get the connection to an EJB:
                EJBContainer ec = EJBContainer.createEJBContainer();
                Context ctx = ec.getContext();
                MyBean ejbInstance = (MyBean) ctx.lookup("java:global/ejb");This does not work because I get a couple of Exceptions telling me that some classes are not serializable. This happens in the "EJBContainer.createEJBContainer() call. The classes wich are mentioned are:
    org.glassfish.javaee.services.ConnectorDescriptorProxy
    org.glassfish.javaee.services.ResourceProxy
    com.sun.enterprise.container.common.impl.util.InjectionManagerImpl
    and the application ends after this call.
    If I use instead the following code:
    {code} Context ctx = new InitialContext();
    MyBeanInterface ejbInstance = (MyBeanInterface) ctx.lookup("java:global/ejb");
    {code}
    it works.
    I use GlassFish 3.1 because there is a general bug in V3 for App-client calling an EJB, NetBeans 6.8 and SDK 6_20.
    Can anybody shed any light why the first version is not running?
    Appending the stack-trace didn't worked out. It was to big.
    Thanks and best regards,
    Willi

    it doesn't work because the lookup call does NOT return an instance of MyBean - it returns a proxy object that implements all the methods of its common interface. Hence you program against the business interface, not the implementation bean. Using this way also, you do not need to have the implementation of MyBean in your client's classpath, only the interface.

  • Pushing changes to clients from Java

    Hi,
    I have created a Flex 2 client that polls a webservice every
    minute or so which inturn returns data from a DB table (The table
    contains data that changes every couple of minutes). This is of
    course very DB intensive once you start having multiple clients all
    polling at the same time.
    I am now looking at doing it in FDS but my problem is how do
    I get FDS to update the interal java objects with new data from the
    DB (which is updated from an external source)? I read here :
    http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=L iveDocs_Parts&file=00001210.html
    that using the DataServiceTransaction might be an option.
    Perhaps from a seperate java client that some how uses the
    DataServiceTransaction class to update the data every 2 minutes of
    so? That way pushing any changes that have occured to all the
    currently connected Flex clients.
    Or am I missing a setting in the FDS that you can set to
    refresh the current java objects?
    Any help would be greatly appreciated.

    Hi, I also have a similar problem with using the
    DataServiceTransaction object from an external java program.
    I'm using flex and FDS to RTMP push data from a DB server to
    clients and I want to trigger data pushing whenever the DB gets
    updated by an external java/jdbc program.
    The problem is, I can update the DB and call the commit()
    function of the DataServiceTransaction object from a
    RemoteObject/rpc called by the flex client very much like the
    ContactVO.java object on
    THIS
    page. But I want to develop an external java program that gets
    executed separately (Not via RPC) and it will be able to update the
    DB and call the DataServiceTransaction.commit() method to push the
    updates to the flex clients.
    I built a java class to do just that as you can see below:
    * ChangeBackEnd.java
    package tony.contact;
    import flex.data.DataServiceTransaction;
    public class ChangeBackEnd
    public static void main(String[] args)
    DataServiceTransaction dtx =
    DataServiceTransaction.begin(false);
    try
    ContactVO ct = new ContactVO(1, "test", "serverAPI");
    dtx.updateItem("tony.dms.contact", ct, null, null);
    new ContactDAO().update(ct, ct);
    finally
    dtx.commit();
    And when I try to run it I get this error.
    "Exception in thread "main" java.lang.NoClassDefFoundError:
    ChangeBackEnd (wrong
    name: tony/contact/ChangeBackEnd)"
    Is there any way around this?

  • BPM 11g: problem trying invoke a process instance from Java

    Hi all,
    I'm trying use this java code http://kr.forums.oracle.com/forums/thread.jspa?messageID=9244238
    bpmServiceClientFactory = BPMServiceClientFactory.getInstance(properties, null, null);
    bpmContext = bpmServiceClientFactory.getBPMUserAuthenticationService().authenticate(user, password, null);
    Task task = bpmServiceClientFactory.getBPMServiceClient().getInstanceManagementService().createProcessInstanceTask(bpmContext, "default/SimpleExpense!1.0soa_fd9a3a31-7f6e-4577-b64a ad1cfc523559/ExpenseProcess");*
    and this is the error we get from server... *¿does someone knows how to resolve it?* Thanks.
    <16-feb-2011 18H14' CET> <Error> <RJVM> <BEA-000503> <Incoming message header or abbreviation processing failed
    java.io.InvalidClassException: oracle.bpel.services.workflow.verification.impl.WorkflowContext; local class incompatible: stream classdesc serialVersionUID = 3642712178109525089, local class serialVersionUID = 1
    java.io.InvalidClassException: oracle.bpel.services.workflow.verification.impl.WorkflowContext; local class incompatible: stream classdesc serialVersionUID = 3642712178109525089, local class serialVersionUID = 1
         at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
         at weblogic.rjvm.ClassTableEntry.readExternal(ClassTableEntry.java:36)
         at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
         at weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:65)
         at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:37)
         at weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.java:227)
         at weblogic.rjvm.MsgAbbrevInputStream.init(MsgAbbrevInputStream.java:212)
         at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:442)
         at weblogic.rjvm.http.HTTPClientJVMConnection.receiveAndDispatch(HTTPClientJVMConnection.java:378)
         at weblogic.rjvm.http.HTTPClientJVMConnection.run(HTTPClientJVMConnection.java:244)
         at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
    >
    javax.ejb.EJBException: ; nested exception is:
         java.rmi.UnmarshalException: Incoming message header or abbreviation processing failed ; nested exception is:
         java.io.InvalidClassException: oracle.bpel.services.workflow.verification.impl.WorkflowContext; local class incompatible: stream classdesc serialVersionUID = 3642712178109525089, local class serialVersionUID = 1; nested exception is: java.rmi.UnmarshalException: Incoming message header or abbreviation processing failed ; nested exception is:
         java.io.InvalidClassException: oracle.bpel.services.workflow.verification.impl.WorkflowContext; local class incompatible: stream classdesc serialVersionUID = 3642712178109525089, local class serialVersionUID = 1
    java.rmi.UnmarshalException: Incoming message header or abbreviation processing failed ; nested exception is:
         java.io.InvalidClassException: oracle.bpel.services.workflow.verification.impl.WorkflowContext; local class incompatible: stream classdesc serialVersionUID = 3642712178109525089, local class serialVersionUID = 1
         at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:451)
         at weblogic.rjvm.http.HTTPClientJVMConnection.receiveAndDispatch(HTTPClientJVMConnection.java:378)
         at weblogic.rjvm.http.HTTPClientJVMConnection.run(HTTPClientJVMConnection.java:244)
         at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
    Caused by: java.io.InvalidClassException: oracle.bpel.services.workflow.verification.impl.WorkflowContext; local class incompatible: stream classdesc serialVersionUID = 3642712178109525089, local class serialVersionUID = 1
         at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
         at weblogic.rjvm.ClassTableEntry.readExternal(ClassTableEntry.java:36)
         at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
         at weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:65)
         at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:37)
         at weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.java:227)
         at weblogic.rjvm.MsgAbbrevInputStream.init(MsgAbbrevInputStream.java:212)
         at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:442)
         ... 5 more

    I hope you have got the solution for this problem.
    will you please share the solution. as I am also facing the same...
    Thanks

  • Calling stored procedures in Sybase from java

    Hi,
    I am using the following stored procedure in Sybase
    use xyzdb
    go
    -- drop procedure if it already exist
    if object_id('up_name_select') is not null
    begin
    drop procedure up_name_select
    end
    go
    create procedure up_name_select
    @zid          numeric(7,0),
    @firstname     char(40),
    @lastname     char(40)
    as
    select zid,
    firstname,
    lastname
    from name
    where zid = @zid or
    (lastname like @lastname or firstname like @firstname)
    go
    -- update documentation records in object_docs
    delete object_docs
    from object_docs
    where object_name = "up_name_select"
    go
    insert into object_docs values("up_name_select","Selects records from the name table based upon the values of the input parameters.")
    go
    -- update documentation records in column_docs
    delete column_docs
    from column_docs
    where object_name = "up_name_select"
    go
    insert into column_docs values("up_name_select","@zid","System generated ID for an individual contact.")
    insert into column_docs values("up_name_select","@firstname","First name of the contact. SQL wild card characters are accepted.")
    insert into column_docs values("up_name_select","@lastname","Last name of the contact. SQL wild card characters are accepted.")
    go
    -- print success message and grant permissions
    if object_id('up_name_select') is not null
    begin
    print "Procedure up_name_select created."
    grant execute on up_name_select to developer_role
    end
    go
    This stored procedure selects the values from the table "name" for a given where condition (if I am not wrong).
    Can any one give me sample java code to select the records from the table "name" for a given zid.
    Thankyou in advance.
    Regards
    sgatl2

    calling stored procedures from java
    here is the sample code
    CallableStatement cs = con.prepareCall("{call selectlogin (?)}");
    cs.setString (1, "value");         
    ResultSet rs = cs.executeQuery ();
                while (rs.next ())
                //your code for display
                } more on gooooooogle
    http://www.google.com/search?q=calling+stored+procedures+from+java+with+sample+example&client=netscape-pp&rls=com.netscape:en-US

  • Calling a SP or Function from Java receiving a geometry(MDSYS.SDO_GEOMETRY)

    Hi there,
    What I want to do is: calling a stored procedure OR function from Java with a String-variable as input and receiving a geometry (SDO_GEOMETRY).
    I’m facing currently the problem of calling a stored function on oracle 11g from Java using JPA (EclipseLink), Spring 2.5.6 returning an MDSYS.SDO_GEOMETRY object.
    I’ve tried to call a stored procedure with MDSYS.SDO_GEOMETRY as an output parameter instead, but with no success.
    The function’s signature looks like this:
    CREATE or REPLACE
    FUNCTION GET_GEO_BRD_FUNCTION(p_geo_brd_id IN VARCHAR2) RETURN MDSYS.SDO_GEOMETRY AS
    sdo_geom    MDSYS.SDO_GEOMETRY := null;
    BEGIN
    /* do some fancy stuff on the database side */
      SELECT sp_geom
        INTO sdo_geom
        FROM geo_brd WHERE id = p_geo_brd_id;
      RETURN sdo_geom;
    END;
    The calling code looks like this:
    MyClass extends JpaDaoSupport{
       /** logger */
       protected static final ILogger LOG = LogFactory.getLogger(MyClass.class);
        * {@inheritDoc}
        * @see com.example.MyClass#calculateGeometry(java.lang.String)
       @Override
       public JGeometry calculateGeometry(final String id) {
           JGeometry geometry = null;
           final JpaCallback action = new JpaCallback() {
                @Override
                public Object doInJpa(final EntityManager em) throws PersistenceException {
                   final Session session = JpaHelper.getEntityManager(em).getActiveSession();
                   final StoredFunctionCall functionCall = new StoredFunctionCall();
                   functionCall.setProcedureName("GET_GEO_BRD_FUNCTION");
                   functionCall.addNamedArgument("p_geo_brd_id");
                   functionCall.setResult("sdo_geom", Oracle.sql.STRUCT.class);
                   final ValueReadQuery query = new ValueReadQuery();
                   query.setCall(functionCall);
                   query.addArgument("p_geo_brd_id");
                   final ArrayList args = new ArrayList();
                   args.add("2e531e62-2105-4522-978a-ab8baf19e273");// hardcoded for test
                   final Object result = session.executeQuery(query, args);
                   return result;
        final STRUCT result = (STRUCT) this.getJpaTemplate().execute(action);
        try {
           geometry = JGeometry.load(result);
        } catch (final SQLException e) {
           MyClass.LOG.error("Error loading JGeometry from STRUCT.", e);
           return null;
        return geometry;
    And when I execute the query I get the following error:
    Internal Exception: java.sql.SQLException: ORA-06550: Row 1, Column 13:
    PLS-00382: expression is of wrong type
    ORA-06550: Row 1, Column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    Call: BEGIN ? := GET_GEO_BRD_FUNCTION(p_geo_brd_id=>?); END;
         bind => [=> sdo_geom, 2e531e62-2105-4522-978a-ab8baf19e273]
    Query: ValueReadQuery()
    So I thought may be let's try it with a stored procedure instead...
    The procedure looks like this:
    CREATE or REPLACE
    PROCEDURE GET_GEO_BRD_PROCEDURE(p_geo_brd_id IN VARCHAR2, sdo_geom OUT MDSYS.SDO_GEOMETRY) AS
    BEGIN
    /* do some fancy stuff on the database side */
      SELECT sp_geom
        INTO sdo_geom
        from geo_brd where id = p_geo_brd_id;
    END;
    The calling Java code in case of the stored procedure looks like this (only the content of the JPACallback has changed):
    @Override
    public Object doInJpa(final EntityManager em) throws PersistenceException {
        final Session session = JpaHelper.getEntityManager(em).getActiveSession();
        final StoredProcedureCall spCall = new StoredProcedureCall();
        spCall.setProcedureName("GET_GEO_BRD_PROCEDURE");
        spCall.addNamedArgument("p_geo_brd_id", "p_geo_brd_id", String.class);
        spCall.addNamedOutputArgument("sdo_geom", "sdo_geom", OracleTypes.STRUCT);
        final ValueReadQuery query = new ValueReadQuery();
        query.setCall(spCall);
        query.addArgument("p_geo_brd_id"); // input
        final List args = new ArrayList();
        args.add("2e531e62-2105-4522-978a-ab8baf19e273");// hardcoded for test
        final Object result = session.executeQuery(query, args);
        return result;
    And when I execute the query I get the following error:
    java.sql.SQLException: ORA-06550: Row 1, Column 13:
    PLS-00306: wrong number or types of arguments in call to 'GET_GEO_BRD_PROCEDURE'
    ORA-06550: Row 1, Column 7:
    PL/SQL: Statement ignored
    So both exceptions look quite similar.
    I guess in both cases the exception description leads to the assumption, that the wrong type for the return value / output parameter is used…
    So - how can a receive a MDSYS_SDO_GEOMETRY object from a stored procedure or stored function in Java ?
    What is wrong in the Java code?
    Thank you in advance for any suggestions!
    Yours,
    Chris
    Edited by: user3938161 on 20.12.2011 07:46
    Edited by: user3938161 on Dec 20, 2011 8:06 AM: added variable declaration of JGeometry geometry in source code

    Thanks, that did the trick! ;-)
    Here is now the code for stored procedure and function for anybody else encountering the same troubles... (be aware of the parameter order and/or naming!)
    Code for stored functions:
    final JpaCallback action = new JpaCallback() {
      @Override
      public Object doInJpa(final EntityManager em) throws PersistenceException {
         final Session session = JpaHelper.getEntityManager(em).getActiveSession();
           * Using CallableStatement for stored functions
          STRUCT st = null;
          CallableStatement cs = null;
          final DatabaseLogin login = session.getLogin();
          final Connection _conn = (Connection) login.connectToDatasource(session.getDatasourceLogin().buildAccessor(), session);
          try {
             try {
                cs = _conn.prepareCall("{? = call GET_GEO_BRD_FUNCTION(?)}");
                cs.registerOutParameter(1, OracleTypes.STRUCT, "MDSYS.SDO_GEOMETRY");
                cs.setString(2, "2e531e62-2105-4522-978a-ab8baf19e273");//TODO: hardcoded for test
                cs.execute();
             } catch (final SQLException e) {
                MyClass.LOG.error("An exception occured calling the stored procedure", e);
             if (cs != null) {
                //reading geometry from the database
                try {
                   st = (STRUCT) cs.getObject(1);
                } catch (final SQLException e) {
                   MyClass.LOG.error("An exception occured converting the query result to oracle.sql.STRUCT", e);
          } finally {
             try {
                if (_conn != null && !_conn.isClosed()) {
                    _conn.close();
             } catch (final SQLException e) {
                MyClass.LOG.error("An exception occured on closing the database connection.", e);
          return st;
    final STRUCT result = (STRUCT) this.getJpaTemplate().execute(action);
    The code for stored procedure solution:
    final JpaCallback action = new JpaCallback() {
      @Override
      public Object doInJpa(final EntityManager em) throws PersistenceException {
          final Session session = JpaHelper.getEntityManager(em).getActiveSession();
           * Using CallableStatement for stored procedure
          STRUCT st = null;
          CallableStatement cs = null;
          final DatabaseLogin login = session.getLogin();
          final Connection _conn = (Connection) login.connectToDatasource(session.getDatasourceLogin().buildAccessor(), session);
          try {
             try {
                cs = _conn.prepareCall("{call GET_GEO_BRD_PROCEDURE(?,?)}");
                cs.setString("p_geo_brd_id", "2e531e62-2105-4522-978a-ab8baf19e273");
                cs.registerOutParameter("sdo_geom", OracleTypes.STRUCT, "MDSYS.SDO_GEOMETRY");
                cs.execute();
              } catch (final SQLException e) {
                MyClass.LOG.error("An exception occured calling the stored procedure", e);
              if (cs != null) {
                //reading geometry from the database
                try {
                   st = (STRUCT) cs.getObject("sdo_geom");
                } catch (final SQLException e) {
                   MyClass.LOG.error("An exception occured converting the query result to oracle.sql.STRUCT", e);
           } finally {
              try {
                if (_conn != null && !_conn.isClosed()) {
                   _conn.close();
              } catch (final SQLException e) {
                MyClass.LOG.error("An exception occured on closing the database connection.", e);
            return st;
    final STRUCT result = (STRUCT) this.getJpaTemplate().execute(action);

  • How to create a Java Client from a wsdl file...

    Hi,
    I am looking for an available option for calling a Cobol unit from a Java application( front end). I've used the MicroFocus tool for creating a wsdl file from our Cobol unit.. Now i want to use this wsdl file for creating a Java Client..
    Can any one suggest a suitable solution (software that makes use of the already existing wsdl file and generate a Java Client for that) ASAP....
    Thanks,
    roopa

    Hey you can create java client using Eclispe or WSAD or far that matter any other IDE. crate a project save the WSDLs in a package. Right click on WSDL goto webservice option. From there you can generate client.
    cheers,
    sapan
    Is it still open ?
    cheers,
    sapan
    Edited by: sapan on Feb 25, 2009 1:17 AM

Maybe you are looking for

  • How can I make the thesaurus work for spanish words?

    I have been using pages for about 4 months now, and usually I use it in english. I am currently writing a document in spanish but I can't manage to make the thesaurus, dictionary and wikipedia work for spanish words. I really need this to find synony

  • I can't find the tab in new itunes to synch my contacts.

    I can't find the tab in new itunes to synch my contacts in Itunes 11.1.3. How should I do it? I can't find the info button as stated in the guide.

  • How to insert a image which is in word file in a report ?

    I must place a Logo in a report but the image is in a Office word file. If I had the image as a file , It was be certainly easy I think. What I can do to insert this image in my report ? Regards and Thanks for helps. I work in 6i Oracle Report.

  • Printer dispenses a blank page after every printing!

    Suddenly my printer is dispensing a blank sheet of paper after almost every printing. Oddly, the only thing unusual I've done, relating to the hp printer,  is downloading the HP Printer Assistant and the HP Printer and Scan Doctor! I've checked all r

  • E65: Hide Message Notifier

    This is only a minor problem yet it still bugging me everyday. Im having trouble with this message notifier, "1 new message". It always appears on screen eventhough the message notifier of the Active Standby is on. Before I already disabled it, but w