How to invoke Java class from post.POST.jsp

Hi All,
I am trying to invoke a simple java method from post.POST.jsp
I am getting below exception while doing it.
org.apache.sling.api.scripting.ScriptEvaluationException: org.apache.sling.scripting.jsp.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 32 in the jsp file: /apps/mywebsite/components/customFormAction/post.POST.jsp
The method test() is undefined for the type DatasourceUtil
29:          
30:           ///
31:          com.day.test.datasource.DatasourceUtil dsUtil = new com.day.test.datasource.DatasourceUtilImpl();
32:          dsUtil.test();
33:           //dsUtil.validateLogin(request.getParameter("username"), request.getParameter("password"));
34:          
35:           ////
It appears to resolve the class correctly. I could run the code, if I only comment  dsUtil.test();. As soon as I uncomment, it gives above error.
In the Utill I have a simple void method which will print a simple text. My package structure is as follows.
any help will be great
Tx

1.  In the interface [1] not the implementation[2] have u defined the method test?
2.  If it is implemented, Change the bundle version in bnd file and make a new build. Then from felix console verify the latest version reflected in the bundles.
If 2 works & you are going to make lot of frequent changes then give the version as snapshot till it get stable.
[1]  com.day.test.datasource.DatasourceUtil
[2]   com.day.test.datasource.DatasourceUtilImpl

