Using JNI in JSP

Hi
i am going to develop a DI COM viewer in web.
so that it uses lot of shared libraries (.dll).
i tried JNI with servlet it works fine.
but when i try to load a same DLL for another page it gives an error saying
".dll loaded in another class loader"
So that i tried to write JNI wrapper as a component using java beans.
and i can use as multiple instances.
package BeanDir;
import java.util.*;
//This file must be compiled Manually using javac
//cd D:\tomcat\webapps\examples\WEB-INF\classes\BeanDir\mysimplebean.java
public class mysimplebean
     static
          System.loadLibrary("HelloWorld");
     public String getceoname()
          String ceonameval = "Tom Hanks CEO of Tom Hanks INC";          
          return ceonameval;
     public String ceoemail()
          String ceoemailval = "[email protected]";          
          return ceoemailval;
     public double findtakehome(int salary,String designation)
          double takehomeamt;
          if(designation=="Developer")
               takehomeamt = salary+salary*0.15; //15 % Raise in Salary
          else
               takehomeamt = salary+salary*0.10; //10 % Raise in Salary
          return takehomeamt;
     public native String sayHello();      
}Then i added the Java bean in JSP:
<%@ page import = "BeanDir.mysimplebean" %>
<jsp:useBean
     id="mybeanid"
     class="BeanDir.mysimplebean"
     scope="session"/>
<jsp:setProperty
     name="mybeanid"
     property="*"/>
<html>
<head><title>JSP - Java Bean Demo </title></head>
<body bgcolor="white">
<font size=2 face=verdana>
<center><strong>Simple JSP with JAVA Beans Demo Application Form</strong> <br>
<%
//Auto Compiled by JSP Engine dont use Javac
//No Parameters Passed into Bean
//cd E:/tomcat/webapps/examples/jsp/testdir/testme2.jsp
String ceoname_ret;
ceoname_ret=mybeanid.getceoname();          
out.println("<br>CEO Name : "+ceoname_ret);
//No Parameters Passed into Bean
String ceoemail_ret;
String s;
ceoemail_ret=mybeanid.ceoemail();
out.println("<br>CEO Email : "+ceoemail_ret);
out.println("<br><br>");
out.println("<table border=1 bordercolor='maroon' cellspacing=4 cellpadding=4 align=center>");
out.println("<tr align=center valign=middle>");
out.println("<td bgcolor=maroon><font face='verdana' size=2 color=white> Calling From JSP </font></td>");
out.println("<td bgcolor=maroon><font face='verdana' size=2 color=white> BEAN BEANING CALLED </font></td></tr>");
double takehomeamt_ret;     
double totalcost=0;
takehomeamt_ret = mybeanid.findtakehome(5000,"Developer") ;     
totalcost=totalcost+takehomeamt_ret;
out.println("<tr align=center valign=middle><td><font face='verdana' size=2>Take Home : James Smith  </font></td>");
out.println("<td><font face='verdana' size=2>"+takehomeamt_ret+"</font></td></tr>");
takehomeamt_ret = mybeanid.findtakehome(5000,"Designer") ;     
totalcost=totalcost+takehomeamt_ret;
out.println("<tr align=center valign=middle><td><font face='verdana' size=2>Take Home :  Andrew  </font></td>");
out.println("<td> <font face='verdana' size=2>"+takehomeamt_ret+"</font></td></tr>");
takehomeamt_ret = mybeanid.findtakehome(7000,"Developer") ;     
totalcost=totalcost+takehomeamt_ret;
out.println("<tr align=center valign=middle><td><font face='verdana' size=2>Take Home : Peter O Neal  </font></td>");
out.println("<td> <font face='verdana' size=2>"+takehomeamt_ret+"</font></td></tr>");
out.println("<tr align=center valign=middle><td><font face='verdana' size=2><strong>TOTAL COST FOR COMPANY </strong>  </font></td>");
out.println("<td> <font face='verdana' size=2>"+totalcost+"</font></td></tr>");
out.println("</table>");
out.print("My dll should be somewhere here: "+System.getProperty("java.library.path"));
s = mybeanid.sayHello();
out.println("<br>Output from JNI"+s);
%>  </center>
</font>
</body>
</html>Error which i am getting is :
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.UnsatisfiedLinkError: BeanDir.mysimplebean.sayHello()Ljava/lang/String;
     org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
javax.servlet.ServletException: java.lang.UnsatisfiedLinkError: BeanDir.mysimplebean.sayHello()Ljava/lang/String;
     org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
     org.apache.jsp.jsp.callbean_jsp._jspService(callbean_jsp.java:121)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.UnsatisfiedLinkError: BeanDir.mysimplebean.sayHello()Ljava/lang/String;
     BeanDir.mysimplebean.sayHello(Native Method)
     org.apache.jsp.jsp.callbean_jsp._jspService(callbean_jsp.java:109)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.
Apache Tomcat/6.0.20

