Experimental Physics and Industrial Control System
On 11/27/07 8:37 PM, 鲍春雷 wrote:
> 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
Could you change "System.err.println(ex);" to "e.printStackTrace();" and
provide the full stack trace?
What platform are you on?
If you're on Linux, does running "cainfo light" work?
Have you set the appropriate environment variable for your platform to
include the location of the native JCA library so the Java VM can find
it? On Linux, this is LD_LIBRARY_PATH. Or you could set the
java.library.path system property.
Guobao Shen indicated that you should set up your JCALibrary.properties
file. This may be what you need to do. Another approach just to get
things working is what I've attached. If you're on Linux, do the following:
1. $ tar xzvf printinfo.tar.gz
2. $ cd printinfo
3. Put your jca.jar file in share
4. Put your libjca.so file in lib
5. $ make
6. $ make run PV=light
-lewis
--
J. Lewis Muir
Software Engineer
CARS/IMCA-CAT
Attachment:
printinfo.tar.gz
Description: GNU Zip compressed data
- References:
- JCA using problem 鲍春雷
- Navigate by Date:
- Prev:
Re: Problem installing SDDS on OS X 10.5.1 Bob Soliday
- Next:
Re: MVME6100 or 7100 Oleg Makarov
- 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, JCA/JNI for Windows Chu, Chungming Paul
- Next:
current measurement - hardware Heinrich du Toit
- 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