Well, I've built a complete JCA library from source, and using it alone,
I can get a few things working now.
One thing I haven't been able to do is to get the program to load the
JCALibrary.properties file as specified in the tutorial.
Also, I haven't been able to get caj to work yet, only jca. I can't
get the java only client to run and show anything other than
'Context not initialized'.
But such is the way of stepping-stone type projects.
Any ideas on how to get the JCALibrary.properties file to load?
David Dudley
>>> "J. Lewis Muir" <[email protected]> 5/8/2007 4:23 PM >>>
David Dudley wrote:
> Ok, getting much closer now.
>
> I switched from blackdown-jdk-1.4.2.03 to sun-jdk-1.5.0.11. Things
are
> starting to work better now.
>
> Made the modifications suggested to the build.xml file to remove the
> jni interface. I don't think I can manage any native interface code
in
> this particular application given the varied machine architectures
that
> are going to access it.
>
> jca now compiles without error. After adding the reference to the
jca
> library in caj, it compiles fine also.
>
> Modified my classpath to include the output .jar files, and now I
can
> compile the 'SimpleJCAGet.java' program without errors.
> I have a data point named 'TotalSystemLoad' which is the total KW
used
> by the plant, and I can do a camonitor 'TotalSystemLoad' on that
> successfully.
> However, when I say 'java SimpleJCAGet TotalSystemLoad', I get:
> 'Exception in thread "main" java.lang.NoClassDefFoundError:
> SimpleJCAGet'.
>
> Getting better, I just need to get some decent java training, I
guess.
>
> David
It looks like it can't find SimpleJCAGet. SimpleJCAGet needs to be on
your classpath too. Where is SimpleJCAGet.class? What package is
SimpleJCAGet in (i.e. the package declaration at the top of
SimpleJCAGet.java, or the default package if there is no such
declaration)?
If SimpleJCAGet is in the default package, then your classpath should
include the directory where SimpleJCAGet.class resides. If SimpleJCAGet
is in a package, say "com.cctexas", then your classpath should include
the directory that contains the com directory (where the
SimpleJCAGet.class file is at com/cctexas/SimpleJCAGet.class).
-lewis
>>>> "J. Lewis Muir" <[email protected]> 5/8/2007 3:14 PM >>>
> David Dudley wrote:
>> Well, getting closer.
>>
>> I had jca-2.3.1 source downloaded earlier.
>>
>> Moved to directory and did 'ant', it said:
>>
>> build.core.java:
>> [echo] Building core classes
>> [javac] Compiling 67 source files to
>> /usr/local/EPICS/modules/soft/jca/jca-2.3.1/O.core
>> [javac]
>>
>
/usr/local/EPICS/modules/soft/jca/jca-2.3.1/src/core/gov/aps/jca/dbr/DBR_Double.java:89:
>> cannot resolve symbol
>> [javac] symbol : method format
>> (java.util.Locale,java.lang.String,java.lang.Object[])
>> [javac] location: class java.lang.String
>> [javac] toValue[i] =
>> String.format(Locale.US, formatFString, params);
>> [javac]
>
>> ^
>> [javac]
>>
>
/usr/local/EPICS/modules/soft/jca/jca-2.3.1/src/core/gov/aps/jca/dbr/DBR_Double.java:93:
>> cannot resolve symbol
>> [javac] symbol : method format
>> (java.util.Locale,java.lang.String,java.lang.Object[])
>> [javac] location: class java.lang.String
>> [javac] toValue[i] =
>> String.format(Locale.US, formatEString, params);
>> [javac]
>
>> ^
>> [javac]
>>
>
/usr/local/EPICS/modules/soft/jca/jca-2.3.1/src/core/gov/aps/jca/dbr/DBR_Float.java:91:
>> cannot resolve symbol
>> [javac] symbol : method format
>> (java.util.Locale,java.lang.String,java.lang.Object[])
>> [javac] location: class java.lang.String
>> [javac] toValue[i] =
>> String.format(Locale.US, formatFString, params);
>> [javac]
>
>> ^
>> [javac]
>>
>
/usr/local/EPICS/modules/soft/jca/jca-2.3.1/src/core/gov/aps/jca/dbr/DBR_Float.java:95:
>> cannot resolve symbol
>> [javac] symbol : method format
>> (java.util.Locale,java.lang.String,java.lang.Object[])
>> [javac] location: class java.lang.String
>> [javac] toValue[i] =
>> String.format(Locale.US, formatEString, params);
>> [javac]
>
>> ^
>> [javac]
>>
>
/usr/local/EPICS/modules/soft/jca/jca-2.3.1/src/core/gov/aps/jca/jni/JNIContext.java:147:
>> cannot resolve symbol
>> [javac] symbol : constructor IllegalStateException
>> (java.lang.String,java.lang.Throwable)
>> [javac] location: class java.lang.IllegalStateException
>> [javac] throw new IllegalStateException( "Context not
>> initialized", th );
>> [javac] ^
>> [javac] 5 errors
>>
>> BUILD FAILED
>> /usr/local/EPICS/modules/soft/jca/jca-2.3.1/build.xml:144: Compile
>> failed; see the compiler error output for details.
>>
>> Total time: 5 seconds
>>
>> Getting closer, I would say.
>>
>> So, you're saying that caj only replaces the JNI part of jca with a
>> java package, instead of the native interface package?
>
> That's correct. Instead of using the EPICS libraries for Channel
Access
>
> communication, CAJ implements the Channel Access protocol in Java.
>
> About your build problem. What archive of JCA did you download? When
I
>
> downloaded the tar-gz file from http://jca.cosylab.com/ and extracted
> it, tar said "tar: A lone zero block at 1809". I downloaded the zip
> file
> and it extracted cleanly:
>
> $ curl -O http://jca.cosylab.com/distributions/jca-2.3.1-src.zip
>
> Before building JCA, I set EPICS_BASE_RELEASE (sh shell):
>
> $ export EPICS_BASE_RELEASE=/opt/epics-3.14.8.2/base
>
> If you're planning to use the ant install target, you should set
> EPICS_EXTENSIONS to an appropriate value also.
>
> Then I was able to do
>
> $ ant clean
> $ ant
>
> If you are planning to use only the CAJ Channel Access
implementation,
>
> you could consider compiling JCA without the native EPICS libraries.
> However, I don't know that this is officially supported. I was able
to
>
> successfully compile JCA without native EPICS libraries by removing
the
>
> build.core.jni target from the depends attribute of the build.core
> target in build.xml:
>
> ---replace this---
> <target name="build.core" depends="build.core.java,build.core.jni">
> ---with this (i.e. remove "build.core.jni" target dependency)---
> <target name="build.core" depends="build.core.java">
> ---
>
> In this case, I just did (sh shell)
>
> $ export EPICS_BASE_RELEASE=''
> $ ant clean
> $ ant
>
> The JAR file is created at "O.core/jca.jar".
>
> -lewis
>
>>>>> Kay-Uwe Kasemir <[email protected]> 5/8/2007 2:24 PM >>>
>> Hi:
>>
>> You need jca, which gives you
>> a) The basic java API, a lot of interfaces, in a jca.jar file.
>> That's what ant complains about with the missing gov.aps.jca.
>> b) A JNI implementation of those interfaces,
>> using the CA client lib from EPICS base,
>> in some *so or *dll file.
>>
>> Just jca works fine, but the problem is that it depends on the
>> JNI implementation, i.e. binary, system-dependent code.
>> You need to build the JNI part of jca for Win32, Linux, Linux
> 64-bit,
>> OSX-on-ppc, OSX-on-intel, for every version of EPICS base that
>> you want to use.
>>
>> CAJ provides a pure java implementation, so it replaces (b).
>> At the SNS, we had some problems with CAJ possibly causing
>> hangups of CA server threads on IOCs, but the current hope is
>> that that's been fixed as long as you use the latest jca/caj
>> and IOCs run R3.14.9.
>>
>> -Kay
>>
>>
>> On May 8, 2007, at 15:04 , David Dudley wrote:
>>
>>> I'm trying to configure and use the CAJ library, since I can't be
>> sure
>>> what kind of machine the application will be used on. It can
>>> almost be
>>> guaranteed that whatever machine it is, it won't have EPICS on it,
>> for
>>> sure.
>>>
>>> I downloaded caj-1.1.3-src and caj-1.1.3.tar, and am attempting to
>>> figure out how to use it.
>>>
>>> From the caj-1.1.3 source directory, I can't get ant to operate
>>> without
>>> giving pages and pages of errors. It looks for package
>> 'gov.aps.jca',
>>> but shows that package does not exist.
>>>
>>> Still working on getting use to java, I've been a 'c' programmer
> for
>>> around 20 years or so.
>>> All I did was go go to the source directory and type 'ant'. Was
>> there
>>> something else I was supposed to do as well?
>>>
>>> David
>>>
>>>>>> "Matej Sekoranja" <[email protected]> 11/26/2006 1:49
PM
>>>>>>
>>> Hi,
>>>
>>> sorry for the late reply.
>>>
>>>> Is there any additional information on utilizing the Jca library
>>> other
>>>> than the Tutorial listed? I'd like to use a 'monitor' function
to
>>> display
>>>> changing data, but there isn't exactly any documentation on it.
>>> There is a series of EPICS training material.
>>> Java and JCA can be found here:
>>> http://www.aps.anl.gov/aod/bcda/epicsgettingstarted/developtools/
>>> java.html
>>>
>>> See also CA client library tutorials.
>>>
>>> Any help would be appreciated.
>>>
>>>
>>> The best thing is to look at BasicExample source (found in the
>>> sources). I
>>> attach it anyway.
>>>
>>> Matej
>>> <David Dudley.vcf>
>>
>
>
BEGIN:VCARD
VERSION:2.1
X-GWTYPE:USER
FN:David Dudley
TEL;WORK:880-3740
ORG:;MIS
TEL;PREF;FAX:880-3741
EMAIL;WORK;PREF;NGW:[email protected]
N:Dudley;David
END:VCARD
- References:
- Re: CAJ usage David Dudley
- Re: CAJ usage Kay-Uwe Kasemir
- Re: CAJ usage David Dudley
- Re: CAJ usage J. Lewis Muir
- Re: CAJ usage David Dudley
- Re: CAJ usage J. Lewis Muir
- Navigate by Date:
- Prev:
Re: CAJ usage J. Lewis Muir
- Next:
WebCA compiling issues Doug Sheffer
- 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: CAJ usage J. Lewis Muir
- Next:
Re: CAJ usage J. Lewis Muir
- 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
|