Hi friends,
i got the solution for using JNI in JSP.
But not with Javabean
I created a class that loads the library and define the native method.
import the above said class package in your JSP program
create the object for the class
access the native method with that object.
copy your .dll file in system32 folder
if you have declared package in java program change the method according to that
other wise you will get unsatisfied link error
for ex
package sam.jni;
import java.io.*;
public class Helloworld
static
static.loadlibrary("HelloWorld");
public native String sayHello();
}Method name in your c++ program looks like
JNIEXPORT jstring JNICALL Java_sam_jni_HelloWorld_sayHello
  (JNIEnv *env, jobject obj) {
    return  env->NewStringUTF("krishnakumar");

Similar Messages

  • How to use JNI in JSP???

    I have jsp on tomcat. I'd like to get some method from JNI in JSP. I'm already test JNI with java application, it's work well. But I don't know how to adapt in JSP. Could anyone help?
    Thanks and Best Regards,

    Hello,
    Thanks for your reply.
    I 've already write a seperate class that includes the JNI call but I've got jspwrapper error.
    Could you please suggest me?

  • Problems using JNI and JSP in WebLogic 6.0

    Hello everybody. My problem is that I've got a Java class that is called from a JSP. That class connects to a C function and it returns a String. A want this string to be shown by the JSP. The code is:
    JSP
    <html>
    <head>
    <title>prueba JNI</title>
    </head>
    <body>
    <%@ page import="ejemplosJNI.*, conversiones.*;"%>
    <%
    Texto texto = new Texto();
    out.println(texto.realizado());
    %>
    </body>
    </html>
    Java class
    package ejemplosJNI;
    public class Texto
    private native String getLine(String prompt);
    String input = null;
    public static void main(String args[])
    Texto t = new Texto();
    static
    System.loadLibrary("MyImpOfPrompt");
    public String realizado()
    input = this.getLine("Mando una l�nea desde Java");
    return input;
    C function
    #include <stdio.h>
    #include <jni.h>
    #include "Texto.h"
    JNIEXPORT jstring JNICALL
    Java_Texto_getLine(JNIEnv *env, jobject obj, jstring prompt)
    char buf[128];
    const char str = (env)->GetStringUTFChars(env, prompt, 0);
    (*env)->ReleaseStringUTFChars(env, prompt, str);
    return (*env)->NewStringUTF(env, str);
    I compile de C function and put the .dll library in the 'bin' folder in webLogic.
    When I call the JSP, I get the next exception:
    Servlet failed with Exception
    java.lang.UnsatisfiedLinkError: getLine
    at ejemplosJNI.Texto.getLine(Native Method)
    at ejemplosJNI.Texto.realizado(Texto.java:19)
    at jsp_servlet._jsp._pruebasjni._prueba1._jspService(_prueba1.java:93)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:213)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:246)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:1265)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:1622)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    Is there any place where I have to put the .dll?
    Is there any place where I have to put the generated .lib?
    Where do I have to put the Texto.h file generated with javah?
    Can anybody help me to solve this problem?
    Thanks in advance.

    Hi, jschell! Maybe you can see my problem if I give you the code. My Java class and the C funtions are:
    Java class
    package ejemplos.cadena;
    public class Texto
    private native String getLine(String prompt) throws Exception;
    String cadenaFinal = null;
    public static void main(String args[])
    Texto t = new Texto();
    static
    System.loadLibrary("LibreriaCadena");
    public String realizado(String cadena)
    try
    cadenaFinal = getLine(cadena);
    catch(Exception e)
    System.out.println(e.toString());
    return cadenaFinal;
    C code
    #include <stdio.h>
    #include <jni.h>
    #include "ejemplos_cadena_Texto.h"
    JNIEXPORT jstring JNICALL
    Java_ejemplos_cadena_Texto_getLine(JNIEnv *env, jobject obj, jstring prompt)
    int cero =0;
    int division = 10 / cero;
    const char str = (env)->GetStringUTFChars(env, prompt, 0);
    (*env)->ReleaseStringUTFChars(env, prompt, str);
    return (*env)->NewStringUTF(env, str);
    I have done something like "int division = 10 / cero;" in order to get an exception in my C code. When I run my Java class I get an error message and the application breaks. I would like to know how to catch the C exception in order to pass it to my Java class that can manage it into the try-catch clause. I have read I have to use something like "FindClass" or "ThrowNew", but my problem is that I have no idea about C programming.
    Can you help me?
    Thanks for your time.

  • Deploying a WAR file containing .jsp and servlets (also uses JNI)

    Deploying a WAR file containing .jsp and servlets (also uses JNI) on Windows 2000
    We had problems making it initially work on Sun ONE Web Server 6.0 Service Pack 1 because of lack of good iPlanet Web
    Server documentation on deploying such files.
    This is how we went about it:
    1) Make one of the servlet and JSP (must call another Java Class) web application (.war) examples work with iPlanet Web
    Server.
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\HelloWorld\HelloWorld.war
    and
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    a) Go to your Web Server Administration to deploy the application using GUI Web Application Deploy.
    (We usually use command line, we experienced some issues with the GUI version, but maybe it is fixed in the new Web Server
    service packs)
    From browser, open http://yourserver:8888/
    Click on Select a Server:Manage
    Click on Virtual Server Class
    Click on https-yourserver
    Click on the Web Applications Tab
    Then, click on Deploy Web Application
    Enter the following -
    WAR File On: Local
    WAR File Path: C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Application URI: /jakarta
    Installation Directory: c:\iPlanet\examples\jakarta-examples
    By clicking on OK it deployed the application.
    I can verify that it is deployed by selecting "Edit Web Applications" and I see the following entry:
    Edit     /jakarta     c:/iPlanet/examples/jakarta-examples
    Also, c:/iPlanet/examples/jakarta-examples should have the similar following directory structure ..
    - [images]
    - [jsp]
    - index.html
    - [servlets]
    - [META-INF]
    - [WEB-INF]
    - [classes]
    - [tlds]
    - web.xml
    - index.html
    I restarted the server and accessed it using the following URL from my IE browser:
    http://yourserver/jakarta/index.html
    Then I clicked on the JSP Examples and tried some JSP examples.
    b) Alternatively, you can also deploy the same example from the command-line.
    Make sure C:\iPlanet\Servers\bin\https\httpadmin\bin\ is in your path
    wdeploy deploy      -u /jakarta
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\jakarta-examples
              C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Restart the web server (I don't think you have to restart, but .. might as well).
    2)Deploy your web-application
    My Foo.war has the following structure.
    You can use jar tf Foo.war to look at the file contents from command line (assuming you have JDK installed and the bin is
    in your PATH)
    Foo.war
    - [META-INF]
    - [WEB-INF]
    - web.xml
    - [classes]
    - Bar.class
    - MoServlet.class
    - [lib]
    - ThirdParty.jar
    - [natlib]
    - extlib.dll
    - foo.jsp
    Here is our application scenario:
    foo.jsp uses a class call Bar (it is not in any package). The Bar java class uses classes from ThirdParty.jar. The
    ThirdParty.jar in turn uses JNI to load library extlib.dll. foo.jsp also calls /servlet/Mo as well.
    Now to deploy it, do the following:
    (a) Make sure that within foo.jsp, you import the Bar class ( I don't know why you have to do it, but if you don't you get
    JSP compile error).
    <%@page language="java" import="Bar" contentType="text/html"%>
    (b) Check web.xml (for Servlets)
    Within web.xml, make sure you have the following mappings:
    <servlet>
    <servlet-name> MoLink </servlet-name>
    <servlet-class> MoServlet </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name> MoLink </servlet-name>
    <url-pattern> /servlet/Mo </url-pattern>
    </servlet-mapping>
    (c) Deploy the application
    Using command line:
    wdeploy deploy      -u /foo
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\foo-dir
              Foo.war
    (d) Change web-apps.xml file (for picking up ThirdParty.jar)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    You should see something similar to following after successful deployment.
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true"/>
    Change it to look like following to pick up the ThirdParty.jar
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true">
    <class-loader reload-interval="300"
              classpath="C:/iPlanet/examples/foo-dir/WEB-INF/lib/ThirdParty.jar"
              delegate="false"/>
    </web-app>
    (e) Change jvm12.conf file (for JNI)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    Add or uncomment the following lines:
    #optional - just helps with instrumenting the jsp and servlet code
    jvm.include.CLASSPATH=1
    jvm.enableDebug=1
    nes.jsp.enabledebug=1
    jvm.trace=7
    jvm.verboseMode=1
    #required for JNI
    java.compiler=NONE
    jvm.classpath=.;C:\JDK1.3.1\lib\tools.jar;C:/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;
    jvm.option=-Xrs
    jvm.option=-Xnoagent
    # not sure if this is needed for iPlanet web server
    jvm.option=-Djava.library.path=C:/iPlanet/examples/foo-dir/natlib/ -Djava.compiler=NONE
    (f) Change magnus.conf file (for JNI)
    We HAD to change this file in order for ThirdParty.jar file to pick up the native C++ code using JNI. Apparently, the
    iPlanet Web Server doesn't pick the Environment Variable Path. Because when we had the directory containing the DLL just
    in Path, it didn't work.
    Change Extrapath directive:
    ExtraPath C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    to
    ExtraPath c:/iPlanet/examples/foo-dir/natlib;C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    (g) Apply changes from the Web Server Administration Console and Restart the web server.
    You should be able to see the behaviour that you want from your application.
    http://yourserver/foo/foo.jsp
    Hope this was helpful!!!
    Sonu

    Deploying a WAR file containing .jsp and servlets (also uses JNI) on Windows 2000
    We had problems making it initially work on Sun ONE Web Server 6.0 Service Pack 1 because of lack of good iPlanet Web
    Server documentation on deploying such files.
    This is how we went about it:
    1) Make one of the servlet and JSP (must call another Java Class) web application (.war) examples work with iPlanet Web
    Server.
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\HelloWorld\HelloWorld.war
    and
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    a) Go to your Web Server Administration to deploy the application using GUI Web Application Deploy.
    (We usually use command line, we experienced some issues with the GUI version, but maybe it is fixed in the new Web Server
    service packs)
    From browser, open http://yourserver:8888/
    Click on Select a Server:Manage
    Click on Virtual Server Class
    Click on https-yourserver
    Click on the Web Applications Tab
    Then, click on Deploy Web Application
    Enter the following -
    WAR File On: Local
    WAR File Path: C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Application URI: /jakarta
    Installation Directory: c:\iPlanet\examples\jakarta-examples
    By clicking on OK it deployed the application.
    I can verify that it is deployed by selecting "Edit Web Applications" and I see the following entry:
    Edit     /jakarta     c:/iPlanet/examples/jakarta-examples
    Also, c:/iPlanet/examples/jakarta-examples should have the similar following directory structure ..
    - [images]
    - [jsp]
    - index.html
    - [servlets]
    - [META-INF]
    - [WEB-INF]
    - [classes]
    - [tlds]
    - web.xml
    - index.html
    I restarted the server and accessed it using the following URL from my IE browser:
    http://yourserver/jakarta/index.html
    Then I clicked on the JSP Examples and tried some JSP examples.
    b) Alternatively, you can also deploy the same example from the command-line.
    Make sure C:\iPlanet\Servers\bin\https\httpadmin\bin\ is in your path
    wdeploy deploy      -u /jakarta
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\jakarta-examples
              C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Restart the web server (I don't think you have to restart, but .. might as well).
    2)Deploy your web-application
    My Foo.war has the following structure.
    You can use jar tf Foo.war to look at the file contents from command line (assuming you have JDK installed and the bin is
    in your PATH)
    Foo.war
    - [META-INF]
    - [WEB-INF]
    - web.xml
    - [classes]
    - Bar.class
    - MoServlet.class
    - [lib]
    - ThirdParty.jar
    - [natlib]
    - extlib.dll
    - foo.jsp
    Here is our application scenario:
    foo.jsp uses a class call Bar (it is not in any package). The Bar java class uses classes from ThirdParty.jar. The
    ThirdParty.jar in turn uses JNI to load library extlib.dll. foo.jsp also calls /servlet/Mo as well.
    Now to deploy it, do the following:
    (a) Make sure that within foo.jsp, you import the Bar class ( I don't know why you have to do it, but if you don't you get
    JSP compile error).
    <%@page language="java" import="Bar" contentType="text/html"%>
    (b) Check web.xml (for Servlets)
    Within web.xml, make sure you have the following mappings:
    <servlet>
    <servlet-name> MoLink </servlet-name>
    <servlet-class> MoServlet </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name> MoLink </servlet-name>
    <url-pattern> /servlet/Mo </url-pattern>
    </servlet-mapping>
    (c) Deploy the application
    Using command line:
    wdeploy deploy      -u /foo
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\foo-dir
              Foo.war
    (d) Change web-apps.xml file (for picking up ThirdParty.jar)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    You should see something similar to following after successful deployment.
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true"/>
    Change it to look like following to pick up the ThirdParty.jar
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true">
    <class-loader reload-interval="300"
              classpath="C:/iPlanet/examples/foo-dir/WEB-INF/lib/ThirdParty.jar"
              delegate="false"/>
    </web-app>
    (e) Change jvm12.conf file (for JNI)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    Add or uncomment the following lines:
    #optional - just helps with instrumenting the jsp and servlet code
    jvm.include.CLASSPATH=1
    jvm.enableDebug=1
    nes.jsp.enabledebug=1
    jvm.trace=7
    jvm.verboseMode=1
    #required for JNI
    java.compiler=NONE
    jvm.classpath=.;C:\JDK1.3.1\lib\tools.jar;C:/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;
    jvm.option=-Xrs
    jvm.option=-Xnoagent
    # not sure if this is needed for iPlanet web server
    jvm.option=-Djava.library.path=C:/iPlanet/examples/foo-dir/natlib/ -Djava.compiler=NONE
    (f) Change magnus.conf file (for JNI)
    We HAD to change this file in order for ThirdParty.jar file to pick up the native C++ code using JNI. Apparently, the
    iPlanet Web Server doesn't pick the Environment Variable Path. Because when we had the directory containing the DLL just
    in Path, it didn't work.
    Change Extrapath directive:
    ExtraPath C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    to
    ExtraPath c:/iPlanet/examples/foo-dir/natlib;C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    (g) Apply changes from the Web Server Administration Console and Restart the web server.
    You should be able to see the behaviour that you want from your application.
    http://yourserver/foo/foo.jsp
    Hope this was helpful!!!
    Sonu

  • How to use DLL in JSP?

              Hello, all,
              I wrote a program to check the user authentication by call Windows's cryptography
              functions. I have generated a DLL file,
              and have put it in the C:\bea\jdk131_03\jre\bin. But my jsp
              page seems ignoring the java code to call the function in the
              DLL. I am not sure what should be imported at the head of the
              jsp file. Would somebody kindly help me out? Thanks a lot!!!
              My jsp code is here:
              <%@ page import="java.sql.Connection"%>
              <html>
              <head>
              <title>
              Jsp1
              </title>
              </head>
              <body>
              <h1>
              JBuilder Generated JSP
              </h1>
              <%
              try{
              if(Ntauth.authenticate("gecorg", "almond", "1025"))
              out.println("Valid user credenticals");
              else
              out.println("Invalid user credenticals");
              }catch(Exception e)
              out.println(e);
              %>
              </body>
              </html>
              

              One of my friend helped me to generate a new dll,
              just changed the package name. Then it works. I don't
              know why. But anyway, it works. Thanks everybody for
              your attention.
              "Sylvie" <[email protected]> wrote:
              >
              >Sorry, I found the function names are not match in my previou
              >post. The name is too long. I missed to type "authenticateNTUser" as
              >"authenticateUser"
              >in the SimpleNTAuthentication.java. I have fixed it. I repost them in
              >the following.
              >So the function name in the .h also corrected. But I still get the same
              >error.
              >
              >Do you know what's wrong?
              >
              >
              >"Sylvie" <[email protected]> wrote:
              >>
              >>Hi, Ann,
              >>
              >>Thanks for replying! But I have checked the function names.
              >>They looks the same. I post the code here, would please have
              >>a look.
              >>
              >>Thanks a lot,
              >>Sylvie
              >>---------------------------------------------------------
              >>SimpleNTAuthentication.java
              >>
              >>package Infolenz.Authentication;
              >>
              >>public class SimpleNTAuthentication {
              >>
              >> static {
              >> System.loadLibrary("ntauth");
              >> }
              >>
              >>
              >> private static native boolean authenticateNTUser(
              >> String domainName, // string that specifies the domain
              >> String userId, // string that specifies the user name
              >> String password // string that specifies the password
              >> );
              >> public static boolean authenticate(String domainName, String userId,
              >>String
              >>password)
              >> {
              >>
              >> if (domainName == null || userId == null || password == null)
              >> return false;
              >> else
              >> return authenticateNTUser(domainName, userId, password);
              >>
              >> }
              >>
              >>
              >>}
              >>---------------------------------------------------------
              >>javah generated Infolenz_Authentication_SimpleNTAuthentication.h
              >
              >/* DO NOT EDIT THIS FILE - it is machine generated */
              >#include <jni.h>
              >/* Header for class Infolenz_Authentication_SimpleNTAuthentication */
              >
              >#ifndef IncludedInfolenz_Authentication_SimpleNTAuthentication
              >#define IncludedInfolenz_Authentication_SimpleNTAuthentication
              >#ifdef __cplusplus
              >extern "C" {
              >#endif
              >/*
              > * Class: Infolenz_Authentication_SimpleNTAuthentication
              > * Method: authenticateNTUser
              > * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z
              > */
              >JNIEXPORT jboolean JNICALL Java_Infolenz_Authentication_SimpleNTAuthentication_authenticateNTUser
              > (JNIEnv *, jclass, jstring, jstring, jstring);
              >
              >#ifdef __cplusplus
              >}
              >#endif
              >#endif
              >
              >>----------------------------------------------------------------
              >>ntauth.cpp
              >>
              >>#include "Infolenz_Authentication_SimpleNTAuthentication.h" // native
              >>library
              >>included
              >>#include "stdio.h" // standard input and output
              >>#include "afxwin.h" // MFC core and standard components
              >>#include "jni.h"
              >>
              >>JNIEXPORT jboolean JNICALL
              >> Java_Infolenz_Authentication_SimpleNTAuthentication_authenticateNTUser
              >> (JNIEnv *env,
              >> jclass javaClass,
              >> jstring jDomainName,
              >> jstring jUserId,
              >> jstring jPassword )
              >>{
              >> jboolean authenticated;
              >> HANDLE hToken;
              >>
              >>
              >> // get the provided domain name, user id and password
              >> const char *cDomainName = env->GetStringUTFChars(jDomainName, 0);
              >> const char *cUserId = env->GetStringUTFChars(jUserId, 0);
              >> const char *cPassword = env->GetStringUTFChars(jPassword, 0);
              >>
              >>
              >> // Copy the char array to temporary variables to be
              >> // passed to LogonUser. This copy is done to guarantee the
              >> // const nature of the jstring char array.
              >> // Inappropriate access to this data can crash the VM!
              >> char *domainName = new char[env->GetStringUTFLength(jDomainName)
              >+
              >>1];
              >> char *userId = new char[env->GetStringUTFLength(jUserId) + 1];
              >> char *password = new char[env->GetStringUTFLength(jPassword) + 1];
              >>
              >> strcpy(domainName, cDomainName);
              >> strcpy(userId, cUserId);
              >> strcpy(password, cPassword);
              >>
              >> // release the chars back to the VM
              >> env->ReleaseStringUTFChars(jDomainName, cDomainName);
              >> env->ReleaseStringUTFChars(jUserId, cUserId);
              >> env->ReleaseStringUTFChars(jPassword, cPassword);
              >>
              >> // try to authenticate
              >> if (LogonUser( userId,
              >> domainName,
              >> password,
              >> LOGON32_LOGON_NETWORK,
              >> LOGON32_PROVIDER_DEFAULT,
              >> &hToken))
              >>
              >> authenticated = JNI_TRUE;
              >> else
              >> authenticated = JNI_FALSE;
              >>
              >> // delete the memory that was allocated
              >> delete domainName;
              >> delete userId;
              >> delete password;
              >>
              >> // close the handle created by LogonUser
              >> CloseHandle(hToken);
              >>
              >> return authenticated;
              >>}
              >>
              >>-------------------------------------------------------------
              >>
              >>Ann Cao <[email protected]> wrote:
              >>>Are you using JNI? There are two problems that could cause Unsatisfied
              >>>link errors. One is the DLL not found, and the other is that the DLL
              >>>is
              >>>found but is unreadable or the specific function cannot be found in
              >>it.
              >>>Since you have set your path correctly, I guess the reason you got
              >the
              >>>error is the second cause.
              >>>
              >>>Sylvie wrote:
              >>>
              >>>> I wrote a test java program to call the authenticate function.
              >>>> but get a Unsatisfied Link Error. It seems that my program
              >>>> has problem to load the DLL. But I have set the path to include
              >>>> the directory containing the DLL. Dose somebody know what is going
              >>>on?
              >>>>
              >>>> Thanks,
              >>>> Sylvie
              >>>>
              >>>> "Sylvie" <[email protected]> wrote:
              >>>> >
              >>>> >Hello, all,
              >>>> >
              >>>> >I wrote a program to check the user authentication by call Windows's
              >>>> >cryptography
              >>>> >functions. I have generated a DLL file,
              >>>> >and have put it in the C:\bea\jdk131_03\jre\bin. But my jsp
              >>>> >page seems ignoring the java code to call the function in the
              >>>> >DLL. I am not sure what should be imported at the head of the
              >>>> >jsp file. Would somebody kindly help me out? Thanks a lot!!!
              >>>> >My jsp code is here:
              >>>> >
              >>>> ><%@ page import="java.sql.Connection"%>
              >>>> >
              >>>> ><html>
              >>>> ><head>
              >>>> ><title>
              >>>> >Jsp1
              >>>> ></title>
              >>>> ></head>
              >>>> >
              >>>> ><body>
              >>>> ><h1>
              >>>> >JBuilder Generated JSP
              >>>> ></h1>
              >>>> ><%
              >>>> > try{
              >>>> > if(Ntauth.authenticate("gecorg", "almond", "1025"))
              >>>> > out.println("Valid user credenticals");
              >>>> > else
              >>>> > out.println("Invalid user credenticals");
              >>>> > }catch(Exception e)
              >>>> > {
              >>>> > out.println(e);
              >>>> > }
              >>>> > %>
              >>>> >
              >>>> >
              >>>> ></body>
              >>>> ></html>
              >>>> >
              >>>
              >>>--
              >>>Regards,
              >>>Ann
              >>>Developer Relations Engineer
              >>>BEA Support
              >>>
              >>>
              >>
              >
              

  • Error when I use JNI

    Hi
    I�m developming a wrapper in C because I need to call C�methods of the scanner�drivers
    but when I run the java�code (the java�code call a JNI function that call the scanner drivers in C)
    I get the following error:
    C:\Documents and Settings\yamilet\Mis documentos\pruebaJNI\Scanner\escaner>java
    Scanner
    Valor devuelto por la funcion Open: 0
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x02ca55ea, pid=2692, tid=4092
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_02-b09 mixed mode, sharing)
    # Problematic frame:
    # C [LS100.dll+0x55ea]
    # An error report file with more information is saved as hs_err_pid2692.log
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    Anybody have any idea about this error?
    Please help me
    Thank for advance

    The problem occurs the same way with or without breakpoints (MessageBoxes) in my code. Without any message boxes in the application, the values sent are retrieved, processed and the result sent back by the native method before the error shows up. I even do a println in the Java code of the result sent back before the error shows up.
    It appears that it is something about the creation of the COM component that is causing the JRE to fail. Interestingly, I have been running this appliction (same client code making use of COM components) for some time now using a C++ front end to pass the data with absolutely no problem. The only difference now is that I am using a Java front end and passing the data using JNI. As I wrote earlier, I have used the -Xcheck:jni option with no error reported. I have even use JRE 6 with the
    -XX:-RelaxAccessControlCheck option. That does not help.

  • Using DLL  with JSP

    I have a dll component writing with C++.
    I want to use this DLL in a JSP Pages.
    Is it possible?
    How could i do?
    I don't want to use JNI because I don't know JAVA.
    thanks.
    Bye.

    I have a dll component writing with C++.
    I want to use this DLL in a JSP Pages.
    Is it possible?Yes.
    How could i do?With JNI.
    I don't want to use JNI because I don't know JAVA.Then you are screwed. Maybe you should use ASP.

  • How to link javabean with c using jni

    I am doing a program about using jni to load a c .But when I was using jni with javabean, under tomcat, it didn't work . Please show me a way.
    my code�F
    /////TestJNI.java
    package com.jsp;
    public class TestJNI{ 
    private byte[] cbuff={49,48,48,48,100,0x0};
    public byte getchar(int i)
    return cbuff;
    public native int GetRandom(byte[] pRandom,int j);
    static
    System.loadLibrary( "TestJNI" );
    public void Execute()
    int r=GetRandom(cbuff,4);
    /////BeanTest.jsp
    <jsp:useBean id="TestJNI" scope="session" class="com.jsp.TestJNI">
    </jsp:useBean>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <body>
    <%=TestJNI.getchar(4)%>;
    <%
    TestJNI.Execute();
    %>
    <br>
    <%=TestJNI.getchar(4)%>
    </body>
    </html>
    //////TestJNI.cpp
    //TestJNI.cpp
    #include"com_jsp_TestJNI.h"
    #include<stdio.h>
    JNIEXPORT jint JNICALL Java_com_jsp_TestJNI_GetRandom (JNIEnv *env,  jclass,  jbyteArray  pRandom,  jint  j)   
    jsize size = env->GetArrayLength((jarray)pRandom);
    jbyte *arrayBody    =  (env)->GetByteArrayElements(pRandom,NULL); 
    jbyte buff[5];
    buff[0]=31;
    buff[1]=32;
    buff[2]=33;
    buff[3]=34;
    buff[4]=35;
    env->SetByteArrayRegion(pRandom,0,5,buff); // set byte[] values
    return (jint)100;
    I put TestJNI.class under directory com/jsp/�Cput TestJNI.dll under classes directory�B
    erro information�F
    java.lang.NoClassDefFoundError
         sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         java.lang.Class.newInstance0(Class.java:308)
         java.lang.Class.newInstance(Class.java:261)
         java.beans.Beans.instantiate(Beans.java:204)
         java.beans.Beans.instantiate(Beans.java:48)
         org.apache.jsp.beantest_jsp._jspService(beantest_jsp.java:45)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

    You can test a normal Class(not a JNI call) invoking in BeanTest.jsp
    1.If there is no problem it's most likely you can't get library path set in server enviroment
    (here: System.loadLibrary( "TestJNI" ); )
    2.If the same exception occurs ,you should check your webapps tree structure.
    please refer to the 2 links if you can read chinese
    http://www.chinaitlab.com/www/news/article_show.asp?id=36677
    http://www.javaresearch.org/article/showarticle.jsp?column=1&thread=4653

  • Call COM Components using JNI

    Hi,
    Can we call COM Components using JNI? If yes can someone pls guide me how to go about it
    Thanks
    Guriqbal

    JNIWrapper 2.0 Beta with Java-COM integration is already available for download and evaluation. Check the http://www.jniwrapper.com/news.jsp
    Hope this helps.
    EToporov

  • How can i call a VB6 project from my java application using JNI

    hi
    can anyone tell me the procedure of calling a VB6 project from any java application using JNI
    if anyone does know then tell me the detail procedure of doing that. I know that i have to create a dll of that VB6 project then to call it from the java application.
    if anyone know that procedure of creating dll file of an existing VB6 project please reply
    please if anyone know then let me know

    Ahh, kind of a duplicate thread:
    http://forums.java.sun.com/thread.jspa?threadID=631642
    @OP. You could have clarified your original post and the relationship of your question to java. You did not need a new thread.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • JVM Crash When Using JNI and COM

    I'm trying to call a DLL compiled from VB6 source code that I do not have access to. The VB6 code simply retrieves data from a DB2 database using ADO and my client code grabs that data and marshals it to my Java code. I'm attempting to achieve this using JNI and COM (without a third-party bridge). It works 75% of the time, but the other 25% of the time, the JVM crashes with the usual Hotspot crash log containing an access violation exception. However, I don't know what in my C++ code (VC++ 8) could be causing this except for passing a "wild" pointer to the code lying underneath the COM object interface. If that is the case, I don't know how I am doing that.
    The Java code that is calling my native method is running on Tomcat 5.5.25 and just to be safe, I am not allowing multiple threads to concurrently call the method in my JNI DLL (though I realize that this will kill performance). Once I can get past this problem, I'll do the COM interfacing on a worker thread in my native code so I don't screw up CoInitialize and CoUninitialize calls in the case the same thread is concurrently executing multiple calls to my native code.
    I've noticed that in most cases, the JVM crashes during my call to the pClsAccount->OpenConnection method. However, my DLL isn't what is listed on the top of the call stack, which is why I suspect the passing of a wild pointer, though I'm just taking a guess at that. Does anyone have an idea as to what's going on ?
    JNIEXPORT jobject JNICALL Java_CustomerInfo_nGetCustomerAccountInfo(JNIEnv *env, jobject customerInfo, jstring accountNumber, jstring iniFileName)
    jboolean isCopy;
    // Account info class and instance to be instantiated
    jclass accountInfoCls = NULL;
    jobject accountInfoObj = NULL;
    // The constructor ID of the accountInfoCls
    jmethodID ctorID = NULL;
    // Pointer to the interface for the ClsAccount COM object
    _clsAccount *pClsAccount = NULL;
    HRESULT hr;
    BSTR bstrIniFileName(L"");
    try
    const char *nativeAccountNumber = NULL;
    if (accountNumber != NULL)
    nativeAccountNumber = env->GetStringUTFChars(accountNumber, &isCopy);
    else
    jclass newExcCls;
    env->ExceptionDescribe();
    env->ExceptionClear();
    newExcCls = env->FindClass("java/lang/IllegalArgumentException");
    env->ThrowNew(newExcCls, "accountNumber passed in was null !");
    return NULL;
    // Initialization
    variantt varConnectionSucceeded = variantt(false);
    variantt varGetAccountInfoSucceeded = variantt(false);
    variantt varAccountNumber = variantt(nativeAccountNumber);
    bstrt bstrLastPaymentDate = bstrt();
    bstrt bstrLastErrorMessage = bstrt();
    bstrt bstrLastErrorNumber = bstrt();
    jlong jTotalDue = NULL;
    jlong jEstablishedDueDay = NULL;
    jlong jLastPaymentAmount = NULL;
    jstring jLastPaymentDate = NULL;
    jstring jLastErrorMessage = NULL;
    jstring jLastErrorNumber = NULL;
    jthrowable jException = NULL;
    const char *chLastPaymentDate = NULL;
    const char *chLastErrorMessage = NULL;
    const char *chLastErrorNumber = NULL;
    long long totalDue;
    long long lastPaymentAmount;
    long establishedDueDateDay;
    //Convert string from Java string to C string to VB string
    const char *nativeIniFileName = NULL;
    if (iniFileName != NULL)
    nativeIniFileName = env->GetStringUTFChars(iniFileName, &isCopy);
    else
    jclass newExcCls;
    env->ExceptionDescribe();
    env->ExceptionClear();
    newExcCls = env->FindClass("java/lang/IllegalArgumentException");
    env->ThrowNew(newExcCls, "iniFileName passed in was null");
    return NULL;
    bstrIniFileName = comutil::ConvertStringToBSTR(nativeIniFileName);
    CoInitialize(NULL);
    // Create an instance of the COClass with the interface over it
    hr = CoCreateInstance(__uuidof(clsAccount), NULL, CLSCTX_INPROC_SERVER, __uuidof(_clsAccount), (void **)&pClsAccount);
    if (hr == S_OK)
    varConnectionSucceeded.boolVal = pClsAccount->OpenConnection(&bstrIniFileName);
    &#12288;
    if (varConnectionSucceeded.boolVal == -1)
    varGetAccountInfoSucceeded.boolVal = pClsAccount->GetAccountPaymentInformation(&(varAccountNumber.GetVARIANT()));
    env->ReleaseStringUTFChars(accountNumber, nativeAccountNumber);
    // Extract all available account information from the ClsAccount object
    if (varGetAccountInfoSucceeded.boolVal == -1)
    totalDue = pClsAccount->TotalDue.int64;
    establishedDueDateDay = pClsAccount->EstablishedDueDateDay;
    lastPaymentAmount = pClsAccount->LastPaymentAmount.int64;
    bstrLastPaymentDate = pClsAccount->LastPaymentDate;
    chLastPaymentDate = comutil::ConvertBSTRToString(bstrLastPaymentDate.GetBSTR());
    jTotalDue = (jlong)totalDue;
    jEstablishedDueDay = (jlong)establishedDueDateDay;
    jLastPaymentAmount = (jlong)lastPaymentAmount;
    jLastPaymentDate = env->NewStringUTF(chLastPaymentDate);
    delete[] chLastPaymentDate;
    pClsAccount->CloseConnection();
    // Populate error fields if any errors occur
    bstrLastErrorMessage = pClsAccount->LastErrMessage;
    chLastErrorMessage = comutil::ConvertBSTRToString(bstrLastErrorMessage.GetBSTR());
    bstrLastErrorNumber = pClsAccount->LastErrNumber;
    chLastErrorNumber = comutil::ConvertBSTRToString(bstrLastErrorNumber.GetBSTR());
    jLastErrorMessage = env->NewStringUTF(chLastErrorMessage);
    jLastErrorNumber = env->NewStringUTF(chLastErrorNumber);
    delete[] chLastErrorMessage;
    delete[] chLastErrorNumber;
    const char* clsName = "com/nuance/merchantsmutual/businessentities/CustomerAccountInfo";
    // Find the Java class and the ID of its constructor
    accountInfoCls = env->FindClass(clsName);
    ctorID = env->GetMethodID(accountInfoCls, "<init>", "(JJJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
    jException = env->ExceptionOccurred();
    if (jException != NULL)
    env->ExceptionDescribe();
    env->ExceptionClear();
    //Release all resources associated with the ClsAccount instance
    pClsAccount->Release();
    //Instantiate the class with the given parameters
    accountInfoObj = env->NewObject(accountInfoCls, ctorID, jTotalDue, jEstablishedDueDay, jLastPaymentAmount, jLastPaymentDate, jLastErrorMessage, jLastErrorNumber);
    jException = env->ExceptionOccurred();
    if (jException != NULL)
    env->ExceptionDescribe();
    env->ExceptionClear();
    else if (hr == REGDB_E_CLASSNOTREG)
    cout << "COM class not registered" << endl;
    else if ( hr == CLASS_E_NOAGGREGATION)
    cout << "COM class can't be aggregated" << endl;
    else if (hr == E_NOINTERFACE)
    cout << "No interface for COM class clsAccount" << endl;
    else if (hr == E_POINTER)
    cout << "*ppv pointer was NULL !" << endl;
    else
    cout << "Error occurred while creating COM object. HR is [" << hr << "]" << endl;
    // Free the BSTR because a new one was returned with a call to comutil::ConvertStringToBSTR
    SysFreeString(bstrIniFileName);
    // Release the string when it's no longer needed. MUST call if string won't be used
    // anymore or else a memory leak will occur
    env->ReleaseStringUTFChars(iniFileName, nativeIniFileName);
    CoUninitialize();
    &#12288;
    catch (_com_error &e)
    cout << "Encountered an exception in GetCustomerAccountInfo: Error was " << e.ErrorMessage();
    pClsAccount->Release();
    catch (...)
    pClsAccount->Release();
    return accountInfoObj;
    Edited by: Cthulhu76 on Jan 5, 2010 9:18 AM

    0x49202400 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=5340, stack(0x49bf0000,0x49c40000)]
    0x48a7e800 JavaThread "Thread-1" [_thread_in_native, id=5976, stack(0x48f00000,0x48f50000)]
    0x48a0dc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3072, stack(0x48c60000,0x48cb0000)]
    0x48a09000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4988, stack(0x48c10000,0x48c60000)]
    0x48a07c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=3124, stack(0x48bc0000,0x48c10000)]
    0x48a07000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2572, stack(0x48b70000,0x48bc0000)]
    0x489f5c00 JavaThread "Finalizer" daemon [_thread_blocked, id=5752, stack(0x48b20000,0x48b70000)]
    0x489f4c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=2596, stack(0x48ad0000,0x48b20000)]
    0x003c6000 JavaThread "main" [_thread_in_native, id=4252, stack(0x00820000,0x00870000)]
    Other Threads:
    0x489f0400 VMThread [stack: 0x48a80000,0x48ad0000] [id=5624]
    0x48a18800 WatcherThread [stack: 0x48cb0000,0x48d00000] [id=1192]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 36288K, used 12762K [0x02940000, 0x050a0000, 0x07800000)
    eden space 32256K, 34% used [0x02940000, 0x0343af58, 0x048c0000)
    from space 4032K, 37% used [0x04cb0000, 0x04e2ba28, 0x050a0000)
    to space 4032K, 0% used [0x048c0000, 0x048c0000, 0x04cb0000)
    tenured generation total 483968K, used 7518K [0x07800000, 0x250a0000, 0x42940000)
    the space 483968K, 1% used [0x07800000, 0x07f57958, 0x07f57a00, 0x250a0000)
    compacting perm gen total 14080K, used 14016K [0x42940000, 0x43700000, 0x46940000)
    the space 14080K, 99% used [0x42940000, 0x436f0320, 0x436f0400, 0x43700000)
    No shared spaces configured.
    Dynamic libraries:
    0x00400000 - 0x0040f000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\tomcat5.exe
    0x7c800000 - 0x7c8c0000      C:\WINDOWS\system32\ntdll.dll
    0x77e40000 - 0x77f42000      C:\WINDOWS\system32\kernel32.dll
    0x77380000 - 0x77411000      C:\WINDOWS\system32\USER32.dll
    0x77c00000 - 0x77c48000      C:\WINDOWS\system32\GDI32.dll
    0x77f50000 - 0x77feb000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77c50000 - 0x77cef000      C:\WINDOWS\system32\RPCRT4.dll
    0x76f50000 - 0x76f63000      C:\WINDOWS\system32\Secur32.dll
    0x77ba0000 - 0x77bfa000      C:\WINDOWS\system32\MSVCRT.dll
    0x7c8d0000 - 0x7d0cf000      C:\WINDOWS\system32\SHELL32.dll
    0x77da0000 - 0x77df2000      C:\WINDOWS\system32\SHLWAPI.dll
    0x76290000 - 0x762ad000      C:\WINDOWS\system32\IMM32.DLL
    0x77420000 - 0x77523000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.3959_x-ww_D8713E55\comctl32.dll
    0x6d7c0000 - 0x6da10000      C:\Program Files\Java\jre1.6.0_07\bin\client\jvm.dll
    0x76aa0000 - 0x76acd000      C:\WINDOWS\system32\WINMM.dll
    0x7c340000 - 0x7c396000      C:\WINDOWS\system32\MSVCR71.dll
    0x6d270000 - 0x6d278000      C:\Program Files\Java\jre1.6.0_07\bin\hpi.dll
    0x76b70000 - 0x76b7b000      C:\WINDOWS\system32\PSAPI.DLL
    0x6d770000 - 0x6d77c000      C:\Program Files\Java\jre1.6.0_07\bin\verify.dll
    0x6d310000 - 0x6d32f000      C:\Program Files\Java\jre1.6.0_07\bin\java.dll
    0x6d7b0000 - 0x6d7bf000      C:\Program Files\Java\jre1.6.0_07\bin\zip.dll
    0x6d570000 - 0x6d583000      C:\Program Files\Java\jre1.6.0_07\bin\net.dll
    0x71c00000 - 0x71c17000      C:\WINDOWS\system32\WS2_32.dll
    0x71bf0000 - 0x71bf8000      C:\WINDOWS\system32\WS2HELP.dll
    0x71b20000 - 0x71b61000      C:\WINDOWS\system32\mswsock.dll
    0x5f270000 - 0x5f2ca000      C:\WINDOWS\system32\hnetcfg.dll
    0x71ae0000 - 0x71ae8000      C:\WINDOWS\System32\wshtcpip.dll
    0x76ed0000 - 0x76efa000      C:\WINDOWS\system32\DNSAPI.dll
    0x76f70000 - 0x76f77000      C:\WINDOWS\System32\winrnr.dll
    0x76f10000 - 0x76f3e000      C:\WINDOWS\system32\WLDAP32.dll
    0x76f80000 - 0x76f85000      C:\WINDOWS\system32\rasadhlp.dll
    0x4a6a0000 - 0x4a6ac000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\CustomerInfoProxy.dll
    0x77670000 - 0x777a9000      C:\WINDOWS\system32\ole32.dll
    0x77d00000 - 0x77d8b000      C:\WINDOWS\system32\OLEAUT32.dll
    0x7c420000 - 0x7c4a7000      C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_E6967989\MSVCP80.dll
    0x78130000 - 0x781cb000      C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_E6967989\MSVCR80.dll
    0x777b0000 - 0x77833000      C:\WINDOWS\system32\CLBCatQ.DLL
    0x77010000 - 0x770d6000      C:\WINDOWS\system32\COMRes.dll
    0x77b90000 - 0x77b98000      C:\WINDOWS\system32\VERSION.dll
    0x75da0000 - 0x75e5d000      C:\WINDOWS\system32\SXS.DLL
    0x75e60000 - 0x75e87000      C:\WINDOWS\system32\apphelp.dll
    0x4dc30000 - 0x4dc5e000      C:\WINDOWS\system32\msctfime.ime
    0x4b0d0000 - 0x4b395000      C:\WINDOWS\system32\xpsp2res.dll
    0x71bb0000 - 0x71bb9000      C:\WINDOWS\system32\WSOCK32.dll
    0x4bbe0000 - 0x4bbea000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\ClearTranProxy.dll
    0x745e0000 - 0x7489e000      C:\WINDOWS\system32\msi.dll
    0x71c40000 - 0x71c97000      C:\WINDOWS\system32\NETAPI32.dll
    0x4bc50000 - 0x4bc6c000      C:\WINDOWS\system32\DBNETLIB.DLL
    0x71f60000 - 0x71f64000      C:\WINDOWS\system32\security.dll
    0x76c90000 - 0x76cb7000      C:\WINDOWS\system32\msv1_0.dll
    0x76cf0000 - 0x76d0a000      C:\WINDOWS\system32\iphlpapi.dll
    0x761b0000 - 0x76243000      C:\WINDOWS\system32\crypt32.dll
    0x76190000 - 0x761a2000      C:\WINDOWS\system32\MSASN1.dll
    0x4bcf0000 - 0x4bcff000      C:\Program Files\Common Files\System\Ole DB\SQLOLEDB.RLL
    0x4a8a0000 - 0x4a8aa000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\MIGI.DLL
    0x73570000 - 0x736c2000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\MSVBVM60.DLL
    0x4a950000 - 0x4a9e2000      C:\Program Files\Common Files\System\ado\msado15.dll
    0x74a50000 - 0x74a6a000      C:\WINDOWS\system32\MSDART.DLL
    0x4c850000 - 0x4c8c9000      C:\Program Files\Common Files\System\Ole DB\oledb32.dll
    0x4dbb0000 - 0x4dbc1000      C:\Program Files\Common Files\System\Ole DB\OLEDB32R.DLL
    VM Arguments:
    jvm_args: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\logging.properties -Djava.library.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib vfprintf -Xms512m -Xmx1024m
    java_command: <unknown>
    Launcher Type: generic
    Environment Variables:
    JAVA_HOME=C:\Program Files\Java\jdk1.6.0_07
    [error occurred during error reporting (printing environment variables), id 0xc0000005]
    --------------- S Y S T E M ---------------
    OS: Windows Server 2003 family Build 3790 Service Pack 2
    CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 7 stepping 6, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3
    Memory: 4k page, physical 2097151k(2097151k free), swap 4194303k(4194303k free)
    vm_info: Java HotSpot(TM) Client VM (10.0-b23) for windows-x86 JRE (1.6.0_07-b06), built on Jun 10 2008 01:14:11 by "java_re" with MS VC++ 7.1
    time: Mon Dec 28 15:24:00 2009
    elapsed time: 600 seconds

  • Associating two events with submit button using  javascript in jsp

    Hi
    How can i Associate two events with submit button using javascript in jsp. Firstly it should insert the data to database and secondly it should close the same pop-up window

    Have something like :
    <input type="submit" name="submitbtn" value="Click me" onClick="function1(); function2(); " />
    You just call both functions sequentially, it's that simple. Although using javascript to work with a database, that seems a bit tricky.

  • Error while using Beans in JSP

    I am using netbeans to develop the applications and am using tomcat version (jakarta-tomcat-4.1.18).
    When I execute the following program i get the below mentioned error::
    StringBean.java
    package test;
    import java.beans.*;
    public class StringBean {
    private String message = "No message SPECIFIED";
    public String getMessage() {
    return message;
    public void setMessage(String message) {
    this.message = message;
    StringBean.jsp
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE>Using JavaBeans with JSP </TITLE>
    <LINK REL=STYLESHEET HREF="JSP-Styles.css" TYPE="text/css" >
    </HEAD>
    <body
    <jsp:useBean id = "SB" class = "test.StringBean" />
    initial value is : <jsp:getProperty name = "SB" property= "message"/>
    <jsp:setProperty name= "SB" property = "message" value= "this the message after the change"/>
    final value is :<jsp:getProperty name = "SB" property= "message"/>
    </body>
    </HTML>
    javax.servlet.ServletException: test/StringBean
    at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:349)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:536)
    Root Cause
    java.lang.NoClassDefFoundError: test/StringBean
         at java.lang.Class.getDeclaredConstructors0(Native Method)
         at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
         at java.lang.Class.getConstructor0(Class.java:1762)
         at java.lang.Class.newInstance0(Class.java:276)
         at java.lang.Class.newInstance(Class.java:259)
    at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.load(IDEJspServlet.java:106)
         at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.loadIfNecessary(IDEJspServlet.java:150)
         at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.service(IDEJspServlet.java:160)
         at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFile(IDEJspServlet.java:246)
         at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:339)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:536)

    Ok The class isn't found, so your classpath settings of netbeans (if you are using the run function in netbeans) isn't set.
    and if you aren't using netbeans to run it, then the class isn't in the webapp/WEB-INF/classes
    good luck

  • Call to a C++ DLL, using JNI - C++ method has char*

    I am trying to link into an existing C++ Dynamically Linked Library(DLL) using the Java Native Interface(JNI).
    All goes fine, and the library loads into the current program, however when I try to call the function, it crashes. The function has char pointers, and I haven;t been able to get Java to simulate them. Is there a way?????
    I have tried using and array of chars .....char[], and String, but no dice.
    Any suggestions O'learned Java ones??

    It will be necessary for you to write a JNI adapter in C/C++ to accomplish this. Java character strings and arrays are very different from those of C/C++ and you'll have to use JNI functions to adapt.
    Chuck

  • Help me!! How to use JavaScript with JSP ??

    I am using JDeveloper and I created a screen in JSP which uses a bean for database connectivity and retriving info onto the page.
    The page has a ListBox where list items are populated from the database.My requirement is
    whenever the list is changed the page shuold be refreshed with the selected item info.
    I tried to use 'JavaScript' for triggering the event with 'onChange' event of the ListBox.But the event is not getting invoked. I think JavaScript is not working with JSP.
    Please help me with how to Use javaScript with JSP or any other alternative where I can meet my requirement.
    I have one more question...I have gone through the JSP samples in OTN and I am trying do download the sample 'Travel servlet' which show list of countries...etc
    I have also gone through the 'readme' but I don't know how to extract .jar file.
    I would be great if you could help me in this.
    Thanks!!
    Geeta
    null

    We have a similar need. We have used Cold Fusion to display data from Our Oracle Database. We have a simple SElect Box in HTML populated with the oracle data. When someone selects say the State of Pennsylvania. then we have an On change event that runs a Javascript to go get all the cities in Pennsylvania.
    Proble we are having is that inorder for the Javascript to work , we currently have to send all the valid data.
    Do you know of any way to dynamically query the the Oracle database in Javascript

Maybe you are looking for