Similar Messages

  • How to call Java class from Forms 6i?

    Hi friends,
    I need to call a Java class from my Forms 6i application.
    (It runs under WIndows XP. It's a client/server application and I have only the client and the Form builder installed on my PC)
    I don't know almost anything about Java's world so your help would be very useful for me.
    Could you tell me exactly what i have to do?
    I've read in metalink several Notes, but they supposed that the Java architecture is already installed in the computer.... I only have the default installation of Developer 6i... so I would need to know:
    - How to install/configure the neccesary to execute Java classes without problem
    - How to invoke the .class from Forms 6i.
    Thanks a lot
    Jose.

    And also this one:
    Problem Description
    Installed Forms 6i Rel 2 on a MS Windows machine. When trying to Import the Java
    Classes getting the errors
    PDE-UJI0001 Failed to create the JVM
    Solution Description
    You need to to install JDK 1.2.2 to run the Java Importer. And set the PATH's
    and classpath's correctly.
    Explanation
    1. Download and install the JDK 1.2.2.
    Possibly available at: http://java.sun.com/products/archive/
    2. Assuming the JDK 1.2.2 is installed in c:\jdk1.2.2 directory and the JRE in
    C:\PROGRA~1\JAVASOFT\JRE\1.2 directory; ORACLE_HOME=C:\Dev6iR2.
    Set the PATH to
    set PATH=c:\jdk1.2.2\bin;C:\PROGRA~1\JAVASOFT\JRE\1.2\bin;C:\PROGRA~1\JAVASOFT\JRE\1.2\bin\classic;%PATH%
    ( If you are using ias9i then the JDK 1.2.2 comes with the ias installtion ,
    in this case please set the PATH to
    D:\ias9i\Apache\jdk\bin;D:\ias9i\Apache\jdk\jre\bin;D:\ias9i\Apache\jdk\jre\bin\classic;%PATH% )
    3. Set the CLASSPATH to set CLASSPATH=%CLASSPATH%;C:\Dev6iR2\TOOLS\COMMON60\JAVA\IMPORTER.JAR;.
    (If you do not set the CLASSPATH correctly you will get the error
    PDE-UJI002 Unable to find the required java importer classes)
    4. Now run the Forms Builder by using the command.
    C:\Dev6iR2\bin\ifbld60.exe
    Now the Java Importer Should Run fine.
    Francois

  • How to load java class from jsp page?

    hi all!
    Does anyone know how to load java class from jsp page?
    I try to load java class from jsp page.
    Is it possible to load java class fom jsp page?
    thanks and have a good day!

    What I mean is How to load/open java class file from jsp page?
    I think we can open Applet from jsp page by using
    <applet code=helloApplet.class width=100 height=100>
    </applet>
    but, how to open java class which is an application made by Frame?
    thanks and have a good day

  • How to invoke java application from ABAP

    How to invoke java application from ABAP  ? Suppose I needto execute a EJB wihic is running on my SAP J2EE Enigne from an ABAP Program .
    Thanks,
    Manish

    Hi Manish,
    did you get some further documents concerning "abap program calls ejb"?
    If yes, could you please send me some informations.
    Thank you for your help.
    Kind regards, Patrick.

  • Error Invoking Java class from Stored proc

    We are getting this error while calling a stored procedure that invokes a
    static function of a java class from inside Oracle 8.1.7.
    ORA-29516: Aurora assertion failure: Java thread deadlock detected
    ORA-06512: at "APPS.SERVICECONSUMERINVOKE", line 0
    ORA-06512: at line 40
    In a Toad SQL Window, when I execute the stored procedure that invokes the
    java function, it executes successfully on the first attempt. When I try to
    execute it again on the same SQL Window, it gives the above error. The java
    class is part of a package and indirectly makes a JMS request-reply call
    via other helper classes.
    The same package works fine from other web containers and
    unlike the Oracle JVM Aurora, the JVMs don't detect a deadlock.
    Why does the Aurora throw an error?

    Did you try issusing a commit and then trying again in Toad SQL Window?
    The advice is to contact support:
    ORA-29516: Aurora assertion failure: string
    Cause: An internal error occurred in the Aurora module.
    Action: Contact Oracle Worldwide Support.

  • How to call java class from pl/sql procedure ?

    Hello everyone,
    My query is..
    There is one pl/sql stored procedure which is doing some business logic and storing data in some columns of one table, suppose the table name is 'ABC' .. and the rest of columns of table ABC are getting updated using java class. Now my problem is whenever I insert data in ABC using store proc.. i have to call that java class so that it will update the rest columns ( why java class for updating the columns in ABC is ..because that logic cant be done from pl/sql proc.. it has to be done using java )
    and the other thing is.. oracle is in one machine and java is in another .. :(
    hope ..u can help me out !!
    Thank in advance !!

    but that updation have to be done from java code only.. we are using GIS tools .. have to create some shape files and update the column with that shape file.. so creation of shape file has to be done from java code only..
    so how to call java class file which is on another machine and oracle in another..

  • How to produce Java class from xsd programmatically?

    As titled, I want to generage Java class/interface from xml schema via a program. There is a tool "xjc" that can do this manually.
    I saw a sample that generates xsd file from Java class programmatically, I am figuring out if there is such a API to do the similar thing vice versa.
    Thank you in advance!

    You may want to check out this Java EE 5 Tutorial: http://docs.oracle.com/javaee/5/tutorial/doc/bnbah.html
    It has an example of generating JAXB Java classes from an XML schema.
    Can you provide a sample xsd schema and the resulting Java class/classes you want to have produced?
    XMLBeans can use an xsd and generate Java classes for containing/manipulating XML objects, though I don't think that is what you are wanting.
    You can also write an XSLT stylesheet that generates Java classes based on parameters that you provide to the stylesheet but there is no xsd schema involved. We used this at a major national bank to produce Java classes for batch processing of files sent/received between the bank and third pary companies. The Java classes generated were used to read/write delimited files, xml files and fixed format files to/from Java bean classes with the necessary getters/setters for manipulating the data.
    Without a sample of what you are trying to doi it is hard to offer much help.

  • How to invoke Java method from C++

    Hi
    My requirement is In C++ we are having three different structures, like
    struct one{
    int accontno;
    char * accountholdername;
    long balance;
    struct two{
    int startdate;
    int enddate;
    struct three{
    char* userid;
    char* userpassword;
    from c++ how to pass these structures, these structures I have to read in Java class, and in java how receive these structures.
    And the sample methods will be like: getCarsData(Input, output, Error);
    How do i call the method in JNI, if it is static int method we can call like
    getStaticIntMethodID(), instead of int if i have to pass the above mentioned structures how do i do? Should i create an object array in JNI for accessing these three structures?
    Suggestions/Samples welcome
    Thanks,

    Why did you start another thread for this?
    I was answering you in the [url http://forum.java.sun.com/thread.jspa?threadID=712137&messageID=4119725#4119725]old thread and you didn't even bother to answer back my (basic) questions.
    I told you to use the code tags when pasting code. Got ignored. I also gave you a starting example on how to achieve your goal. Flushed.
    Oh well, I'm getting used to it.
    Again.
    Before starting, allways keep near you the [url http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html]JNI reference. All the JNI functions are documented in it.
    First you need to create custom Java classes that will match the C++ stucts (remember?).
    There is no magic wand in JNI that will transform the C++ structs into the custom Java classes and vice versa.
    You'll have to code it by hand, one field at a time. It's a pain.
    So for the one, two, three C++ structs (why not posting some real names instead of this &#99;&#114;&#97;&#112;?),
    there will be JOne, JTwo and JThree Java classes.
    There is also that other Java class already existing with getCarsData() static method that will fetch the data.
    And finally the DLL function wich will call this Java static method, doing the bridge between the C++ structs and the custom Java classes, finally return the data.
    Due to the lack of explanation from your posts, I will say that the getCarsData() static method receives a parameter of type JOne
    and returns an array of JTwo objects.
    So the get_cars_data() DLL function receives a parameter which is a struct one and
    returns a pointer to an array of struct two elements.
    // C++ structs
    struct one {
        int accontno;
        char * accountholdername;
        long balance;
    struct two {
        int startdate;
        int enddate;
    struct three {
        char * userid;
        char * userpassword;
    // custom Java classes
    class JOne {
        int accontno;
        String accountholdername;
        int balance;
    class JTwo {
        int startdate;
        int enddate;
    class JThree {
        String userid;
        String userpassword;
    // Java class with static method that gets the data
    class DataFetcher {
        static JTwo[] getCarsData(JOne one) {
    // DLL function
    // struct 'one' parameter is already filled with values.
    // Returns an array of 'two' C++ struct obtained from a Java static method
    two * get_cars_data(one o) {
        JNIEnv * env;
        /** not show here is the code to either
            create the JVM or
            attach it to the current thread **/
        // get the data from 'one' C++ struct and put it in a new instance of JOne Java class
        jclass oneCls = env->FindClass("JOne");
        jmethodID oneCtorID = env->GetMethodID(oneCls, "<init>", "()V");
        jfieldID accontnoID = env->GetFieldID(oneCls, "accontno", "I");
        jfieldID accountholdernameID = env->GetFieldID(oneCls, "accountholdername", "Ljava/lang/String;");
        jfieldID balanceID = env->GetFieldID(oneCls, "balance", "I");
        jobject oneObj = env->NewObject(oneCls, oneCtorID);
        env->SetIntField(oneObj, accontnoID, o.accontno);
        env->SetObjectField(oneObj, accountholdernameID, env->NewStringUTF((const char *)o.accountholdername));
        env->SetIntField(oneObj, balanceID, o.balanceo);
        // call the Java static method
        jclass dfCls = env->FindClass("DataFetcher");
        jmethodID getCarsDataID = env->GetStaticMethodID(dfCls, "getCarsData", "(LJOne;)[LJTwo;");
        jobjectarray twoArray = (jobjectarray)env->CallStaticObjectMethod(dfCls, getCarsDataID, oneObj);
        // create the 'two' C++ struct array from the Java array of JTwo objects
        jclass twoCls = env->FindClass("JTwo");
        jfieldID startdateID = env->GetFieldID(twoCls, "startdate", "I");
        jfieldID enddateID = env->GetFieldID(twoCls, "enddate", "I");
        jint len = env->GetArrayLength(twoArray);
        two * pt = new two[len];
        for (int i = 0; i < len; i++) {
            jobject twoObj = env->GetObjectArrayElement(twoArray, i);
            pt.startdate = env->GetIntField(twoObj, startdateID);
    pt[i].enddate = env->GetIntField(twoObj, enddateID);
    // return the resulting 'two' C++ struct array
    return pt;
    Regards

  • How to invoke custom classes from logon PAR

    Hi all,
    Can someone tell me how I can invoke a java class that I have written on Click of a Submit button from the Help Page of the Login Screens. I have to customise this screen, changing the existing functionality.
    Regards,
    Ashwini.

    Hi Ashwini,
    On the onClick method of the Submit button refer the even handler method you have defined in you DynPage and in that event handler you can instantiate the required java class and call its functions.
    ex:
    in you JSP define:
    <hbj:button
         id="submitButton"
         text="Submit"
         tooltip="Click to search the forum"
         onClick="onSubmit"
    />
    in you DynPage define a event handler method called 'onSubmit(Event event)' and write you logic.
    Cheers
    Kiran

  • No Class Found Error on invoking java class from PL/SQL

    Hi There,
    I have followed instructions on how to create a java proc in the DB to invoke it from PL/SQL.
    I get a 'java.lang.NoClassDefFoundError' error because it cannot access 'org.apache.axis.description.TypeDesc' in this case. The instuctions say to add the supporting jars which contain the additional classes to the project's Additional Classpath's which I have done.
    I deploy the java classes and create the java stored proc using JDev.
    Can someone please tell me how to go about resolving this?
    I can see 'org.apache.axis.description.TypeDesc' in the DB via JDev's Databse connection in the Java Classes tree?
    Thanks,
    Anthony

    Hi There,
    I have followed instructions on how to create a java proc in the DB to invoke it from PL/SQL.
    I get a 'java.lang.NoClassDefFoundError' error because it cannot access 'org.apache.axis.description.TypeDesc' in this case. The instuctions say to add the supporting jars which contain the additional classes to the project's Additional Classpath's which I have done.
    I deploy the java classes and create the java stored proc using JDev.
    Can someone please tell me how to go about resolving this?
    I can see 'org.apache.axis.description.TypeDesc' in the DB via JDev's Databse connection in the Java Classes tree?
    Thanks,
    Anthony

  • How to call java classes from javascript?

    i have a button which calls javascript i need to access a class to update the values in the database.. how do you call the java code from within the javascript?
    the class is stored under tomcats classes directory and is accessed:
    com.Database.Employee
    the method is called : UpdateEmployeeDetails
    the button
    <input type="button" value="Save" onclick="submitForm('save')" />the javascript
    <script language="javascript">
            function submitForm(process){    
                document.myForm.action="update.jsp";
                document.myForm.submit();
    </script>

    is it not possible?
    do i have to refresh the page and read in the values like...
    <%
    String ename = request.getParameter( "EmployeeName");
         session.setAttribute( "ename", ename);
    %>and then call the class from here?
    looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
    is ajax better or not really worth it?
    i have anything up to 100 fields that need saving at one save click

  • How to invoke java class automatically at a fixed time everyday

    How to invoke a java class automatically using Quartz scheduler or any other simplified way
    I am trying to schedule a job in my web application and need to understand conceptually How to make it work using quartz . The job is scheduled to be executed at 4 pm daily. Am testing the same and It works well when i run it as standalone application manually.
    How to configure it that when i start my aplication it should run at its own through quartz.
    I am avoiding use of servlet init method and java timer though any alternatives there?
    Thanks for your help.

    I've not see quartz... are you in Windows, Solaris, Linux, or Mac?
    Are you using JAR files or class files?
    Windows: javaw myClass (I cannot remember right off if you have to have the .class on the end)
    Windows: java -jar myJAR.jar
    Solaris java -jar myJAR.jar
    Linux java -jar myJAR.jar
    Mac?

  • Invoking Java classes from Forms

    We are running an AIX Forms server, and we would like to be able to execute a java class with two command-line parameters (ex. "java myClass.class param1 param2"). Is the "java" run-time executable available on AIX? I'm assuming it would be part of the JRE installed with Oracle 8.1.6, but where might I find it, and can it be called with the HOST() command?
    Thanks,
    Jonathan

    I think if you have forms server installed you will have a java runtime there on the disk somewhere.
    Regarding activating the java check out the "java importer" tool that comes with patch 4 of developer 6i.
    null

  • How to run java class from over the web

    hi i ftped my java files to an asp web site.
    if it were my local computer i would open up the c prompt and run it with the command java ....
    but is there a way for me to execute this java file in the same way
    stephen

    1. the code is a java application.
    How may I run this java application on the web server
    when I do not have access to the command prompt. I would discuss this with the administrator of the web server. You will need at a minimum a JRE installed on the server and permission to execute commands remotely. If the administrator decides to grant you that permission (which is not likely unless the two of you work for the same company), he should also be able to explain to you how to do that.

  • XFIRE - Java class from wsdl and soap request from java class

    Hi,
    Firstly i'm newbie programmer with little experience, so please help me if u can.
    I have found an example on how to create java classes from WSDL under maven:
    (...)<taskdef classname="org.codehaus.xfire.gen.WsGenTask" name="wsgen">(...)
    I've created the below java class and I create new object of this class: UploadChunk up = new UploadChunk()
    and up.setSomething(123) etc....
    I have some service for which I have to prepare soap request manually - suitable for my service requests.
    I'm doing it using dom4j to create xml documents and i rewrite values to it from my variable up.
    I wonder if it is possible to do it automatically - I have UploadChunk object and I want do use xFire library somehow to produce ready or almost ready soap request. I want to do it in my code, no some ant or maven task.
    So I propably need a couple line of code, when I have:
    up.setSomething(123);
    //////CONVERTION - CAN U TELL ME HOW TO DO THAT PLEASE? I haven't found the way :( it seems I need your help.
    //////Document result =....
    callService(result,namespace,qname);
    import javax.xml.bind.annotation.XmlAccessType;
    import javax.xml.bind.annotation.XmlAccessorType;
    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlType;
    * <p>Java class for UploadChunk complex type.
    * <p>The following schema fragment specifies the expected content contained within this class.
    * <pre>
    * <complexType name="UploadChunk">
    *   <complexContent>
    *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    *       <sequence>
    *         <element name="SessionID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
    *         <element name="InputFileName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
    *         <element name="Buffer" type="{http://www.w3.org/2001/XMLSchema}base64Binary" minOccurs="0"/>
    *         <element name="Offset" type="{http://www.w3.org/2001/XMLSchema}long"/>
    *         <element name="BytesRead" type="{http://www.w3.org/2001/XMLSchema}int"/>
    *       </sequence>
    *     </restriction>
    *   </complexContent>
    * </complexType>
    * </pre>
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "UploadChunk", propOrder = {
        "sessionID",
        "inputFileName",
        "buffer",
        "offset",
        "bytesRead"
    public class UploadChunk {
        @XmlElement(name = "SessionID")
        protected String sessionID;
        @XmlElement(name = "InputFileName")
        protected String inputFileName;
        @XmlElement(name = "Buffer")
        protected byte[] buffer;
        @XmlElement(name = "Offset")
        protected long offset;
        @XmlElement(name = "BytesRead")
        protected int bytesRead;
         * Gets the value of the sessionID property.
         * @return
         *     possible object is
         *     {@link String }
        public String getSessionID() {
            return sessionID;
         * Sets the value of the sessionID property.
         * @param value
         *     allowed object is
         *     {@link String }
        public void setSessionID(String value) {
            this.sessionID = value;
         * Gets the value of the inputFileName property.
         * @return
         *     possible object is
         *     {@link String }
        public String getInputFileName() {
            return inputFileName;
         * Sets the value of the inputFileName property.
         * @param value
         *     allowed object is
         *     {@link String }
        public void setInputFileName(String value) {
            this.inputFileName = value;
         * Gets the value of the buffer property.
         * @return
         *     possible object is
         *     byte[]
        public byte[] getBuffer() {
            return buffer;
         * Sets the value of the buffer property.
         * @param value
         *     allowed object is
         *     byte[]
        public void setBuffer(byte[] value) {
            this.buffer = ((byte[]) value);
         * Gets the value of the offset property.
        public long getOffset() {
            return offset;
         * Sets the value of the offset property.
        public void setOffset(long value) {
            this.offset = value;
         * Gets the value of the bytesRead property.
        public int getBytesRead() {
            return bytesRead;
         * Sets the value of the bytesRead property.
        public void setBytesRead(int value) {
            this.bytesRead = value;
    }

    Hi,
    Can u Please post the WSDL..here. I remember long back i resolved this kind of issue...when i was getting "*parameters is already defined in - - -*" while using ClientGen.
    Once i will get the WSDL may be i can recall it...
    If u have any problem in Posting the WSDL..in Forums .. then let me know I will send my E-Mail Address...
    As far as i remember ..it usually happens when we Run ClientGen task of WLS81 ON the WebService/WSDL generated by WebLogic 9.x or Above. Please let me know if this is the Case with you as well... . I remember there is a Patch for it...for WLS8 ClientGen task...I dont remember the Patch Number Exactly.
    Just For testing:
    Just Use WLS9.x ClientGen task On the Same WSDL
    <taskdef name="clientgen" classname="weblogic.wsee.tools.anttasks.ClientGenTask" />
    I am sure you will not see this issue... because the issue is there only with WLS8 Clientgen...
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com (WebLogic Wonders Are Here)
    Edited by: Jay SenSharma on Jan 8, 2010 4:32 PM
    Edited by: Jay SenSharma on Jan 8, 2010 4:34 PM

Maybe you are looking for