Hook java method into xquery engine

Hello everyone,
I'm using XmlBeans to execute dynamic XQuery computations on some XML data - via XmlObject.execQuery() (I'm currently using WL8.1sp3).
Now, I need to query an external DB table, necessarily from within the XQuery source; so I need to configure the engine to call my method upon invocation of an XQuery function. Is this possible? How?
Thank you for your attention,
D. Barra
eisenach

I know what ALDSP is, and I've used it already in some other contexts. I meant, it won't be bought by this customer, so it's not available to me :-(
What I was trying to accomplish is to emulate the 'User Method's as you see and use them by XQuery into Workshop's transformation controls: you write a method in java, then mark it with the "@dtf:xquery-function" annotation, et voilà, it's magically available in other xquery transformations.
The problem is that this area is undocumented (maybe intentionally), so I'm stuck to bypass this problem in some other way.
Regards,
D. Barra

Similar Messages

  • Executing java method into javascript

    Hi guys, have a .jsp and I'm trying to call a metod in a class (DBCombo.class), but nothing happens in fact de <% %> simbols don't change to color red.
    Is it posible to execute, assign values from javascript to java?
    <script>
    <!--
    function fFillCmbHerr(){
    if (document.frmEmpCan.cmbHerr.value == 'xx')
    <% sHerrSelCmb=db.getSistOpeCmb();%>
    -->     
    </script>
    Thanx

    I think you are addressing the wrong Forum. Go to http://forum.java.sun.com/index.jsp and select a forum more closely related to your question.
    Jane

  • How to call java method in jsp file?

    can anyone guide me or teach me how can i call the java method into the jsp file? do i need a main method to call it in? or just call the method that i need 2 use only??
    below is the coding that i did. one is java and another one is jsp. hope that someone can help me on it. Thanks!!!! Really appreciate it.
    Country Method.java
    package Test;
    import java.io.File;
    import com.db4o.*;
    import com.db4o.ObjectContainer;
    import com.db4o.ObjectSet;
    public class countryMethod {
         public final static String filename = "C:\\TestStore.yap";
         public String record;
         public int value;
         public String cName1;
         private static ObjectContainer db = Db4o.openFile(filename);
         public static void storeData() {
              //Delete existing data file
              new File(filename).delete();
              //Open Database
              db = Db4o.openFile(filename);
              //Add value into database
              Country c1 = new Country(100, "Malaysia");
              Country c2 = new Country(200, "Thailand");
              Country c3 = new Country(300, "Sing");
              Country c4 = new Country(400, "Japan");
              Country c5 = new Country(500, "Indian");
              db.set(c1);
              db.set(c2);
              db.set(c3);
              db.set(c4);
              db.set(c5);
              System.out.println("abc");
         public String getData() {
              String str = "";
              try {
                   //open database
                   ObjectContainer db = Db4o.openFile(filename);
                   //Create empty object
                   Country country = new Country(0,null);
                   //Object dataset
                   ObjectSet result = db.get(country);
                   //System.out.println(result.size());
                   while(result.hasNext()){
                        Country a = (Country)result.next();
                        record = a.getName();
                        value = a.getValue();
                        str = str +" | "+ value;
                        //System.out.println(str);
                        //System.out.println(a.getValue());
              }catch(Exception s){
                   s.printStackTrace();
              str = str +" | "+ record;
              return str;
         /*public int getValue(){
              return value;
    }and the jsp.
    <%@page import com.db4o.ObjectContainer%>
    <html>
    <head><title>Testing page</titile></head>
    <body>
    <jsp:useBean id="link" class = "Test.countryMethod" />
    <%=link.getData() %>
    </body>
    </html>

    i try on the easier that i can but still i have error displaying it
    here are the files
    package com;
    public class CountryPeople {
         public String name;
         private int value;
         public CountryPeople(String name, int value){
              this.name = "Eric";
              this.value = 2;
         public String getName() {
              return name;
         public int getValue(){
              return value;
    }JSP file will be
    <html>
    <head><title>Testing page</titile></head>
    <body>
    <jsp:useBean id="store" class="com.CountryPeople"/>
    <jsp:setProperty name="store" property="name" />
    <jsp:setProperty name="store" property="value" />
    <%= store.getName() %>
    <jsp:getProperty name="store" property="name" />
    <jsp:getProperty name="store" property="value" />
    </body>
    </html>JAVA File
    <html>
    <head><title>Testing page</titile></head>
    <body>
    <jsp:useBean id="store" class="com.CountryPeople"/>
    <jsp:setProperty name="store" property="name" />
    <jsp:setProperty name="store" property="value" />
    <%= store.getName() %>
    <jsp:getProperty name="store" property="name" />
    <jsp:getProperty name="store" property="value" />
    </body>
    </html>The end message is
    the error message
    at [org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Hope that you guys can me. Thanks

  • How to make plsql parser around java method

    can someone tell me how can i move Jdeveloper java method into oracle DB (how to make plsql parser around java method). Is this possible becouse in google i can not find any good example how to make this.

    Hi,
    I think you are talking about Java Stored Procedure (?)
    Look here, http://download.oracle.com/docs/cd/E11882_01/java.112/e10588/toc.htm
    Regards
    Peter

  • How to pass a JavaScript variable into a java method

    I would like to know how to pass a JavaScript variable into a java method with in a <% %> tag inside a JSP file like so:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <script LANGUAGE="JavaScript">
    myValue = someDynamicValue;
    <% System.out.println(myValue)%>
    </script>
    </head>
    <body>
    </body>
    </html>
    obviously "System.out.println(myValue)" will not work because myValue is seen as a java variable and not a JavaScript variable.
    I would like to know how to let the jsp file, that I wrote in the above code, see myValue as a JavaScript variable and not a java variable so that I can pass it to a java method.
    NOTE: the java method does not have to be a println() method, it can be any method of my choice.
    NOTE: someDynamicValue is a JavaScript value that can dynamically change

    I don't believe you can. JSPs are really just elaborate templates that an engine such as Tomcat parses and generates an HTML page based on. That page is then displayed to the user. By the time you want to use some function in Javascript, the JSP has already been parsed and generated.
    Basically, Javascript and JSPs can't talk to each other. One's server-side and the other is client-side.

  • How to call a java method so I can pass a file into the method

    I want to pass a file into a java method method from the main method. Can anyone give me some help as to how I pass the file into the method - do I pass the file name ? are there any special points I need to put in the methods signature etc ?
    FileReader file = new FileReader("Scores");
    BufferedReader infile = new BufferedReader(file);
    Where am I supposed to put the above text - in the main method or the one I want to pass the file into to?
    Thanks

    It's a matter of personal preference really. I would encapsulate all of the file-parsing logic in a separate class that implements an interface so that if in the future you want to start taking the integers from another source, e.g. a db, you wouldn't need to drastically alter your main application code. Probably something like this, (with an assumption that the numbers are delimited by a comma and a realisation that my file-handling routine sucks):
    public class MyApp{
    public static void main(String[] args){
    IntegerGather g = new FileIntegerGatherer();
    Integer[] result = g.getIntegers(args[0]);
    public interface IntegerGatherer{
    public Integer[] getIntegers(String location);
    import java.io.*;
    public class FileIntegerGatherer implements IntegerGatherer{
    public Integer[] getIntegers(String location){
    FileInputStream fs=null;
    try{
    File f = new File(location);
    fs = new FileInputStream(f);
    byte[] in = new byte[1024];
    StringBuffer sb = new StringBuffer();
    while((fs.read(in))!=-1){
    sb.append(new String(in));
    StringTokenizer st = new StringTokenizer(sb.toString(),",");
    Integer[] result = new Integer[st.countTokens()];
    int count = 0;
    while(st.hasMoreTokens()){
    result[count]=Integer.valueOf(st.nextToken());
    count++;
    catch(IOException e){
    //something sensible here
    finally{
    if(fs!=null){
    try{
    fs.close();
    catch(IOException f){
    return result;
    Once compiled you could invoke it as java MyApp c:\myInts.txt
    Sorry if there are typos in there, I don't have an ide open ;->

  • How to pass a file into a java method

    I am trying to pass a file into a java method so I can read the file from inside the method. How can I do this? I am confident passing int, char, arrays etc into methods as I know how to identify them in a methods signature but I have no idea how to decalre a file in a mthods signature. Any ideas please ?
    Thanks

    Hi,
    Just go thru the URL,
    http://www6.software.ibm.com/devtools/news1001/art24.htm#toc2
    I hope you will get a fair understanding of 'what is pass by reference/value'.
    You can pass Object reference as an argument.
    What Pablo Lucien had written is right. But the ideal situation is if you are not modifying the
    file in the calling method, then you can pass the String (file name) as an argument to the called method.
    Sudha

  • How to execute a Java method when row inserted into a database table?

    I have the need to fire off a java method when a row is inserted into a database table. I am unfortunately working with MySQL which just recently supported triggers but these new triggers can not execute a Java application on any event.
    What I am looking for is an event driven approach such that when a row is inserted into a specific table I can fire off a java method (sitting in a tomcat container) that will take the contents and send it to a web service.
    It has been mentioned that JMS may have the ability to poll and monitor a database table. Just wondering if anyone could point me in the right direction.
    thanks
    JavaTek

    A service handler might be the right way to run some code at the end of a service call (another way would be to make use of filters).
    First, make sure your static table is merged with ServiceHandlers.
    Secondary, change your custom method name into one that is not already in the service definition of COLLECTION_COPY_LOT (preferably a unique method name like collectionCopyLotLastAction that describes its purpose) and remove the following line from your code:
    m_service.doCodeEx("",this);Now create a service definition for COLLECTION_COPY_LOT in your custom component based on the original COLLECTION_COPY_LOT (copy paste from the original service definition) and add you own method collectionCopyLotLastAction as the last step in the service. Play with the load order to make sure CS is using your service definition of COLLECTION_COPY_LOT instead of the original.
    regards,
    Fabian

  • No message reach into Integration Engine ...

    Hello,
    I have following problem. I send message to XI through SOAP adapter. But the message doesn't reach of Integration Engine. It is delivered into Adapter Engine and then it stays in status "Waiting". When open message detail in RWB I get these information:
    Message Data
    Attribute     Value
    Engine     Adapter Engine
    Status     Waiting
    Repeatable     Yes
    Cancelable     Yes
    Start     29.08.2008 12:14:59
    End     29.08.2008 12:14:59
    +Sender Party     +
    Sender Service     BS_GetSupperior
    Sender Interface     http://sntcz.cz/xmlns/holidays
    MI_Holiday
    +Receiver Party     +
    +Receiver Service     +
    +Receiver Interface     +
    Quality of Service     Exactly Once
    Error Category     XI_J2EE_ADAPTER_XI_HANDLER
    Error Code     GENERAL_ERROR
    Message     55C9628075B311DDABE200301875333B
    +Reference     +
    ... and in defaultTrace file occures this message:
    #1.5#00301875333B0057000000DE0000109C00045596D2CD72D8#1220006176812#com.sap.aii.af.ra.ms.impl.core.queue.SendConsumer##com.sap.aii.af.ra.ms.impl.core.queue.SendConsumer.onMessage(QueueMessage, boolean)#J2EE_GUEST#0##srvbr05_NW4_2798750#XISUPER#18255d00759d11ddc1a500301875333b#SAPEngine_Application_Thread[impl:3]_31##0#0#Error##Java###Transmitting the message to endpoint using connection failed, due to: .#3#AFW#com.sap.aii.af.ra.ms.api.RecoverableException: Received HTTP response code 500 : Error during conversion of XI message#http://srvbr05:8000/sap/xi/engine?type=entry#
    #1.5#00301875333B004B0000009D0000109C00045596D2CE9B64#1220006176890#com.sap.aii.messaging.srt.xmb.XMBWebServiceExtension#sap.com/com.sap.aii.af.soapadapter#com.sap.aii.messaging.srt.xmb.XMBWebServiceExtension#XISUPER#2919##srvbr05_NW4_2798750#XISUPER#ecff64f075af11dda90200301875333b#XI SOAP[BS_GetSupperior_SOAP/BS_GetSupperior/]_2449##0#0#Error##Plain###no message ID available#
    #1.5#00301875333B0049000001270000109C00045596D3111C00#1220006181250#XIRWB.com.sap.aii.mdt.api.server.MessageMonitoringBean#sap.com/com.sap.xi.mdt#XIRWB.com.sap.aii.mdt.api.server.MessageMonitoringBean#XISUPER#2920##srvbr05_NW4_2798750##f03f74c075af11ddb4ce00301875333b#SAPEngine_Application_Thread[impl:3]_3##0#0#Error#1#/Applications/ExchangeInfrastructure/RuntimeWorkbench#Plain###enrichMessageData(): Error during retrieving the end-to-end-monitoring information
    Thrown:
    com.sap.aii.rwb.endtoendmonitoring.util.Sxmb_Get_Pmi_Info_Fault_Exception:
         at sun.reflect.GeneratedConstructorAccessor358.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at java.lang.Class.newInstance0(Class.java:308)
         at java.lang.Class.newInstance(Class.java:261)
         at com.sap.aii.proxy.framework.core.JcoMarshaler.unmarshalException(JcoMarshaler.java:429)
         at com.sap.aii.proxy.framework.core.JcoProxy.send(JcoProxy.java:82)
         at com.sap.aii.proxy.framework.core.AbstractProxy$JcoProxyHelper.send(AbstractProxy.java:173)
         at com.sap.aii.proxy.framework.core.AbstractProxy.send$(AbstractProxy.java:141)
         at com.sap.aii.rwb.endtoendmonitoring.util.PMI_PortType.sxmb_Get_Pmi_Info(PMI_PortType.java:28)
         at com.sap.aii.mdt.api.server.MessageMonitoringBean.enrichMessageData(MessageMonitoringBean.java:965)
         at com.sap.aii.mdt.api.server.MessageMonitoringBean.setMessageList(MessageMonitoringBean.java:762)
         at com.sap.aii.mdt.api.server.MessageMonitoringBean.getPureMessageList(MessageMonitoringBean.java:568)
         at com.sap.aii.mdt.api.server.MessageMonitoringObjectImpl0.getPureMessageList(MessageMonitoringObjectImpl0.java:1016)
         at com.sap.aii.mdt.api.server.MessageMonitoring_Stub.getPureMessageList(MessageMonitoring_Stub.java:1772)
         at com.sap.aii.mdt.server.integrationserver.IntegrationServerMonitoringBean.getMessageList(IntegrationServerMonitoringBean.java:354)
         at com.sap.aii.mdt.api.server.MessageMonitoringBean.setMessageList(MessageMonitoringBean.java:744)
         at com.sap.aii.mdt.api.server.MessageMonitoringBean.getMessageList(MessageMonitoringBean.java:552)
         at com.sap.aii.mdt.api.server.MessageMonitoringObjectImpl1_1.getMessageList(MessageMonitoringObjectImpl1_1.java:657)
         at com.sap.aii.mdt.api.server.MessageMonitoring_Stub.getMessageList(MessageMonitoring_Stub.java:810)
         at com.sap.aii.mdt.util.WebUtil.generateTableViewModel(WebUtil.java:1254)
         at jsp_monitor_new1219936385390._jspService(jsp_monitor_new1219936385390.java:9)
         at com.sap.engine.services.servlets_jsp.server.jsp.JspBase.service(JspBase.java:112)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:544)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:321)
         at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:377)
         at com.sapportals.htmlb.page.PageProcessorServlet.handleRequest(PageProcessorServlet.java:68)
         at com.sapportals.htmlb.page.PageProcessorServlet.doPost(PageProcessorServlet.java:22)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    If I try to send message to XI directly through HTTP adapter the message is not delivered into Integration Engine.
    Do you have any idea what to check or where could be problem?
    Thank you in advance for every advice!
    Best regards,
    Zbynek

    Hi Zbynek,
    I think the problem is in the structure of the xml you want to send. I mean, that the structure of the message you are sending by means of SOAP adapter is not the same that the structure in the Inegration Repository.
    When you test your message with a wrong BS it is sent to the IE and you can see this message in sxmb_moni with error status. It`s obvius, there is no configuration for this scenario. However if you test your scenario with right parametes but the content (xml structure) is wrong, the step when the content of the call is converted to the structure of the IR will fail. And the message doesn`t get the IE.
    So check the content of your call.
    I hope it is useful for you.
    Regards,
    Carlos

  • Native - Java Method Call problem - "Wrong Method ID..."

    I am writing a 3d game engine using c++, with all the game logic code in Java, for the purpose of making the thing extendible, easily modifyable, etc...
    I am using J2SE JDK 1.2.2.
    Most things work fine (engine-wise), but i have a few questions about problems i am having getting the JNI to work correctly with calls to Java Methods.
    1. If I use FindClass() to get a jclass reference to a named class, I get one number back. If I then instantiate this class, and then call GetObjectClass() with the instance, I get another number, **which doesnt appear to work for anything**. What is going on here? Can the JVM give different jclass numbers for the same class? Is GetObjectClass() supposed to work?
    2. Is AllocObject() alright for instantiating Java objects? It does seem to allocate memory, and method calls work to the new object. I am aware that it doesn't call a constructor, but I like that, seeing as the initialization is handled through a different [network-synchronized] means.
    3. Using a jclass retrieved using FindClass(), which I store in a global variable, I am able to call methods on an instance that I created in a certain function. I then make sure (?) that the GC can't reclaim the class or object memory by getting a NewGlobalReference to both of them [just to be safe]. However, in a later function, I am unable to call methods using my stored method IDs, ["Wrong Method ID....JVM has been asked to shut down this application in an unusual manner..."]. I am also unable to acquire new methodIDs, as the system returns 0xCCCCCCCC for all method ID queries. Obviously, attempting to use those bogus method IDs results in a JVM crash, in a segment called [2 deep in the untraceable depths of JVM.dll] from the JNI CallVoidMethodV() function. Why is this happening? Is the GC getting in there despite my best efforts? Is it illegal to cache methodIDs, jclass references or jobject references? aaarrggh! :)
    Thanks
    Chris Forbes
    Lead Programmer
    Sprocket Interactive
    [email protected]

    Hi Chris,
    I hit the same sort of problem, when writing a JVMDI ( VM debugger hook ), in C++.
    My question remained unanswered too
    http://forum.java.sun.com/thread.jsp?forum=47&thread=461503&tstart=30&trange=30
    I didn't try a call to NewGlobalRef, as you did... but it sounds like it could be what I was missing.
    I've a couple of ideas, but nothing definite for you.
    1) maybe there's more than one classloader, so that multiple copies of the class are loaded
    2) ensure you're compiling your DLL with "quad-word" ( 8 byte ) alignment.
    Otherwise all your JNI references will be misaligned !
    Since the JNI reference maps to a C++ pointer, it's possible that you can't cache any JNI references.
    That's my vague feeling on the subject.
    As a workaround, you may have to keep requesting any JNI references, eg. jclass & jmethod's, as you need them.
    regards,
    Owen

  • How to modify a java method in Folder component

    Hi,
    I need to add some custom java code after a java method in Folder component (I am using UCM 10g, the java method is "buildResultSet" in service "COLLECTION_COPY_LOT").
    I defined service handler as described in Bex's book. My static table is:
    <@table custom_ServiceHandler@>
    <tr>
    <td>serviceName</td><td>handler</td><td>searchOrder</td>
    </tr>
    <tr>
    <td>Service</td><td>myPackage.MyClass</td><td>1</td>
    </tr>
    </table>
    Java code is :
    package myPackage
    public class MyClass extends ServiceHandler {
    public void buildResultSet() trows DataException,ServiceException
    ............. mu custom code
    m_service.doCodeEx("",this);
    If a change java method to addFiles and in static table Service to DocService, when i execute Checkin_new service it executes my custom code. I tried to change to loadorder, but have no success.
    Pls someone to tell me how can i modify this method or any other java method in "COLLECTION_COPY_LOT" service. Do i have to make some additional settings ? What other ways to modify java methods i should try ?
    I hope someone who has done someything like this to help me out.
    Thanks in advance

    A service handler might be the right way to run some code at the end of a service call (another way would be to make use of filters).
    First, make sure your static table is merged with ServiceHandlers.
    Secondary, change your custom method name into one that is not already in the service definition of COLLECTION_COPY_LOT (preferably a unique method name like collectionCopyLotLastAction that describes its purpose) and remove the following line from your code:
    m_service.doCodeEx("",this);Now create a service definition for COLLECTION_COPY_LOT in your custom component based on the original COLLECTION_COPY_LOT (copy paste from the original service definition) and add you own method collectionCopyLotLastAction as the last step in the service. Play with the load order to make sure CS is using your service definition of COLLECTION_COPY_LOT instead of the original.
    regards,
    Fabian

  • Certain Java methods only available on Tomcat, when logged in as a user

    Certain java methods are only available in a Tomcat webapp, when the Tomcat server is started in a terminal window, while the user is directly logged into the system
    When one of those methods are called from a command line app, for a split second an app pops up in the dock, even though no UI-method is called directly.
    For example include a method like javax.imageio.ImageIO.createImageInputStream into a servlet inside a tomcat webapp and start tomcat through a ssh-connection.
    The servlet will crash with following exception:
    java.lang.NoClassDefFoundError: Could not initialize class sun.java2d.Disposer
    javax.imageio.stream.FileImageInputStream.<init>(FileImageInputStream.java:82)
    javax.imageio.stream.FileImageInputStream.<init>(FileImageInputStream.java:57)
    com.sun.imageio.spi.FileImageInputStreamSpi.createInputStreamInstance(FileImage InputStreamSpi.java:37)
    javax.imageio.ImageIO.createImageInputStream(ImageIO.java:331)
    com.sage.utility.ImageUtil.getFormatName(ImageUtil.java:76)
    When Tomcat is started from a normal terminal window, while being logged into Mac OS, the very same method works without a problem.
    It looks like the problem only exists on Mac OS X... on Linux it runs without a problem under the same configurations
    I just noticed, that when the user logs out, the server will remain active, but another exception is raised:
    Can't connect to window server - not enough permissions.
    It looks like the reason for this is a crooked implementation of the java api by apple.
    Since it doesn't really work for us, doing all out administration though screen sharing, I would love to hear, that there is a way around this.

    After I filed a bug-report an Apple engineer contacted me, and asked me to try running java in headless mode: http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/
    That solved the problem!

  • Is there a tutorial on - how to call static java methods

    I have defined external JAVA resource using a .jar file and have successfully catalogged the same. Now I need to pass variables to a static method in a class and also get the return variable mapped into a BPM variable.
    Can someone share sample Java Invokation code, how to call methods in a class, how to instantiate a singleton or reference an existing instance of singleton class.
    Any sample code or sample projects will be useful.
    Also can I se ethe java system.out.println output in BPM Logviewer
    Arvind

    Hi Arvind,
    Sure you've done this, but the first step is to catalog the Jar file. Before an Oracle BPM project can use the Java component, the appropriate Java JAR files must be added to the project.
    Add the Jar File(s) to the External Resources:
    1. Right-click the External Resources item in the Project Navigator tab
    2. From the pop-up menu, select New External Resource.
    3. Name this new Java resource "MyNewJavaComponents" and ensure its type is Java Class Library.
    4. Add the Java jar file(s)
    Catalog and Expose the Java Components:
    5. Add a new module in the Catalog called "IntegrationComponents".
    6. Generate a Java integration component by right-clicking the IntegrationComponents module and select "Catalogue Component" -> "Java".
    7. Using the Java configuration you just created called MyNewJavaComponents, click the Next button to automatically introspect the Java libraries.
    8. Select the class where your method(s) are located and click the Next -> Finish buttons to have Oracle BPM generate the integration component for you.
    9. If you expand the newly exposed Java component, you can see a method has been created for each public method (attributes would also be automatically created if this class had any public attributes). If you've included the appropriate BeanInfo class in the JAR, you'll note that the method parameters are appropriately named.
    How to Invoke Public Java methods Exposed in the Catalog:
    10. Open the method editor for an automatic activity in the process (or any BPM Object method with its "Server Side" property set to "Yes").
    11. Drag one of the Java methods you just exposed inside your IntegrationComponents module into the automatic activity's method. Once you drag it in, here's what you might see if you're using the Java syntax in Oracle BPM's method editor:
    (PdfGenerator).generate(outputFilename : "", contents : {  }, logoImageURL : null, signatureImageURL : null);
    Assuming you have "outputFilename", "sampleContent", "logoURL" and "signatureURL" variables already created in your process, change the method you just dragged in to:
    IntegrationComponents.Pdfservice.PdfGenerator.generate(outputFilename : outputFilename, contents : sampleContent,
    logoImageURL : logoURL, signatureImageURL : signatureURL);
    Hope this helps,
    Dan

  • Passing variables frm xsl to a java method

    here is my current frustration -- aside from being new to java and xsl...
    i have an xml message (that is passed to me from another process) as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <WillsXMLStart>
        <inputEventStart>TRUE</inputEventStart>
        <inputEventNumber>1</inputEventNumber>
        <inputEventID>HEREISTHEID</inputEventID>
        <inputEventEnd>TRUE</inputEventEnd>
    </WillsXMLStart>ok now i am using netbeans to create and xsl to gram the information and reformat the information because the end process want the data and event tags differantly. my xsl is as follows:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:gng="java:GetAndConvert"
                    exclude-result-prefixes="gng"
                    version="2.0">
        <xsl:output     encoding="UTF-8" indent="yes" method="xml"/>
        <xsl:template match="/">
            <WillsXMLStart>
                <inputEventStart>
                    <xsl:value-of select="WillsXMLStart/inputEventStart"/>
                </inputEventStart>
                <inputEventNumber>
                    <xsl:value-of select="WillsXMLStart/inputEventNumber"/>
                </inputEventNumber>
                <inputEventID>
                    <xsl:variable name="inputVariable">
                        <xsl:value-of select="WillsXMLStart/inputEventID"/>
                    </xsl:variable>
                    <!-- <xsl:value-of select="$inputVariable"/> -->
                    <xsl:value-of select="gng:getString('$inputVariable')"/>
                </inputEventID>
                <inputEventEnd>
                    <xsl:value-of select="WillsXMLStart/inputEventEnd"/>
                </inputEventEnd>
            </WillsXMLStart>
        </xsl:template>
    </xsl:stylesheet>ok... now for the frustrating part... what i need to do is (as the code shows(i think)), get and store in a variable called "inputVariable" the specific informati that is stored in the "inputEventID" from the xml. that works fine... but i need to pass that information as a string to the java method "getString(String inputVariable)".... my java code (just a test) is as follows:
    * GetAndConvert.java
    *  @author william
    * Created on June 27, 2007, 8:04 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    public class GetAndConvert {
        /** Creates a new instance of GetAndConvert */
        public String getString(String inputVariable) {
            String x = "test";
            System.out.print("this is the string that is hardcoded into GAC: " + inputVariable);
            return x;
    }OK.... i am getting the following error when i try to run the whole thing -- translation from within XSL:
    XML validation started.
    Checking file:/home/william/PROGRAMMING/TestingJavaXML/src/testingXML-JavaInput.xsl...
    Cannot find class 'java:GetAndConvert'.
    Cannot find external method 'java:GetAndConvert.getString' (must be public).
    Could not compile stylesheeti have 2 packages in my "project". 1 = default where i have my xml and xsl files... 2 = JavaEvents where i have my .Java file.
    any and all help would really be appreciated... as i am going bald trying to figure this out. you can either post here or you can email me at: [email protected]
    thanks in advance for all your help.
    Deathsbain.

    OK... now i am getting this error...:
    XSL
    <!--
        Document   : translatorJavaXSL.xsl
        Created on : June 27, 2007, 3:53 PM
        Author     : william
        Description:
            Purpose of transformation follows.
    -->
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:gng="java:JavaSRC.xmljavamain"
                    exclude-result-prefixes="gng"
                    version="1.0">
        <xslutput encoding="UTF-8" indent="yes" method="xml"/>
        <xsl:template match="/">
            <WillsInputXML>
                <eventStart>
                    <xsl:value-of select="WillsInputXML/eventStart"/>
                </eventStart>
                <eventNumber>
                    <xsl:value-of select="WillsInputXML/eventNumber"/>
                </eventNumber>
                <eventUniqueID>
                    <xsl:variable name="inputVariable">
                        <xsl:value-of select="WillsInputXML/eventUniqueID"/>
                    </xsl:variable>
                    <xsl:value-of select="$inputVariable"/>
                    <xsl:variable name="myInstance">
                        <xsl:value-of select="gng:new()"/>
                    </xsl:variable>
                    <xsl:value-of select="gng:xmlJavaConverter($myInstance, $inputVariable)"/>
                </eventUniqueID>
                <eventEnd>
                    <xsl:value-of select="WillsInputXML/eventEnd"/>
                </eventEnd>
            </WillsInputXML>
        </xsl:template>
    </xsl:stylesheet>
    JAVA
    * xmljavamain.java
    * Created on July 2, 2007, 8:58 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package javaSRC;
    * @author william
    public class xmljavamain
        /** Creates a new instance of xmljavamain */
        public String xmlJavaConverter (String inputValue)
            return ("this is the xmljavamain function...");
    }when running the "NetBeans" translator for the XSL page i get this error.
    XML validation started.
    Checking file:/home/william/PROGRAMMING/XML-Java-XSL/src/xmljavaxsl/translatorJavaXSL.xsl...
    Cannot find class 'java:JavaSRC.xmljavamain'.
    Cannot find external constructor 'java:JavaSRC.xmljavamain'.
    The first argument to the non-static Java function 'xmlJavaConverter' is not a valid object reference.
    Could not compile stylesheet
    Could not compile stylesheet
    XML validation finished.WHAT AM I DOING WRONG?
    Deathsbain.

  • How to have the JTA transaction in ServiceEndpoint interface java method

    Hi,
    I have query how to have the JTA transaction in SEI(Service endpoint interface) generated by WSDL.
    I have a MDMListener (using MDM API) which looks for a recordchange in MDM repository which needs to be send to PI7.1 via soap request.
    1) I had imported the WSDL from ESR(PI) and generated outside-in proxy.
    2) Created ejb3.0 stateless session bean using NWDS
    3) Created web service client application by generating the WSDL again (by Generate client)
    4)Added a method callPI()with Service and i set the context with endpointaddress property as the soap location of the sender agreement configured in PI7.1.
    The damean thread listener(EventDispatcher) looks for MDM record change and it calls the method callPI() from ejbsession bean by lookup to transfer the record to PI7.1 system via webservices(web method). I hit the below error.
    Exception com.sap.engine.services.ts.exceptions.BaseIllegalStateException: Status of ( SAP J2EE Engine JTA Transaction : 06223ffffffa20048fffffffe ) should be active, but it is STATUS_COMMITTED = 3.
    at com.sap.engine.services.ts.jta.impl.TransactionImpl.registerSynchronizationWithoutStatusChecks(TransactionImpl.java:672)
    at com.sap.engine.services.ts.jta.impl.TransactionImpl.registerSynchronization(TransactionImpl.java:641)
    at com.sap.engine.services.ts.transaction.TxLevelSynchronizations.addSynchronization(TxLevelSynchronizations.java:118)
    at com.sap.engine.services.ts.transaction.TxManagerImpl.registerSynchronization(TxManagerImpl.java:829)
    at com.sap.transaction.TxManager.registerSynchronization(TxManager.java:303)
    at com.sap.engine.messaging.runtime.j2ee.sapengine.SAPTransactionManager.registerSynchronization(SAPTransactionManager.java:126)
    at com.sap.engine.messaging.impl.util.tx.TxController.<init>(TxController.java:83)
    //Method in the ejb stateless session bean
    @WebServiceRef (name="DistributeMasterDataService") DistributeMasterDataService service;
    @RelMessagingNW05DTOperation(enableWSRM=true)
    public void callPi(DistributeMasterDataRequestType req) {
    port.distributeMasterDataOutA(req);// the distributeMasterDataOutA is the method available in SEI..Here is the issue on JTA
    For the first time the message(req object)transmits to the PI successfully,but for the second call i hit this JTA Transaction :status should be active, but it is STATUS_COMMITTED = 3.
    I tried chanding the transactionmanagement from container to bean.
    @TransactionManagement(value=TransactionManagementType.BEAN)
    @TransactionAttribute(value=TransactionAttributeType.REQUIRES_NEW)
    I wanted to know how can i have the JTA transaction status in SEI(service enpoint interface)java method distributeMasterDataOutA.Since it is an interface i dont know what annotation can be used.
    If its possible i can try this UserTransaction,
    http://help.sap.com/saphelp_nw04/helpdata/de/f6/7a8df922db4ab79342b46c48dac7d0/content.htm
    ut.begin() & ut.commit(),so that everytime this method is called it will treat as a new transaction..
    Let me know if you need more details??,Any idea provided would be great.
    Thanks
    Sabarinathan

    Hello everybody,
    The issue resolved,we need to have the bean management transaction type and not the container.
    and the transactionattribute value as Requires New
    rgds
    Sabarinathan
    Edited by: Sabarinathan Selvaraj on May 12, 2009 2:17 PM

Maybe you are looking for