Problem while calling java function from html

when i tried to call a java function from html i'm getting an error
object don't support this property.
what could be the reason.
This is my html.
I got this from this forum only.
My applet is accessing the system property "user.home".
I ran it in IE
<DIV id="dvObjectHolder">Applet comes here</DIV>
<br><br>
<script>
if(window.navigator.appName.toLowerCase().indexOf("netscape")!=-1){ // set object for Netscape:
     document.getElementById('dvObjectHolder').innerHTML = " <object ID='appletTest1' classid=\"java:test.class\"" +
"height=\"0\" width=\"0\" onError=\"changeObject();\"" +
          ">" +
"<param name=\"mayscript\" value=\"Y\">" +
"<param name=\"archive\" value=\"sTest.jar\">" +
"</object>";
}else if(window.navigator.appName.toLowerCase().indexOf('internet explorer')!=-1){ //set object for IE
     document.getElementById('dvObjectHolder').innerHTML = "<object ID='appletTest1' classid=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\"" +
          " height=\"0\" width=\"0\" >" +
          " <param name=\"code\" value=\"test.class\" />" +
     "<param name=\"archive\" value=\"sTest.jar\">" +
          " </object>"
</script>
<LABEL id="lblOutputText">This text will be replaced by the applet</LABEL>
<BR>
<input value="Javascript to java" type=button onClick="document.appletTest1.fromJavaScript()">

I tried this example using the repy given to an earlier post.
But its not working with me.
What i did in addition was adding plugin.jar to classpath to import netscape.javascript.*;
Let me add some more details
1) I'll add the stack trace
2) my java progrma
3) batch file to sign the applet.
1) This is the stack trace i don't know whether u will undertand this
load: class test.class not found.
java.lang.ClassNotFoundException: test.class
     at sun.applet.AppletClassLoader.findClass(Unknown Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at sun.applet.AppletClassLoader.loadClass(Unknown Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at sun.applet.AppletClassLoader.loadCode(Unknown Source)
     at sun.applet.AppletPanel.createApplet(Unknown Source)
     at sun.plugin.AppletViewer.createApplet(Unknown Source)
     at sun.applet.AppletPanel.runLoader(Unknown Source)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: C:\FastranJava\AppletObject\bin\test\class.class (The system cannot find the path specified)
     at java.io.FileInputStream.open(Native Method)
     at java.io.FileInputStream.<init>(Unknown Source)
     at java.io.FileInputStream.<init>(Unknown Source)
     at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
     at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
     at sun.applet.AppletClassLoader.getBytes(Unknown Source)
     at sun.applet.AppletClassLoader.access$100(Unknown Source)
     at sun.applet.AppletClassLoader$1.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     ... 10 more
Exception in thread "Thread-5" java.lang.NullPointerException
     at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
     at sun.plugin.AppletViewer.showAppletException(Unknown Source)
     at sun.applet.AppletPanel.runLoader(Unknown Source)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
2) Java Program
import netscape.javascript.*;
import java.applet.*;
public class test extends Applet
     private JSObject win;
     private JSObject outputLabel;
     private boolean buttonFromJavaClicked=false;
     checkJavaScriptEvent evt=new checkJavaScriptEvent();
     public void init()
          try
               evt.start();
               win=JSObject.getWindow(this);
               outputLabel=(JSObject)win.eval("document.getElementById('lblOutputText')");
               outputLabel.setMember("innerHTML", "<center><h1>From Init<br>Your Home directory" + System.getProperty("user.home") + "</h1></center>");
          catch(Exception e)
               e.printStackTrace();
     public void fromJavaScript()
          buttonFromJavaClicked=true;          
     public void fromJavaScript2()
          System.out.println("Started Form JavaScript2");
          try
               String strLbl="<center><h1>From JavaScript<br>Your Homedir:" + System.getProperty("user.home") + "</h1></center>";
               outputLabel.setMember("innerHTML", strLbl);
          catch(Exception e)
               e.printStackTrace();
     class checkJavaScriptEvent extends Thread
          public void run()
               while(true)
                    if(test.this.buttonFromJavaClicked)
                         System.out.println("OK buttonfromjava is true");
                         test.this.buttonFromJavaClicked=false;
                         fromJavaScript2();
                    try
                         Thread.sleep(3000);
                    catch(Exception e)
                         e.printStackTrace();
3) Batch file
del *.cer
del *.com
del *.jar
del *.class
javac -classpath ".;C:\Program Files\Java\jre1.5.0_06\lib\plugin.jar" test.java
keytool -genkey -keystore harm.com -keyalg rsa -dname "CN=Harm Meijer, OU=Technology, O=org, L=Amsterdam, ST=, C=NL" -alias harm -validity 3600 -keypass password -storepass password
jar cf0 test.jar *.class
jarsigner -keystore harm.com -storepass password -keypass password -signedjar sTest.jar test.jar harm
del *.class

