Accessing Dll from JNI
Hello,
I have a dll (COM component) that can create *.wfl files. I am writing an applet to call that dll file so that I can use the component to create the *.wfl file.
Can any one tell me how to do this? Please help me with some source code. I am new to JNI.
Thanks
sir, this is raaj,, long back u posted a question in forum that, how to call functions or procedures from dll created as a com component from java... Did u got it, do u have any idea about it.. Plz help me.. I am also created one dll in vb which contains some functions. I know what the dll does, but I want to call all the functions availabe in vb dll want to call from java. plz help me ya sir..
Similar Messages
-
Sivaram,
You will need to get the DLL into a LIB and wrapper it. Do this (in Win
3.1 & Borland) using the IMPLIB command. Then you can wrapper the lib.
Obviously, you will need to know the function prototype in order to wrapper.
The most common problem is that the functions will probably be defined
as using the PASCAL calling convention and Forte generates function
prototype without the PASCAL. If that happens, you need to modify the
generated *.cc files to add before compiling and linking.
Regards,
Tony Elmore
MSF&W
Springfield, IL
[email protected]
-----Original Message-----
From: Sivaram S Ghorakavi <[email protected]>
To: 'forte' <[email protected]>
Date: Monday, October 27, 1997 11:26 AM
Subject: Accessing DLL
Hello Guys,
Can anybody tell me is there any way to access DLLs from Forte ??
Through external system wrapping or Direct accessing!!!
Any clue will be very helpful
Thanx
Sivaram
International Business Corporation (IBC)Pascal calling convention is implemented in R3.
Please review technote 11183 to set it up.
linh ...
At 03:15 PM 10/29/97 -0600, Jeanne Hesler wrote:
Hi Stephen,
If your errors show all of your function statements with an underscore at
the beginning, then that function has most likely been defined using the
pascal calling convention. Unfortunately, Forte does not provide a way for
you to specify the pascal calling convention prior to generating its
wrapper code. This makes it a bit awkward to wrapper functions that use
that convention, since you must do the fcompile manually. After you make
the library distribution, but before you do the fcompile, you will need to
edit the *.cc files that were generated, and add the call convention on
each of your function statements. This is a bit ugly, especially if you
have 200+ function statements, but once you have everything wrappered,
hopefully you will not need to do it again for a while.
As a point of interest, using the underscore to decorate the function name
for the pascal call convention is not specific to the Microsoft compilers.
Call conventions specify what sequence is used to pass the parameters from
the caller to the callee, and whether the caller or the callee will reset
the stack upon return from the function call. It is imperative that both
caller and callee follow the same rules, or the results will be fairly
disastrous. Using the underscore to decorate the name helps prevent that
kind of mismatch by keeping them from linking accidentally.
On the other hand, you probably can blame Microsoft for the prevalence of
the pascal call convention. Even though cdecl is the default call
convention for the compiler, it is fairly common for developers in the
Windows realm to use the pascal convention instead. This is the convention
used by all of the Windows API's, and I think people just got used to
specifying them that way. In fact, the convention is so prevalent that
some development environments will only utilize external DLL's where the
call convention is pascal. This makes it a bit of a challenge for those of
us who are producing external DLL's to be used in more than one development
environment. When we created the Forte version of our Imaging Developer
product, we changed the call conventions to simplify the wrappering
process, but I suspect that most vendors will stick with the pascal
convention in their DLL's.
Jeanne--
Pardon me for butting in.
I am following this conversation with great interest
because I am trying to do the same thing and I lack
experience in working with the Microsoft build environment.
I have from vendor X the following: A.dll B.dll C.dll and
A.lib and block of about 200 Declare Function statements
all of which reference library A.dll.
So far our attempts to fcompile a Forte 3E0 wrapper have
failed to link due to unresolved symbols, specifically the
Forte wrapper calls, each prefixed in the linker error mssg
with "_". I have heard that the "_" prefix is a Microsoft
"decoration code" for something.
I've done TOOL wrappers for ANSI C callouts on UNIX but this
DLL stuff looks like it has more moving parts.
Are there any tools in the MSVC 5 environment that would
enable us to see the service interfaces that the DLL's
export or determine what is in the LIB?
Stephen Porterfield
Developer
[email protected]
===================================================================
linh pham | ... Do I dare
510.869.2153 | Disturb the universe?
http://www.forte.com | In a minute there is time
| For decisions and revisions
which a minute will reverse.
t.s.eliot -
I am using a Application in c dll calling from jni jar by java applet in firefox version 19.0 , the problem is button click event message box or popup window will not working correctly. Please any one suggest me the steps to overcome this not responding or slowness in the responding problem of Button click event.
Hello,
In Firefox 23, as part of an effort to simplify the Firefox options set and protect users from unintentially damaging their Firefox, the option to disable JavaScript was removed from the Firefox Options window.
However, the option to disable JavaScript was not removed from Firefox entirely. You can still access it from about:config or by installing an add-on.
'''about:config'''
# In the address bar, type "about:config" (with no quotes), and press Enter.
# Click "I'll be careful, I promise"
# In the search bar, search for "javascript.enabled" (with no quotes).
# Right click the result named "javascript.enabled" and click "Toggle". JavaScript is now disabled.
To Re-enable JavaScript, repeat these steps.
'''Add-ons'''
You can alternatively install an add-on that lets you disable JavaScript, such as
*[https://addons.mozilla.org/firefox/addon/noscript/ No-Script] (to disable JavaScript on a per page basis, as required)
*[https://addons.mozilla.org/firefox/addon/quickjava/ QuickJava] (to easily disable and enable JavaScript, automatic loading of images, and other content)
Thank you and I hope this helps! -
Accessing a dll from classes in different packages
Hello java community,
I am new to Java and especially the jni so your help is greatly appreciated.
I am having trouble accessing a Windows native dll from classes in different packages. I placed the .dll in my ClassPath. I am able to loadLibrary successfully from class X in my 'common' package. However, when I try to access the same .dll from another class Y in package 'notsocommon'. I get an unsatisfied link error. I changed the X.h file to include common in the function definition (eg. Java_common_X_functionName) and I did the same to the Y.h file (Java_notsocommon_Y_functionName). I am able to work with the dll from the X class but not the Y class. I don't know what I am doing wrong. I am very new to Java, so any help is appreciated.
Thank you.I apologize to everyone for posting this. I figured out my mistake, it was in the dll and not in the java. Also using
javah -jni notsocommon.Y
creates the correct header file. -
I have a problem with Java, and the problem is that I'm trying to call a DLL file declared by C++ only but without a support for Java programs, is what I'm aiming for going to be available by using the rundll32.exe file.
Note: I'm trying to use the (skydll.dll) file for controling skystar2 DVB card.
Message was edited by:
JZoroYou cannot directly call a DLL from Java unless the DLL exposes entry points that are compatible with the JNI calling conventions.
For example a Java class calling a native function like below:
class Arguments
private native void setArgs (String[] javaArgs);
public static void main (String args[])
Arguments A = new Arguments();
newArgs[] = A.setArgs(args);
static
System.loadLibrary("MyArgs");
}Needs a DLL entry point with the following signature:
JNIEXPORT void JNICALL
Java_Arguments_setArgs (JNIEnv *jenv, jobject job, jobjectArray oarr) {Notice that the first parameter of the method is of type JNIEnv and the second can be either a reference to a class or Java object instance.
Jacques Gonzalez
J4SOFT -
Accessing third party code from JNI. URGENT !!!!
Hi,
I have to use a .so library (Solaris) from another company. As this library has not the correct syntax to be accessed from JNI, I made another .so that calls it.
For compile this library I just need the header file and I can compile it succesfully, but when I run it, throws an error:
relocation error: file /usuarios/davidj/java/jnitest/libtmlog.so: symbol lgprnERRPar: referenced symbol not found
where lgprnERRPar is a function in the 3 party library.
Can anybdy helps me, please???
This is very urgent for me.
Thanks in advanceHi,
I've found
http://forums.java.sun.com/thread.jsp?forum=52&thread=94378
http://forums.java.sun.com/thread.jsp?forum=52&thread=95551
http://forums.java.sun.com/thread.jsp?forum=52&thread=95531
http://forums.java.sun.com/thread.jsp?forum=52&thread=95577
http://forums.java.sun.com/thread.jsp?forum=52&thread=95549
http://forums.java.sun.com/thread.jsp?forum=52&thread=95567
http://forums.java.sun.com/thread.jsp?forum=52&thread=91606
http://forums.java.sun.com/thread.jsp?forum=52&thread=93411
http://forums.java.sun.com/thread.jsp?forum=52&thread=95728
Hope it helps,
Klaus -
Windows Access Bridge from C# (WindowsAccessBridge.dll)
Hello-
Does anyone have sample code for how to call into WindowsAccessBridge.dll from C#? I'm able to build, run, and debug through the Ferret and Monkey samples from Visual Studio .NET 2005, but that's native C code.
I think I've distilled it down to the minimal set of lines required to get started, which I've pasted below, but no calls to "isJavaWindow" will return "true". I've verified the window handle I'm passing in two ways: via Spy++, and by stepping through the Monkey project (it finds the window correctly).
So am I missing an initialization step? Does anyone have working C# code that wraps the Windows Access Bridge?
Greatly appreciated. My code follows. Just create a new C# console app and replace the default Program.cs with this to see it go. Or not.
using System;
using System.Runtime.InteropServices;
namespace WABTest
class Program
[STAThread]
static void Main(string[] args)
DoWABTest();
[DllImport("kernel32.dll")]
private static extern IntPtr LoadLibrary(string lpFileName);
[DllImport("WindowsAccessBridge", CallingConvention = CallingConvention.Cdecl)]
private extern static void Windows_run();
[DllImport("WindowsAccessBridge", CallingConvention = CallingConvention.Cdecl)]
private extern static bool isJavaWindow(IntPtr window);
static void DoWABTest()
IntPtr _bridgeInstance = LoadLibrary("WindowsAccessBridge");
Windows_run();
bool ijw = isJavaWindow(new IntPtr(0x0006050A));
}Hello-
Does anyone have sample code for how to call into WindowsAccessBridge.dll from C#? I'm able to build, run, and debug through the Ferret and Monkey samples from Visual Studio .NET 2005, but that's native C code.
I think I've distilled it down to the minimal set of lines required to get started, which I've pasted below, but no calls to "isJavaWindow" will return "true". I've verified the window handle I'm passing in two ways: via Spy++, and by stepping through the Monkey project (it finds the window correctly).
So am I missing an initialization step? Does anyone have working C# code that wraps the Windows Access Bridge?
Greatly appreciated. My code follows. Just create a new C# console app and replace the default Program.cs with this to see it go. Or not.
using System;
using System.Runtime.InteropServices;
namespace WABTest
class Program
[STAThread]
static void Main(string[] args)
DoWABTest();
[DllImport("kernel32.dll")]
private static extern IntPtr LoadLibrary(string lpFileName);
[DllImport("WindowsAccessBridge", CallingConvention = CallingConvention.Cdecl)]
private extern static void Windows_run();
[DllImport("WindowsAccessBridge", CallingConvention = CallingConvention.Cdecl)]
private extern static bool isJavaWindow(IntPtr window);
static void DoWABTest()
IntPtr _bridgeInstance = LoadLibrary("WindowsAccessBridge");
Windows_run();
bool ijw = isJavaWindow(new IntPtr(0x0006050A));
} -
Accessing 1.5 enumerations from JNI
How do you access a Java 1.5 enumeration from JNI? For example, given
enum Foo { BAR, BAZ };and a call to a native method of the form
someObject.callSomeNativeMethod(Foo.BAR);How do I find out from the JNI code which member of the enumeration has been passed to it?Seing as nobody answered this, I'll answer it myself. If you use javap -s you can see that each enumeration member ends up as a public static final instance of the enumeration class:
public static final Foo Bar;
Signature: LFoo;I hereby award all the duke dollars to myself. -
Calling external C dll from Portal
I have been trying to find the best way to call an external c dll from portal. In forms we used a built-in ora_ffi to make the call. What is the best way to do it in portal. Would I need to call from plsql using the extproc?
depends where the DLL is living.. if you were building the portlet in Java on the midtier you could use JNI to access the DLL. If the DLL is on the infrasture tier then you would need an access method from PLSQL
-
I just installed LV2011 and one dll from my vi won't load with the error "application configuration is incorrect", which is Windows lingo for "missing package dependencies". All the computers at my company with 2010 loaded seem to do OK. When I do a Dependencies Walk I get missing Visual C debug dll's missing plus IEshims and wer which both have a whole tree of dependencies missing on my machine. The Windows install is the same "Windows XP version 2002 Service Pack 3" on my PC and the working PC's. So I'm thinking I have to uninstall 2011 and go back to 2010. Is this correct? Those VC debug dll's were installed on the machines with 2010 in them but were not installed in mine.
I've heard the advice to recompile the dll with debug turned off but I don't have access to the source code.
Thanks in advance.u87 wrote:
Thanks for the reply. This at least tells me that going back to LV2010 is not likely to solve the problem. The missing dll's are:
MFC90D.dll
MSVCR90D.dll
IESHMS.dll
WER.dll
And, once again, IESHMS and WER have other dependencies. So perhaps i need to install the Visual C++ development environment.
IESHIMS.dll is an Internet Explorer DLL that gets usually delay loaded by shdocvw.dll. As delay load it can not cause DLL load errors but only runtime errors. Maybe your DLL has it as direct dependency but that is unlikely since it does not have a documented interface.
WER.dll is Windows error reporting for Vista/Win7.
MFC90D.dll is the Microsoft Foundation classes and MSVCR90D.dll is the MS C runtime library, both as debug variant.
So all the DLLs you mention are actually MS DLLs! You haven't identified the DLL that you try to access in LabVIEW that causes these error messages. IESHIMS and WER are usually delay loaded by any component that needs it and should not likely be used by non MS code.
What is the DLL you try to load into LabVIEW and by whom? Get the provider of that DLL to provide you a non Debug build of the DLL. Installing Visual C on all the machines just to make the DLL load is not a solution, besides that it is likely not legal since I doubt you have that many licenses.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
Accessing objects from an existing JVM on Windows
I have a Java class that is running in an existing JVM which is running on local windows workstation. Is there a way I can access any methods or objects from the running Java class and other objects running inside the JVM from C or C++ code using Invocation API?. I know there is a way for us to ATTACH to a JVM that was created from C/C++ but I am looking for a way to access objects from a JVM that was started either as a service or started by other means.
How did you start the C++ code?
It is possible to load the c++ dll within your Java code then you may access the c++ code by using native methods out of Java. By calling the c++ method you have the pointer to your Java object and my use it (=> don't forget to use global references).
If you have started both seperatly C++ in an extra process and Java in an extra process then it can be complicated. Guess that there aren't any easy solution.
This mean: either you have your Java code loading a dll or you have C++ creating a JVM... -
Calling back c++ method in an exe (not a dll) from java?
Hi all,
I have to make an hybrid C++/java from an existing C++
application that compiled is a big single exe not a dll.
I'm running under win32.
The application consists of several windows. The hybrid
will have widows in C++ and some in java. They have the
same menu and tool bar. In the C++, there are some
callbacks called when a button is pressed. How to call
these callback from java given the fact that the JVM and
the java classes are launched by the exe file.
I know how, from C++, start JVM and call my java window.
I also know how to call a C++ method that is in a dll from
java. It's from the tutorial
http://java.sun.com/docs/books/tutorial/native1.1/index.html
But I don't know how to call a C++ method that is in in an
exe which has launch a JVM from an object running in this
JVM.
Is there somewhere an example like this?
Thanks,
Xavier.Thanks this helped.
For those who want a complete example, here it is:
Tested on XP, java 1.4.2, VC++ 6.0.
************ File invoke.cpp *****************************
#include <stdlib.h>
#include <jni.h>
#ifdef _WIN32
#define PATH_SEPARATOR ';'
#else /* UNIX */
#define PATH_SEPARATOR ':'
#endif
#define USER_CLASSPATH "." /* where Prog.class is */
void JNICALL displayHelloWorld(JNIEnv *env, jobject obj)
printf("Hello world: made by printf from C++\n");
return;
void main() {
JNIEnv *env;
JavaVM *jvm;
JavaVMInitArgs vm_args;
jint res;
jclass cls;
jmethodID mid;
jstring jstr;
jobjectArray args;
char classpath[1024];
int result;
/* IMPORTANT: specify vm_args version # if you use JDK1.1.2 and beyond */
JavaVMOption options[3];
options[0].optionString = "-verbose:gc";
sprintf (classpath, "-Djava.class.path=%s", USER_CLASSPATH);
options[1].optionString = classpath;
options[2].optionString = "-Djava.compiler=NONE";
vm_args.options = options;
vm_args.nOptions = 3;
vm_args.ignoreUnrecognized = JNI_TRUE;
vm_args.version = JNI_VERSION_1_4;
/* IMPORTANT: Note that in the Java 2 SDK, there is no longer any need to call
* JNI_GetDefaultJavaVMInitArgs. It causes a bug
/* Append USER_CLASSPATH to the end of default system class path */
/* Create the Java VM */
res = JNI_CreateJavaVM(&jvm,(void**)&env, &vm_args);
if (res < 0) {
fprintf(stderr, "Can't create Java VM\n");
exit(1);
cls = env->FindClass("mypackage/Prog");
if (cls == 0) {
fprintf(stderr, "Can't find mypackage/Prog class\n");
exit(1);
JNINativeMethod nm;
nm.name = "displayHelloWorld";
/* method descriptor assigned to signature field */
nm.signature = "()V";
nm.fnPtr = displayHelloWorld;
env->RegisterNatives(cls, &nm, 1);
mid = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
if (mid == 0) {
fprintf(stderr, "Can't find Prog.main\n");
exit(1);
jstr = env->NewStringUTF(" from C++! calleded by C++, using argument from C++ but java method");
if (jstr == 0) {
fprintf(stderr, "Out of memory\n");
exit(1);
args = env->NewObjectArray(1,
env->FindClass("java/lang/String"), jstr);
if (args == 0) {
fprintf(stderr, "Out of memory\n");
exit(1);
env->CallStaticVoidMethod(cls, mid, args);
jvm->DestroyJavaVM();
}********************* File ./mypackage/Prog.java **************************
package mypackage;
public class Prog {
public native void displayHelloWorld();
public static void main(String[] args) {
System.out.println("Hello World" + args[0] +"\n");
Prog prog = new Prog();
prog.displayHelloWorld();
System.out.println("(called from java)");
System.out.println("\nSo to sumurize:");
System.out.println(" -1 Starting point is an exe (not DLL, there is no DLL) so C++ code");
System.out.println(" -2 From C++ call java method using argument from C++");
System.out.println(" -3 From java, that was launched by the exe, call to");
System.out.println(" a native using the RegisterNatives in C++\n");
System.out.println("You got a bidirectional example with as starting point");
System.out.println("a single exe, launching JVM, loading class call back C++!");
}******************* Command line for all ****************************************
javac mypackage/Prog
cl -I"D:\Program Files\j2sdk1.4.2_03\include" -I"D:\Program Files\j2sdk1.4.2_03\include\win32" -MT
invoke.cpp -link D:\PROGRA~1\j2sdk1.4.2_03\lib\jvm.lib
(Remark, the last path is using the short name for "Program Files" because with the blank
even adding double quotes result into an error)
You must have jvm.dll in your path for me it's Path=D:\Program Files\j2sdk1.4.2_03\jre\bin\client;
Then simply call invoke and see the result. :-) -
Accessing COM from Java using JCOM
When I tried to access a simple COM component with the com2java generated files,
I got the following error. Can someone help me with this?
<Nov 8, 2001 3:37:24 PM CST> <Error> <HTTP> <[WebAppServletContext(366665,Defaul
tWebApp,/DefaultWebApp)] Servlet failed with IOException
AutomationException: 0x80070005 - General access denied error
at com.bea.jcom.bm.b(bm.java)
at com.bea.jcom.Rpc.a(Rpc.java)
at com.bea.jcom.bf.a(bf.java)
at com.bea.jcom.Dispatch.createDispatch(Dispatch.java)
at com.bea.jcom.Dispatch.<init>(Dispatch.java)
at com.ak.jcomtest._JComTestProxy.<init>(_JComTestProxy.java:33)
at com.ak.jcomtest.JComTest.<init>(JComTest.java:105)
at com.ak.jcomtest.JComTest.<init>(JComTest.java:77)
at jsp_servlet.__jcom._jspService(__jcom.java:91)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2456)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2039)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>I did everything earlier except the second point you mentioned. Everything started
working as soon as I added a line to call com.bea.jcom.AuthInfo.setDefault() method.
I didn't think this was necessary since I already gave permissions to that user
using DCOMCNFG. Thanks for you help.
"BEA jCOM Support" <[email protected]> wrote:
>
Your jcom.log indicates you are trying to access the COM object with
Authentication
"BXDOMAIN/akumar". Add this user to the default access/launch permissions
(using
DCOMCNFG) on the machine hosting the COM object.
Also, make sure you put this in your Java code:
com.bea.jcom.AuthInfo.setDefault("BXDOMAIN", "akumar", "<password>");
"Anil Kumar" <[email protected]> wrote:
Here's the log
jCOM checkconfig 6.1 Beta - Copyright (C) 2001 BEA Systems, Inc. Copyright
(C)
1999-2001 Linar Ltd. and Intrinsyc Software, Inc. http://www.bea.com/jcom/
--- Checking OS ---
Microsoft Windows NT 5.0 (Build: 2195) Service Pack 2
--- Checking Time ---
Time: 15:20:49
Date: 11/13/01
--- opening typelib: JComTestProject.exe ---
Class Name = JComTest
Class Id = 742db055-77df-404a-a579-e0cbfd3007a7
Class Name = JComTestProject.JComTest
AppID = {742DB055-77DF-404A-A579-E0CBFD3007A7}
{742DB055-77DF-404A-A579-E0CBFD3007A7} = JComTestProject.JComTest
Implemented Categories = no value(259)
{40FC6ED5-2438-11CF-A3DB-080036F12502} = no value(259)
LocalServer32 = D:\Program Files\Microsoft Visual Studio\VB98\Projects\JCom\JComTestProject.exe
("D:\Program Files\Microsoft Visual Studio\VB98\Projects\JCom\JComTestProject.exe"
file exists)
ProgID = JComTestProject.JComTest
Programmable = no value(259)
TypeLib = {E0BF28D6-6347-4017-8D2E-52B145CE47DA}
VERSION = 2.0
--- Checking Username ---
USER:WARANGAL\akumar
GROUP:WARANGAL\None
GROUP:\Everyone
ALIAS:WARANGAL\ORA_DBA
ALIAS:BUILTIN\Administrators
ALIAS:BUILTIN\Users
ALIAS:BUILTIN\Power Users
GROUP:\LOCAL
GROUP:NT AUTHORITY\INTERACTIVE
GROUP:NT AUTHORITY\Authenticated Users
--- Checking DCOM settings ---
DCOM version supports accessing Java from COM
EnableDCOM = Y
DefaultLaunchPermission:
Access enabled for NT AUTHORITY\SYSTEM
Access enabled for NT AUTHORITY\INTERACTIVE
Access enabled for BUILTIN\Administrators
--- Connecting to SCM ---
Connecting to SCM on localhost
Connect successful
--- IP configuration ---
Hostname = warangal.bxsys.com
Address 0 = 172.18.32.102
Connecting to SCM on 172.18.32.102
Connect successful
Address 1 = 169.254.25.129
Connecting to SCM on 169.254.25.129
Connect successful
--- Winsock Information ---
Version: 202
Description: WinSock 2.0
--- Environment Variables ---
ALLUSERSPROFILE=C:\WINNT\Profiles\All Users
APPDATA=C:\WINNT\Profiles\anil\Application Data
BOOKSHELF=D:\ifor\WIN\BIN\EN_US
CLASSPATH=.;d:\mystuff\javastuff\jarz;d:\weblogic\lib\weblogic510sp6boot.jar;d:/jdk122/javamail112/mail.jar;d:/jdk122/jaf-1.0.1/activation.jar;d:/jdk122/jsdk2.1/server.jar;d:/jdk122/jsdk2.1/servlet.jar;D:\WebLogicCommerceServer3.2\classes;D:\Oracle\Ora81\jdbc\lib\classes111.zip;D:\weblogic\lib\WebLogic_RDBMS.jar;D:\Oracle\Ora81\orb\classes\yoj.jar;D:\Oracle\Ora81\orb\classes\share.zip
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=WARANGAL
ComSpec=C:\WINNT\system32\cmd.exe
HELP=D:\IBMVJava3.0\eab\;D:\IBMVJava20\eab\;D:\ifor\WIN\BIN
HOMEDRIVE=C:
HOMEPATH=\
I4_INSTALL_DRIVE=D:
I4_LANG=EN_US
IPF_PATH32=D:\ifor\WIN\BIN\EN_US
J2EE_CLASSPATH=D:\j2ee121\lib\cloudscape\cloudspace.jar;
JAVA_HOME=d:\jdk13
LOGONSERVER=\\WARANGAL
NLSPATH=D:\ifor\LS\MSG\%L\%N
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Os2LibPath=C:\WINNT\system32\os2\dll;
Path=d:\jdk13\bin;D:\Oracle\Ora81\bin;D:\Oracle\Ora81\orb\bin;C:\WINNT;C:\WINNT\system32;C:\WINNT\system32\WBEM;d:\jdk13\bin;D:\CVS;D:\ifor\WIN\BIN;D:\ifor\WIN\BIN\EN_US;D:\JavaStuff\jakarta-ant-1.3\bin;D:\BEA\wlserver6.1\jcom\bin;D:\WebGain\VisualCafe\Java2\Bin;C:\Program
Files\Common Files\WebGain Shared;D:\WebGain\VisualCafe\Bin;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 8 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0803
ProgramFiles=C:\Program Files
PROMPT=$P$G
StarTeam=D:\StarTeam 4.0\StarTeam.ini
StarTeamApp=D:\StarTeam 4.0
STLicense=D:\StarTeam 4.0
SystemDrive=C:
SystemRoot=C:\WINNT
TEMP=D:\TEMP
TMP=D:\TEMP
USERDOMAIN=WARANGAL
USERNAME=akumar
USERPROFILE=C:\WINNT\Profiles\anil
windir=C:\WINNT
WorkstationID=D:\StarTeam 4.0\ConnectionManager.ini
"Damon Hon" <[email protected]> wrote:
hi anil,
can you run the checkconfig tool as well
checkconfig /typelib <path to tlb> config.log
and post the log
thanks
damon
"Anil Kumar" <[email protected]> wrote in message
news:[email protected]...
Hi Damon,
I am just calling the default constructor of the com2Java generatedclass(in this
case, it is JComTest.class) from a simple JSP. I am not calling anymethods on
this component. Here are the contents of the log file.
jCOM version 6.1 Beta logger started in immediate mode at Tue Nov
13
12:32:41
CST 2001 at level 3 (VERBOSE)
License:
Classloader is bootstrap
java.version is 1.3.1
java.vendor is Sun Microsystems Inc.
java.class.path is..;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;D:\BEA\wlserver6.1\jcom\lib\jcom.
jar;D:\Projects\JCom\src
java.library.path isD:\BEA\jdk131\bin;.;C:\WINNT\System32;C:\WINNT;.\bin;d:\jdk13\bin;D:\Oracle\
Ora81\bin;D:\Oracle\Ora81\orb\bin;C:\WINNT;C:\WINNT\system32;C:\WINNT\system
32\WBEM;d:\jdk13\bin;D:\CVS;D:\ifor\WIN\BIN;D:\ifor\WIN\BIN\EN_US;D:\JavaStu
ff\jakarta-ant-1.3\bin;D:\BEA\wlserver6.1\jcom\bin;D:\WebGain\VisualCafe\Jav
a2\Bin;C:\Program
Files\Common Files\WebGain Shared;D:\WebGain\VisualCafe\Bin;
os.name/os.arch/os.version is Windows 2000/x86/5.0
1005676361251 +: New RemOxidResolver initialised for Net={{ 0x7,127.0.0.1[135]}}
Sec={}
1005676361271 +: Looking for free connection handler to 127.0.0.1[135]for
BXDOMAIN/akumar
1005676361311 : OXID Resolver started. Listening on port 3895
1005676361321 : Object Exporter binding is Net={{ 0x7,172.18.32.102[3896]},
{ 0x7, 169.254.25.129[3896]}} Sec={{ 0xa, 0xffff, }, { 0x0, 0x0,
OXID
is 1005676361311
1005676361331 +: Opening a TCP/IP connection to 127.0.0.1[135] withauth
BXDOMAIN/akumar
1005676361361 : Sending RemoteActivation request to Net={{ 0x7,127.0.0.1[135]}}
Sec={} to activate cls/iid742db055-77df-404a-a579-e0cbfd3007a7/fbcd1246-3557-4b95-8046-cfec093310b5
1005676361832 : Sending IRemoteActivation::RemoteActivation request,with
RPC
call id 2 on ipid null
1005676361892 : Received the response toIRemoteActivation::RemoteActivation
request, with RPC call id 2
1005676361902 +: Remote server's version: 5.1
1005676361942 *: Error activating742db055-77df-404a-a579-e0cbfd3007a7/fbcd1246-3557-4b95-8046-cfec093310b5:
AutomationException: 0x80070005 - General access denied error
"Damon Hon" <[email protected]> wrote:
hi anil,
can you post the snippet of java code that is calling the methods
from your COM object and post the following logs
jcom.log
- In your java code, add the following line to the start of your
initialization code.
com.bea.jcom.Log.logImmediately(3, "c:\\temp\\jcom.log");
config.log
- Run the checkconfig utility to generate this log
checkconfig /typelib <path to tlb> config.log
thanks
damon
"Anil Kumar" <[email protected]> wrote in message
news:[email protected]...
Thanks for the info. I had already done this before. I checked
everything
a dozen
times. I am not sure why this is happening. Please let me know,
if
there
are any
other ideas.
"Damon Hon" <[email protected]> wrote:
hi anil,
The exception you are getting, indicates that your java client
does
not
have
sufficient permissions to access your com component.
if you are running your java code and com component on the same
machine,
- make sure that your jcom/bin directory is in your path environment
variable
- run the DCOMCNFG tool to configure accesss for the interactiveuser
or the
user you are logged in as.
if you are not running your java code under windows, add this
call
in
your
java code:
com.bea.jcom.AuthInfo.setDefault("nt domain", "user", "password");
- use the DCOMCNFG tool to configure has dcom access to the
com
component for this user
let me know if this helps
damon
"Anil Kumar" <[email protected]> wrote in message
news:[email protected]...
When I tried to access a simple COM component with the com2java
generated
files,
I got the following error. Can someone help me with this?
<Nov 8, 2001 3:37:24 PM CST> <Error> <HTTP><[WebAppServletContext(366665,Defaul
tWebApp,/DefaultWebApp)] Servlet failed with IOException
AutomationException: 0x80070005 - General access denied error
at com.bea.jcom.bm.b(bm.java)
at com.bea.jcom.Rpc.a(Rpc.java)
at com.bea.jcom.bf.a(bf.java)
at com.bea.jcom.Dispatch.createDispatch(Dispatch.java)
at com.bea.jcom.Dispatch.<init>(Dispatch.java)
at
com.ak.jcomtest._JComTestProxy.<init>(_JComTestProxy.java:33)
at com.ak.jcomtest.JComTest.<init>(JComTest.java:105)
at com.ak.jcomtest.JComTest.<init>(JComTest.java:77)
at jsp_servlet.__jcom._jspService(__jcom.java:91)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:265)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2456)
atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2039)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
> -
Call a method in VB dll from Java Web Application
Hi,
I'm trying to call a method of a VB dll, from a web application developing with J2EE. Is it possible without JNI? And, if it is not possible with a tool, can you help me with an example of JNI using?
Thank you
Marymaria_eg wrote:
I'm trying to call a method of a VB dll, from a web application developing with J2EE. Is it possible without JNI? Maybe using Runtime#exec() and rundll32.exe. Depends on the DLL which you want to call.
And, if it is not possible with a tool, can you help me with an example of JNI using?JNI tutorial: http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html
JNI forum: http://forum.java.sun.com/forum.jspa?forumID=52 -
How to compile a dll for JNI in the CMD correctly
Now I find alot of old threads on using the mno command in cygwin to created dlls to use as an interface between c and Java, however I know this command is no longer available in cygwin and so I took the advid of downloading minGW and using this in the CMD instead.
However every example I try to compile and run this way throws the unsatified link error when the native function is to be called by the Java program. I believe it must be a compiling error creating a mismatch between the native function and the function to be called.
Here is the method I'm using to comile dlls for JNI, it is from the FAQ section of the minGw website:
gcc -Wall -D_JNI_IMPLEMENTATION_ -Wl,--kill-at
-Ic:/j2sdk1.4.1_02/include -Ic:/j2sdk1.4.1_02/include/win32
-shared someJavaImp.c -o JavaImp.dll
Is this how dll should be compiled? If not any suggestions?sudsey wrote:
I know how to program well in C and Java, I just need to know the proper way to compile a dll for JNI.1. Get the MS IDE
2. Create a dll project - it must NOT be a managed dll
3. All done.
Maybe you are looking for
-
Ora-20100 file o0056030.tmp creation for fnd_file failed
Hi all, i have created a menu and save . when i checked on view-->request --Find i got following error. ora-20100 file o0056030.tmp creation for fnd_file failed plz help thanks
-
who can give me some help to use tiles in JSF(myfaces) with shale? there's a error when i do this, see following: pplicationDispatcher[jsftest] Servlet.service() for servlet Faces Servlet threw exception java.lang.IllegalStateException: Cannot forwar
-
Effects on images not starting out hidden
Under Dreamweaver Spry 1.6 I have a link that calls a new browser window and that page has an image that should both fade in and grow from 0% to 100% using the appear/fade grow/shrink effects. When the window first opens I see the image in full size
-
Indesign 5.5 continually quits on launch
I keep getting the 'InDesign quit unexpectedly' message when I try to open the program - this only seems to have happened recently and it used to work fine. I'm running OSX version 10.8.2 - mountain lion I already installed the Indesign 7.8.2. update
-
I was on live chat yesterday about 45 minutes trying to sort out my daughters and my own upgrade. I was given the guys ee email address to re contact him when i had found out what handset my daughter wanted.I have now emailed him three times with a r