Hi Paul,
I think there may have a problem when compiling the JCA/JNI library using
MSVC2005.
With my old JCA/JNI library (v2.1.7) compiled using MSVC2003 free toolkit,
the code works fine.
With the library compiled by MSVC2005, a message windows is popped up.
which says as following: (The JCALibrary.properties is same.)
Microsoft Visual C++ Runtime Library
Runtime Error!
Program: C:\java\jdk1.5.0_14\bin\java.exe
R6034
An application has made an attempt to load the C runtime library
incorrectly.
Please contact the application's support team for more information.
A tracking message throws from java code is as fllowing:
Exception in thread "main" java.lang.UnsatisfiedLinkError:
C:\Java\epics\jca-2.1.7\O.win32-x86\jca.dll:
A dynamic link library (DLL) initialization routine failed
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at gov.aps.jca.jni.JNI$1.run(JNI.java:100)
at java.security.AccessController.doPrivileged(Native
Method)
at gov.aps.jca.jni.JNI.init(JNI.java:110)
at
gov.aps.jca.jni.JNIContext.initialize(JNIContext.java:109)
at
gov.aps.jca.jni.JNIContext._initialize(JNIContext.java:145)
at
gov.aps.jca.jni.ThreadSafeContext.createChannel(ThreadSafeContext.java:330)
at gov.aps.jca.Context.createChannel(Context.java:113)
at test.main(test.java:25)
For the version 2.3.1, a similar error was thrown also.
Guobao
-----Original Message-----
From: Chu, Chungming Paul [mailto:[email protected]]
Sent: 2007年11月29日 2:12 AM
To: Guobao Shen (KEK); ???
Subject: RE: JCA using problem
Yes, I think Guobao is right. I tested your code on my Windows box and it
worked fine (with everything set correctly). The output looks like this:
CLASS : gov.aps.jca.jni.ThreadSafeContext PREEMPTIVE_CALLBACK : true
ADDR_LIST : xxxxxx.sns.ornl.gov AUTO_ADDR_LIST : false CONNECTION_TIMEOUT :
30.0 BEACON_PERIOD : 15.0 REPEATER_PORT : 5065 SERVER_PORT : 5064
MAX_ARRAY_BYTES : 16384
EVENT_DISPATCHER: gov.aps.jca.event.QueuedEventDispatcher@1749757
PRIORITY : 1
gov.aps.jca.TimeoutException: pendIO timed out
Of course, for my ADDR_LIST, I don't have a channel called 'light' and got
pendIO timed out error.
I also attach my JCALibrary.properties file from my Windows box (it's set to
use JCA/JNI, same as in your example). If you're using Linux, you need to
follow the Linux syntax.
If you need further help, could you send more detailed info about the
exception thrown and maybe screen print-out?
Paul
-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Guobao Shen (KEK)
Sent: Tuesday, November 27, 2007 6:32 PM
To: '鲍春雷'; [email protected]
Subject: RE: JCA using problem
Hi Bao,
You need set some environment parameter properly for JCA in
JCALibrary.properties file before you start using it.
There is a tutorial under doc directory if you downloaded the source code.
Some some detail explanation can be found in that file about how to
setJCALibrary.properties .
BTW: Which OS do you use, Linux, Win/XP, ...?
Do you compile the JCA library from source code by yourself?
Guobao Shen
-----Original Message-----
To: [email protected]
Subject: JCA using problem
Hello,all
I am using JCA to do some experment.But the first program can not
run.The error message is:java.lang.IllegalStateException: Context not
initialized.
My environment:
JDK 1.5
JCA 2.3.1
EPICS 3.14.8
The program:
import gov.aps.jca.Channel;
import gov.aps.jca.Context;
import gov.aps.jca.JCALibrary;
public class test {
public static void main(String[] args) {
try {
JCALibrary jca= JCALibrary.getInstance();
Context ctxt=
jca.createContext(JCALibrary.JNI_THREAD_SAFE);
ctxt.printInfo();
Channel ch= ctxt.createChannel("light");
ctxt.pendIO(5.0);
ch.printInfo();
ch.destroy();
ctxt.destroy();
} catch(Exception ex) {
System.err.println(ex);
}
}
}
BaoChunlei
Control Group,IHEP
- Replies:
- RE: JCA using problem, JCA/JNI for Windows Chu, Chungming Paul
- References:
- JCA using problem 鲍春雷
- RE: JCA using problem Guobao Shen (KEK)
- Navigate by Date:
- Prev:
Re: Problem installing SDDS on OS X 10.5.1 Bertrand H.J. Biritz
- Next:
RE: JCA using problem, JCA/JNI for Windows Chu, Chungming Paul
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: JCA using problem Guobao Shen (KEK)
- Next:
RE: JCA using problem, JCA/JNI for Windows Chu, Chungming Paul
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|