Similar Messages

  • Calling java functions from c++

    I want to start my program from visual c++ then, call java functions and then calling c++ function. How can i do this?

    Yet another cross-poster: [Calling java functions from c++|http://www.java-forums.org/new-java/12597-calling-java-functions-c.html]

  • Call Java function from multithreaded VC++ application

    Friends, I want to call Java function from two threads of a single VC++ application. I can call it from single thread but when I call it from another thread also, JNI_CreateJavaVM() replies with an error.
    Please......help me

    Your posting is ambiguous. My impression is that you have two threads, both trying to create a java VM?

  • How to call java function from PL/sql in oracle applications

    I am trying to call a java function from plsql procedure. Can any one explain how to call java function, and in which directory I have to store my java function in oracle applications. Do I need to register that java function from Application developer.
    Thanks
    Kranthi

    http://www.oracle.com/technology/tech/java/jsp/index.html
    Good Luck,
    Avi.

  • Error while calling java program from ABAP

    Hi Experts,
    We are trying for RFC inbound scenario.
    We followed the below blog
    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    We are working with SAP JCO 3.0.2
    We are getting the error : 'STFC_CONNECTION' could not be found in the server repository.
    After I run the Java server program if I execute the RFC destination directly from SM 59 it is showing successful messages.
    If I stop the java program then this RFC is failing. Based on this we concluded that RFC to Java connection is working fine.
    But as mentioned in blog if we call the RFC Destination from ABAP program it is giving the below error,
    'STFC_CONNECTION' could not be found in the server repository.
    If we test the RFC destination using RFC_TRUSTED_CHECK standard FM we are getting the below error.
    'RFCPING' could not be found in the server repository.
    We create the RFC destination of Type : TCP/IP as exactly mention in the blog.
    Please help us in resolving this issue.
    Thanks
    Prince

    Pabi,
    Using the RFC connection,we can establish a link between Java and SAP.
    Afterwards,hope we can call Java program from ABAP.
    Below is the sample piece of code to establish RFC connection(link) between Java and SAP.
    DATA: REQUTEXT LIKE SY-LISEL,
          RESPTEXT LIKE SY-LISEL,
          ECHOTEXT LIKE SY-LISEL.
    DATA: RFCDEST like rfcdes-rfcdest VALUE 'NONE'.
    DATA: RFC_MESS(128).
    REQUTEXT = 'HELLO WORLD'.
    RFCDEST = 'JCOSERVER01'. "corresponds to the destination name defined in the SM59
    CALL FUNCTION 'STFC_CONNECTION'
       DESTINATION RFCDEST
       EXPORTING
         REQUTEXT = REQUTEXT
       IMPORTING
         RESPTEXT = RESPTEXT
         ECHOTEXT = ECHOTEXT
       EXCEPTIONS
         SYSTEM_FAILURE        = 1 MESSAGE RFC_MESS
         COMMUNICATION_FAILURE = 2 MESSAGE RFC_MESS.
    IF SY-SUBRC NE 0.
        WRITE: / 'Call STFC_CONNECTION         SY-SUBRC = ', SY-SUBRC.
        WRITE: / RFC_MESS.
    ENDIF.
    Regards,
    Sree

  • Newbie Help: Calling Java function from XSLT

    Hi everyone!
    I am trying to call a java function from my XSL file. like...
    <xsl:stylesheet version="1.0"
        xmlns:java="http://xml.apache.org/xslt/java"
        xmlns:fn="http://www.my.com/xslt"     
        exclude-result-prefixes="java fn">
    <xsl:variable name="embeddedpic"
    select="formData/instance/EmployeePicture" />
    <xsl:variable name="pic" select="fn:com.my.utils.ConversionUtils.base64DecodeString($embeddedpic)"/>I am getting this exception in calling the above java function from my XSLT (XalanXPathException: The function number 'http://xml.apache.org/xslt/java:com.my.utils.ConversionUtils.base64DecodeString' is not available.)I have the function lib file in my classpath but still i am getting this error. Any info is highly appreciated.
    Thanks

    Try this.
    <?xml version="1.0" ?>
    <xsl:transform version="1.0" xmlns:fn="com.my.utils" >
    <xsl:variable name="pic" select="fn:ConversionUtils.base64DecodeString($embeddedpic)"/>
    etc.
    as long as your code is in the classpath it should find it.
    Henock.

  • JCo Outbound( calling Java Function from ABAP )

    HI,
    I want to call a JAVA function from ABAP.I have installed the JCo toolkit and included the sapjco.jar file in the classpath of my system.
    When i execute the program(Example5.java,provided with sapjco.zip) from the command prompt,it is working fine,the server listens to the calls made from ABAP via RFC destination.
    But if i copy the same program in NWDS in a JAVA project,to run it from there as JAVA application,after including the sapjco.jar file in the project JAVA build path,i get the following error,marked by a red cross ,at the head of the program,even before i run it.
    <b>This compilation unit indirectly references the missing type com.sap.jdsr.writer.DsrIPassport (typically some required class file is referencing a type outside the classpath)</b>
    What changes do i need to make,to run it from NWDS?
    I tried to include the sapjcorfc.dll file along with the sapjco.jar in the java build path,but it doesn't help.
    Please tell how to solve this issue?
    Regards,
    Siddhartha

    hello sid,
    which jco version are you using?
    are you using the same jco lib when running in command
    line and in nwds?
    if you are, try checking the order of the your classpath.
    your jco lib (which you are using in command line) should
    come first in order prior to the default libraries in your project.
    regards
    jo

  • Calling Java function from java script function

    Hello,
    I have a jsp in which on button click i am calling a java script function. now there is some data that i want to insert in a table on click of the same button. But in order to do that i need to write java code. but if i write java code inside the script function that is called on button click it doesnt work. what i understand is that i need to make a java function inside the jsp & call that from the script function. can someone tell me how to do that ?
    this is the code i have written
    function sendMail(iCount2)
         var eMailAddresses = "";
         var studRegId = "";
         for (var i=0; i <iCount2; i++)
              if(document.getElementById("chk" + i).checked)
                   eMailAddresses = eMailAddresses+document.frmQueryBuilder.hdnEmail.value+",";
                   studRegId = document.frmQueryBuilder.studRegId[i].value;
              <%     if(regTemp != "")
                        MakeConnection mc1 = new MakeConnection();
                        con1 = mc1.DBConnection();
                        String temp = "1";
                        System.out.println("inside the if loop for regTemp");
                        String query1 = "insert into studcompreg (studregid,compid) values(?,?)";
                        stmt1 = con1.prepareStatement(query1);
                        stmt1.setString(1,regTemp);
                        stmt1.setString(2,temp);
                        /*stmt1.setString(3,temp);
                        stmt1.setString(4,"01-jan-2005");*/
                        rsinst = stmt1.executeQuery();
              %>
         win = window.open('BackupMail.jsp?eMailAddresses='+eMailAddresses);

    <%@ page import = "Utils.*" %>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.lang.String.*"%>
    <%@ page import = "java.text.*" %>
    <%@ page import = "java.util.*"%>
    <%
         String insertValues[] = new String[10];
         String regTemp = "";
         java.sql.Connection con1 = null;
         java.sql.ResultSet rs1 = null;
         java.sql.PreparedStatement stmt1 = null;
         java.sql.Statement stmtinst = null;
         java.sql.ResultSet rsinst = null;
         java.sql.Connection con = null;
         java.sql.PreparedStatement stmt = null;
         java.sql.ResultSet rs = null;
    %>
    <HTML>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <link rel="stylesheet" href="style.css" type="text/css">
    <script language = "javascript">
    /*Client side validations go here*/
    function submitForm()
         document.frmQueryBuilder.submit();
    function selectAll(iCount2)
         for (var i=0; i <iCount2; i++)
              document.getElementById("chk" + i).checked = true;
    function deselectAll(iCount2)
         for (var i=0; i <iCount2; i++)
              document.getElementById("chk" + i).checked = false;
    function sendMail(iCount2)
         var eMailAddresses = "";
         var studRegId = "";
         for (var i=0; i <iCount2; i++)
              if(document.getElementById("chk" + i).checked)
                   eMailAddresses = eMailAddresses+document.frmQueryBuilder.hdnEmail.value+",";
                   studRegId = document.frmQueryBuilder.studRegId[i].value;
                   document.frmQueryBuilder.temp.value ="newOne";
                   document.frmQueryBuilder.submit();
         win = window.open('BackupMail.jsp?eMailAddresses='+eMailAddresses);
    </script>
    </head>
    <BODY>
    <%
    int MaxCount = 15;
    int iCount1 = 0;
    int iCount2 = 0;
    int iCount3 = 0;
    String query = "";
    String eMailAddresses = "";
    StringBuffer sbMail = new StringBuffer();
    //String strValue[] = new String [MaxCount];
    //try
         String strCriteria [] = new String [10];
         String strCondition [] = new String [10];
         String strValue1 [] = new String [10];
         String strCombo [] = new String [10];
         for (iCount3 = 0; iCount3 < 10; iCount3 ++ )
              strCriteria[iCount3] = "";
              strCondition[iCount3] = "";
              strValue1[iCount3] = "";
              strCombo[iCount3] = "";
         if (request.getParameter ("txtAction") != null)
              //String nothing = request.getParameter("chk"+iCount2);
              //System.out.println("Value of checkbox : " +nothing);
              String strQuery[] = new String [MaxCount];     
              StringBuffer sb = new StringBuffer();
              String AccessQuery = "";
              String strTmpQuery = "";
              String strTmpRefType[] = new String [4];
              int QueryLen = 0;
              int ModifyLen = 0;
              int QueryLenNew = 0;
              String strTmpRefType1 = "";
              String strTmpRefType2 = "";
    String strTmpRefType3 = "";
         String strTmpRefType4 = "";
              strQuery[0] = "SELECT STUDREGID, NAME,STUDID,PROGRAM,BRANCH,CPI,EMAIL FROM STUDREGDTLS WHERE";
              sb.append(strQuery[0]);
              for (iCount3 = 1; iCount3 < 11; iCount3 ++)
                   iCount1++;
                   strCriteria[iCount3 - 1] = request.getParameter("criteria" + iCount1);
                   strCondition[iCount3 - 1] = request.getParameter("condition" + iCount1);
                   strValue1[iCount3 - 1] = request.getParameter("value" + iCount1);
                   strCombo[iCount3 - 1] = request.getParameter("combo" + iCount1);
              System.out.println("Loop"+iCount3);
                   if (!request.getParameter("criteria" + iCount1).equals("null"))
                        System.out.println("Started getting parameters");
                        strTmpRefType1 = request.getParameter("criteria" + iCount1);
                        if (request.getParameter("condition" + iCount1).equals("ANYWHERE"))
                                  System.out.println("Entered anywhere if of Anywhere");
                                  strTmpRefType2 = "LIKE";
                        else if (request.getParameter("condition" + iCount1).equals("STARTSWITH"))
                                       strTmpRefType2 = "LIKE";
                             else
                                  System.out.println("Anywhere & Startswith not selected");
                                  strTmpRefType2 = request.getParameter("condition" + iCount1);
                        if (request.getParameter("condition" + iCount1).equals("ANYWHERE"))
                                  strTmpRefType3 = "\'" + "%" request.getParameter("value" iCount1)+ "%" + "\'";
                        else if (request.getParameter("condition" + iCount1).equals("STARTSWITH"))
                                       strTmpRefType3 = "\'" request.getParameter("value" iCount1)+ "%" +"\'";
                             else if (request.getParameter("condition" + iCount1).equals("="))
                                            strTmpRefType3 = "\'" + request.getParameter("value" + iCount1)+ "\'";
                                            System.out.println(strTmpRefType3);
                                  else
                                            strTmpRefType3 = request.getParameter("value" + iCount1);
                        strTmpRefType4 = request.getParameter("combo" + iCount1);
                        System.out.println("Value of strTmpRefType2" +strTmpRefType2);     
                   strQuery[iCount3] = " upper(" strTmpRefType1 ") " strTmpRefType2 " upper(" strTmpRefType3 ") " strTmpRefType4 "";
                        System.out.println("Making Qyery"+iCount3);
                   sb.append(strQuery[iCount3]);
                   if (request.getParameter ("txtAction") != null)
                             MakeConnection mc = new MakeConnection();
                             con = mc.DBConnection();
                             QueryLen = sb.length();                         
                             ModifyLen = strTmpRefType4.length();
                             QueryLenNew = (QueryLen - ModifyLen);
                             sb.delete(QueryLenNew, QueryLen);
                             AccessQuery = sb.toString();
                             System.out.println(AccessQuery);
                             stmt = con.prepareStatement (AccessQuery);
                             rs = stmt.executeQuery();
    %>
    <table width="563" >
    <tr><td><DIV CLASS="windowtitle">Student Search</DIV></td></tr>
    <tr><td><DIV CLASS="udGroupBoxHdrDiv">Enter Search Criteria</DIV></td></tr>
    <tr><td CLASS="bgcol">
    <FORM name=frmQueryBuilder METHOD='POST'>
    <INPUT TYPE=hidden Name='txtAction' value='S'>
    <table >
    <%
         for(iCount1 = 1; iCount1 < 11; iCount1++)
                   System.out.println (strCriteria[iCount1-1]);
                   if(iCount1 == 9)
    %>                         <TR valign=top>
    <%
                   else
    %>                          <TR>
    <%
    %>
    <TD width="47"><LABEL CLASS="assoctext">Criteria </LABEL></td><td width="150">
              <SELECT NAME='<%="criteria" + iCount1%>' size="1">
    <OPTION VALUE='null'>- - - - - - - - - - - - - - - - -</OPTION>
         <OPTION VALUE='AGE' <%=strCriteria[iCount1-1].equals("AGE")?"selected":""%>>AGE</OPTION>
         <OPTION VALUE='BRANCH' <%=strCriteria[iCount1-1].equals("BRANCH")?"selected":""%>>BRANCH</OPTION>
         <OPTION VALUE='CPI' <%=strCriteria[iCount1-1].equals("CPI")?"selected":""%>>CPI</OPTION>
         <OPTION VALUE='DEPARTMENT' <%=strCriteria[iCount1-1].equals("DEPARTMENT")?"selected":""%>>DEPARTMENT</OPTION>
    <OPTION VALUE='DREAMCOMP' <%=strCriteria[iCount1-1].equals("DREAMCOMP")?"selected":""%>>DREAM COMPANY</OPTION>
    <OPTION VALUE='PROGRAM' <%=strCriteria[iCount1-1].equals("PROGRAM")?"selected":""%>>PROGRAM</OPTION>
    <OPTION VALUE='SKILLSET' <%=strCriteria[iCount1-1].equals("SKILLSET")?"selected":""%>>SKILL SET</OPTION>
    <OPTION VALUE='WORKEX' <%=strCriteria[iCount1-1].equals("WORKEX")?"selected":""%>>WORK EX</OPTION>
    </SELECT>
              </TD>
         <TD width="88">
              <SELECT NAME='<%="condition" + iCount1%>'>
                   <OPTION VALUE='<=' <%=strCondition[iCount1-1].equals("<=")?"selected":""%>><=</OPTION>
                   <OPTION VALUE='>=' <%=strCondition[iCount1-1].equals(">=")?"selected":""%>>>=</OPTION>
                   <OPTION VALUE='=' <%=strCondition[iCount1-1].equals("=")?"selected":""%>>EXACT MATCH</OPTION>
                   <OPTION VALUE='ANYWHERE' <%=strCondition[iCount1-1].equals("ANYWHERE")?"selected":""%>>ANYWHERE</OPTION>
                   <OPTION VALUE='STARTSWITH' <%=strCondition[iCount1-1].equals("STARTSWITH")?"selected":""%>>STARTS WITH</OPTION>
              </SELECT>
    </TD><TD width="38"><LABEL CLASS="assoctext">Value </LABEL></TD>
    <TD width="186"><INPUT NAME=<%="value" + iCount1%> value='<%=strValue1[iCount1-1]%>' size="20" >
    </TD>
    <TD width="187"><SELECT NAME='<%="combo" + iCount1%>'>
                   <OPTION VALUE='AND' <%=strCombo[iCount1-1].equals("AND")?"selected":""%>>AND</OPTION>
                   <OPTION VALUE='OR' <%=strCombo[iCount1-1].equals("OR")?"selected":""%>>OR</OPTION>
              </SELECT>
    </TD>
    </TR>
    <%
    %>
    </table>
    </td></tr>
    <tr><td align=center>
    <BR>
    <INPUT CLASS="butstyle" type="button" id="cmdSave" enableAlways = "0" value="Submit" onclick="return submitForm();" >
    </td></tr>
    </table>
    <table width="698">
    <tr><td colspan = 6><DIV CLASS="udGroupBoxHdrDiv">Students Matching the Required Crieria</DIV></td></tr>
    <TR>
         <TD CLASS="tblhdr" width="50"></TD><TD CLASS="tblhdr" width="155">Student Name</TD>     <TD CLASS="tblhdr" width="150">Student
    Id</TD><TD CLASS="tblhdr" width="150">Program</TD><TD CLASS="tblhdr" width="150">Branch</TD><TD CLASS="tblhdr" width="62">CPI</TD>
         </TR>
    <%          int i = 0;
         if (request.getParameter ("txtAction") != null)
                   while( rs.next())
    %>
    <%                         System.out.println("Entered Output Loop"+ rs.getString("Name"));
                             System.out.println("Entered Output Loop.........."+ rs.getString("Email"));     
                             sbMail.append(rs.getString("Email")).append(",");
                             regTemp = rs.getString("STUDREGID");
                             i++;
                             System.out.println("student reg id........."+regTemp);
                             System.out.println("value of i........."+i);
    %>                    
                   <TR CLASS="bgcol">
                             <TD width="25"><INPUT TYPE="checkbox" NAME='<%="chk" + iCount2%>' id='<%="chk" + iCount2%>' VALUE=""></TD>
                             <TD width="155"><INPUT NAME=txtName size=20 value='<%=rs.getString("NAME")%>'></TD>
                             <TD width="150"><INPUT NAME=txtStudId size=20 value='<%=rs.getString("STUDID")%>'></TD>
                             <TD width="150"><INPUT NAME=txtProgram size=20 value='<%=rs.getString("PROGRAM")%>'></TD>
                             <TD width="150"><INPUT NAME=txtBranch size=20 value='<%=rs.getString("BRANCH")%>'></TD>
                             <TD width="62"><INPUT NAME=txtCpi size=4 value='<%=rs.getString("CPI")%>'></TD>
                   </TR>
                             <INPUT type="hidden" NAME=hdnEmail value='<%=rs.getString("Email")%>'>
                             <INPUT type = "hidden" NAME = studRegId value = '<%=rs.getString("studRegId")%>'>
                             <INPUT type ="hidden" NAME =temp value ="">
    <%
                             iCount2++;
         eMailAddresses = sbMail.toString();
                   if (con != null)
                             con.close();
    //catch( Exception e)
              System.out.println ("ERROR " + e);
              if (con != null)
                        con.close();
    %>
    </table>
    <table width="698" align=center>
    <tr><td>
    <BR>
    <INPUT CLASS="butstyle" valign=top type="button" id="cmdSave" enableAlways = "0" value="Select All" onclick="return selectAll(<%=iCount2%>)" >
    </td>
    <td>
    <BR>
    <INPUT CLASS="butstyle" valign=top type="button" id="cmdSave" enableAlways = "0" value="Deselect All" onclick="return deselectAll(<%=iCount2%>)" >
    </td>
    <td>
    <BR>
    <INPUT CLASS="butstyle" valign=top type="button" id="cmdSave" enableAlways = "0" value="Send Mail" onclick="sendMail(<%=iCount2%>)" >
    </td>
    </tr>
    </table>
    </FORM>
    </BODY>
    </HTML>
    <%     System.out.println("value inside hidden var temp"+request.getParameter("temp"));     
         if((request.getParameter("temp") != null) && (request.getParameter("temp").equals("newOne")))
         //if(regTemp != null)
              MakeConnection mc1 = new MakeConnection();
              con1 = mc1.DBConnection();
              String temp = "1";
              System.out.println("inside the if loop for regTemp");
              String query1 = "insert into studcompreg (studregid,compid) values(?,?)";
              stmt1 = con1.prepareStatement(query1);
              stmt1.setString(1,regTemp);
              stmt1.setString(2,temp);
              /*stmt1.setString(3,temp);
              stmt1.setString(4,"01-jan-2005");*/
              rsinst = stmt1.executeQuery();
    %>

  • Problem while Consuming Java Webservice from WCF client

    Hi,
    I am trying to Consume Java Webservice from WCF client.The webservice main functionality is digital data management.The client can Query Digital data and upload digital data by calling webservice methods.Problem is when i am trying to call webmethod from WCF client its giving "Unrecognised message versions".I have no idea about how the message objects are processed at serverside.but at server side they have used JAXP for XML document parsing.
    The response content type is Multipart/related and applicatio/XOP+XML.
    Can u plz help me how to handle this situation.I have minimum knowledge in Java WS architecture.Basically i am .Net programmer.
    Can U please guide me in a proper way to resolve the problem.

    Hi Abinash,
    I have the same problem. Have you solve that problem?
    I am using a java program to call a webservice too. And I have generated the client proxy definition for Stand alone proxy using NWDS. When I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    MIDadosPessoaisSyncService service = new MIDadosPessoaisSyncServiceImpl();
    MIDadosPessoaisSync port = service.getLogicalPort("MIDadosPessoaisSyncPort");
    port._setProperty("javax.xml.rpc.security.auth.username","xpto");
    port._setProperty("javax.xml.rpc.security.auth.password","xpto");
    String out = port.MIDadosPessoaisSync("xpto", "xpto");
    System.out.println(out);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>The result of the WS is correct!!!</b>
    The Java project does not have any warning. But the stand alone proxy project has following warnings associated with it.
    This method has a constructor name     MIDadosPessoaisSync.java     
    The import javax.xml.rpc.holders is never used     MIDadosPessoaisSyncBindingStub.java     
    The import javax.xml.rpc.encoding is never used     MIDadosPessoaisSyncBindingStub.java     
    The constructor BaseRuntimeException(ResourceAccessor, String, Throwable) is deprecated     MIDadosPessoaisSyncBindingStub.java
    It is very similar with your problem, could you help me?
    Thanks
    Gustavo Freitas

  • Calling Java Function from XSL

    I'm trying something I think is fairly simple and keep getting errors during the process. I'm just trying to parse an XML file and call a java method from a simple java program called HelloWorld using an XSL stylesheet.
    I get the following error: Error while parsing XSL file (Extension function namespace should start with 'http://www.oracle.com/XSL/Transform/java/'.). Here is my XSL. I know the oracle namespace is not necessary, it was added due to the error I was receiving:
    <?xml version = "1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:oracle="http://www.oracle.com/XSL/Transform/java/"
    xmlns:xalan="http://xml.apache.org/xalan"
    xmlns:redirect="http://xml.apache.org/xalan/redirect"
    xmlns:jfctn="com.raytheon.iis.temp.HelloWorld" exclude-result-prefixes="jfctn"
    exclude-element-prefixes="oracle redirect"
    version='1.0'>
    <xsl:template match="/">
    <xsl:value-of select="//title"/>
    <xsl:value-of select="//author"/>
    <xsl:value-of select = "jfctn:hello()"/>
    </xsl:template>
    </xsl:stylesheet>
    Here is my java file:
    public class HelloWorld {
    public static String hello() {
    return "Hello World";
    And here is my simple XML file:
    <source>
    <title>XSL</title>
    <author> John
    Smith</author>
    </source>
    Any advice/ideas would be greatly appreciated. Thanks.
    Jimmy

    After some trials I've come up with a more specific issue regarding this error. Here is my new code that works on a machine that does not have a file called xmlparserv2.jar (In my stack trace I noticed it referring to the oracle.xml.parser.v2 so I'm assuming this file and path setup that refers to this file is the issue). Unfortunately I have other programs that need this file and setup so I was wondering if anyone knew some alternate setup or workaround to resolve this issue.
    The following works fine for me using xalan on a server with the most recent jdk 1.4 setup.
    Here is the new XSL code similar to the one listed above. The XML is the same as the previous post.
    <?xml version = "1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    �xmlns:xalan="http://xml.apache.org/xalan"�
    �xmlns:jfctn="xalan://com/raytheon/iis/temp/HelloWorld"
    exclude-result-prefixes="jfctn"
    �version='1.0'>
    <xsl:template match="/">
    <xsl:value-of select="//title"/>
    <xsl:value-of select="//author"/>
    <xsl:value-of select = "jfctn:hello()"/>
    </xsl:template>
    </xsl:stylesheet>
    Here is my transform class
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.*;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.stream.StreamSource;
    import java.net.URL;
    import javax.xml.transform.*;
    public class SimpleTransform
    public SimpleTransform()
    public static void main(String args[])
    throws TransformerException, TransformerConfigurationException, FileNotFoundException, IOException
    TransformerFactory transformerfactory = TransformerFactory.newInstance();
    File file = new File("test.xsl");
    File file1 = new File("test.xml");
    try
    URL url = file.toURL();
    URL url1 = file1.toURL();
    InputStream testXsl = url.openStream();
    InputStream testXml = url1.openStream();
    Transformer transformer = transformerfactory.newTransformer(new StreamSource(testXsl));
    transformer.transform(new StreamSource(testXml), new StreamResult(new FileOutputStream( "test.out")));
    System.out.println("************* The result is in test.out *************");
    testXsl.close();
    testXml.close();
    catch(Exception exception)
    exception.printStackTrace();
    }

  • Calling JAVA Functions from XSLT

    Hi,
    I am trying to invoke a Java Extension Function from a XSLT. I added both the class file and the XSLT file to a folder, then zipped the entire folder and uploaded into the Archive for my Interface MApping.
    The CLASS gets loaded but the runtime engine gives an error when calling the JAVA Function.
    Here is what it says:
    Creating mapping sequence with 2 steps. --- Creating Java mapping Deliveries/stringHandler --- Creating mapping sequence with 2 steps. --- Creating XSLT mapping Deliveries/test1 --- Using MappingResolver with context URL /sapmnt/XD1/global/xi/mapping/http%3A%2F%2Fwolterskluwer%2Ecom%2Fxi%2F wk_midas_deliveries%2Ftest/cd2e6820267511d9cb52c3c5143c3524/ --- Loaded class Deliveries.stringHandler --- com.sap.aii.ibrun.server.map.MappingRuntimeException: at com.sap.aii.ibrun.server.map.MappingRuntimeException.code_STYLESHEET_OR_CLASS_NOT_FOUND(MappingRuntimeException.java:91) at com.sap.aii.ibrun.server.map.RUMappingJava.instantiate(RUMappingJava.java:168) at com.sap.aii.ibrun.server.map.RUMappingJava.execute(RUMappingJava.java:41) at com.sap.aii.ibrun.server.map.RUSequence.execute(RUSequence.java:50) at com.sap.aii.ibrun.server.map.RURunner.run(RURunner.java:58) at com.sap.aii.ibrun.server.map.RUManager.run(RUManager.java:66) at com.sap.aii.ibrun.sbeans.map.MappingRequestHandler.handleRequest(MappingRequestHandler.java:67) at com.sap.aii.ibrun.sbeans.map.MappingServiceImpl.processFunction(MappingServiceImpl.java:83) at com.sap.aii.ibrun.sbeans.map.XMappingServiceObjectImpl0.processFunction(XMappingServiceObjectImpl0.java:24) at com.sap.aii.ibrun.sbeans.map.MappingServiceKey.processFunction(MappingServiceKey.java:10) at java.lang.reflect.Method.invoke(Native Method) at com.inqmy.services.rfcengine.RFCDefaultRequestHandler.invokeBean(RFCDefaultRequestHandler.java:83) at com.inqmy.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:50) at com.inqmy.services.rfcengine.RFCJCOServer.handleRequest(RFCJCOServer.java:69) at com.sap.mw.jco.JCO$Server.dispatchRequest(Unknown Source) at com.sap.mw.jco.rfc.MiddlewareRFC$Server.nativeListen(Native Method) at com.sap.mw.jco.rfc.MiddlewareRFC$Server.listen(Unknown Source) at com.sap.mw.jco.JCO$Server.listen(Unknown Source) at com.sap.mw.jco.JCO$Server.run(Unknown Source) at java.lang.Thread.run(Thread.java:513) --
    Any help or suggestions to solve this problem would be greatly appreciated.
    Thanks
    A

    Hi,
    Thanks for looking into this.
    1. I have verified that the path in the zip file is correct i.e com/sap/test/stringHandler.class
    2. test1.xsl is in the root folder i.e No path.
    3. I see the Message in the stacktrace saying "Loaded Class com/sap/test/stringHandler.class " but after that I get a runtime MApping Error and it says "CLASS_NOT_FOUND".
    Can you please tell me why is this happening?
    Thanks
    A

  • Help with calling java functions from javascript

    I am using javax.script to interpret javascript from a java applet. it loads the js file into a string, and then does engine.eval(script_string). My question is, how would I make functions in the class file that are available to javascript?
    Update: Instead of that, I am loading a js script that will contain all of the usable functions. Here it is:
    //core.js for Javasphere 0.31
    var pkgs = new JavaImporter(java.lang, java.lang.System, java.awt);
    with(pkgs) {
    function Abort(msg) {
            var graph = new Graphics();
            g = graph.getgraphics();
            g.drawString(msg, 20, 20);
    }When I do engine.eval("Abort(\"something\")"); it throws this error:
    javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException: error instantiating (0): class java.awt.Graphics is interface or abstract (<Unknown source>#8) in <Unknown source> at line number 8

    Eggbertx, let's start from scratch if you don't mind. Say you have this Applet
    pubic class MyApplet extends Applet
      String message;
      //CALL THIS METHOD FROM JAVASCRIPT
      public void setMessage(String msg)
        message = msg;
        // this saves you from having
        // to call getGraphics() from JavaScript
        repaint();
      public void paint(Graphics g)
        g.drawString(message, 10, 30);
    }Then in your HTML file you may have something like this:
    <input type="text" id="msg" value=""></input>
    <input type="button" value="Set Message" onclick="setAppletMessage()"></input>
    <applet id="myApplet" code="MyApplet.class" width="400" height="100"></applet>And in the JavaScript file:function setAppletMessage()
      var msg = document.getElementById("msg").value;
      document.myApplet.setMessage(msg);
    }This is about all you really need to do. See how the Graphics object is no longer in your .js file?
    Note: You may run into other difficulties in getting this code to work because of browser, security, or some other pain-in-the-neck issues, but this is the idea.
    Eggbertx, I see you added a star to my first post and I think you should take that off because:
    1. <tt>Component</tt> is abstract... so you can not call the <tt>new</tt> operator.
    2. The call <tt>component.getGraphics()</tt> is not going to work either, because <tt>component</tt> was never created.

  • Calling a function from HTML page

    I am using a mixture of jQuery Mobile and Edge Animate to build a mobile app.
    When I load the Edge file I need to also call a function in edge at the same time.
    How can I call a function that is inside the Edge Animate file from the container HTML file (jQuery button)?

    Here it is:
    sym.displayBAC = function() {
    // Set BAC once at begining so we can run the timer less often
    sym.currentToday=new Date();
    sym.currentHour=sym.currentToday.getHours();
    sym.currentMinute=sym.currentToday.getMinutes();
    sym.currentTime = sym.currentHour + (sym.currentMinute/60);
    if ( sym.currentTime < sym.startTime) {
    sym.currentTime = sym.currentTime + 24;
    else {
    sym.currentTime = sym.currentTime;
    sym.drinkingTime = sym.currentTime - sym.startTime;
    if (sym.drinkingTime > 24) {
    sym.reset();
    // convert mls to fluid ounces and multiply by alcohol percenatge
    sym.beerOunces = (sym.beerVolume * 0.033814) * sym.beerPercent;
    sym.wineOunces = (sym.wineVolume * 0.033814) * sym.winePercent;
    sym.spiritOunces = (sym.spiritVolume * 0.033814) * sym.spiritPercent;
    sym.champagneOunces = (sym.champagneVolume * 0.033814) * sym.champagnePercent;
    sym.premixOunces = (sym.premixVolume * 0.033814) * sym.premixPercent;
    sym.shotOunces = (sym.shotVolume * 0.033814) * sym.shotPercent;
    sym.cocktailOunces = (sym.cocktailVolume * 0.033814) * sym.cocktailPercent;
    sym.ciderOunces = (sym.ciderVolume * 0.033814) * sym.ciderPercent;
    // Total the alcohol in liquid ounces
    sym.totalOunces = sym.beerOunces + sym.wineOunces + sym.spiritOunces + sym.champagneOunces + sym.premixOunces + sym.shotOunces + sym.cocktailOunces + sym.ciderOunces;
    // Formula %BAC = (A x 5.14/W x r) - .015 x H
    sym.BAC = Math.round((((sym.totalOunces * 5.14) / (sym.weight * sym.ratio)) - .015 * sym.drinkingTime)*100)/100;
    //$.cookie("drinkingTime", sym.drinkingTime, { expires: 365, path: "/" });

  • Problem while calling a report from the report

    Hi
    i want call a report from the report, i have written URL in the Hyperlink and its working
    but
    1) i want open it in the diffrent window.
    2) suppose if u have a report called emp it should call antoher 2 report at a time.
    ( how to put 2 URL in the hyperlink?).
    i,e if i press a hyperlink it should open emp1 and emp2
    Please help me.
    thanks and regards

    Thanx,
    I have solved this problem.
    Regards,
    Hafeez

  • PInvoke - Issue while calling DJVU function from C# Code - Attempted to read or write protected memory

    Hi,
    I know there are many questions in this subject but none of them help to resolve the issue I am currently facing.
    Below is the signature of C Function from DJVULibre added in .NET code
    [DllImport("C:\\Program Files\\DJVULIBRE\\LIBDJVULIBRE.dll", CharSet=CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
    private unsafe static extern int ddjvu_page_render(IntPtr page, ddjvu_render_mode_t mode, IntPtr pagerect,
    IntPtr renderrect,
    IntPtr pixelformat,
    ulong rowsize,
    [Out][MarshalAs(UnmanagedType.LPArray)]byte[] imagebuffer);Below is how I am calling this function in the c# codebyte* buffer = (byte *)Memory.Alloc(nSize);
    try
    IntPtr ptr1 = (IntPtr)Memory.Alloc(Marshal.SizeOf(prect));
    Marshal.StructureToPtr(prect, ptr1, false);
    IntPtr ptr2 = (IntPtr)Memory.Alloc(Marshal.SizeOf(rrect));
    Marshal.StructureToPtr(rrect, ptr2, false);
    byte[] array = new byte[nSize];
    fixed (byte* p = array) Memory.Copy(buffer, p, nSize);
    ddjvu_page_render(page, ddjvu_render_mode_t.DDJVU_RENDER_MASKONLY, ptr1, ptr2, fmt, (ulong)stride, array);
    finally
    Memory.Free(buffer);
    }call to ddjvu_page_render in above code is throwing "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
    Prior to this post I must have tried all the option could find in various blogs.
    Appreciate any help, is almost a day I am clueless, your timely help could save my job

    Thanks Viorel, below is the definition of original C function
    DDJVUAPI int
    ddjvu_page_render(ddjvu_page_t *page,
    const ddjvu_render_mode_t mode,
    const ddjvu_rect_t *pagerect,
    const ddjvu_rect_t *renderrect,
    const ddjvu_format_t *pixelformat,
    unsigned long rowsize,
    char *imagebuffer );below is how the code is calling this function in C#, the in pointers are all valid pointer I checked in debugging window byte* buffer = (byte *)Memory.Alloc(nSize);
    try
    IntPtr ptr1 = (IntPtr)Memory.Alloc(Marshal.SizeOf(prect));
    Marshal.StructureToPtr(prect, ptr1, false);
    IntPtr ptr2 = (IntPtr)Memory.Alloc(Marshal.SizeOf(rrect));
    Marshal.StructureToPtr(rrect, ptr2, false);
    byte[] array = new byte[nSize];
    fixed (byte* p = array) Memory.Copy(buffer, p, nSize);
    ddjvu_page_render(page, ddjvu_render_mode_t.DDJVU_RENDER_MASKONLY, ptr1, ptr2, fmt, (ulong)stride, array);
    finally
    Memory.Free(buffer);

Maybe you are looking for

  • Stuck in To Be Delivered Status in Message Monitoring - Adapter Engine

    Hi, I have messages stuck in To Be Delivered status in Messages Monitoring. When i checked the Audito Logs, there are NO LOGS. I resent the message and now the logs indicated in the Audit Logs is: 2014-03-26 08:39:10 Information The message was succe

  • Scanning and Copy never start on Office Jest 6700

    When I go to copy or scan on my Office Jet 6700. I am unable to do so. Te scanner/copier says that it is "Starting Copying..." or "Starting Scanning" but it does nothing...I have tried turing off and on, unpluging, reseting to factory settings, etc.

  • Witholding tax code requires you to enter a base amount

    Dear Friends, The user is getting the error " Witholding tax code requires you to enter a base amount" I checked the invoice and found that there is withholding tax code and there is no withholding tax amount. How to reslove the issue? Please guide.

  • Java Problems with web access/Oracle

    I have a new problem I'm wondering if anyone has encountered. I use my G5 PPC to make input into a Government data base. It's been working for a couple of months (since I took on the assignment) but all of a sudden they started to make little 'fixes'

  • Refresh Classical report/basic list

    Hi, I have created a classical report/basic list where user can select check boxes and adjacent rows should be deleted. But after the action, I wish to refresh the report and remove the selected lines from displaying. Please let me know how to achiev