Print

Print


Hi,

Sho is right.  Java 1.7 is not required.  But you have to be careful.  If jars produced by 1.7 are loaded by an older compiler, then you will get a version mismatch error at runtime.  So the target should still be 1.6 even if you are using the 1.7 JDK.  The Oracle JDK compilers are able to produce jars compatible with prior releases if configured correctly, but by default the jars will NOT be backward compatible.

I actually do use the 1.7 compiler for deployments, but the lcsim-parent POM that governs shared settings of lcsim-based projects is able to produce 1.6 compatible jars via a setting in the POM file.

--Jeremy

-----Original Message-----
From: [log in to unmask] [mailto:[log in to unmask]] On Behalf Of Sho Uemura
Sent: Thursday, September 05, 2013 12:39 PM
To: Hansson Adrian, Per Ola
Cc: Kyle McCarty; hps-software
Subject: Re: hps-java Error

1.7 is recommended in general because 1.6 is insecure and no longer supported by Oracle, but there's nothing in hps-java/lcsim that requires 1.7. And some people are still stuck with 1.6 on centrally managed systems. So 1.7 is not required.

On Thu, 5 Sep 2013, Hansson Adrian, Per Ola wrote:

> I thought java 1.7 is the recommended version.
>
> On Sep 5, 2013, at 10:45 AM, Sho Uemura wrote:
>
>> You should be able to use Java 1.6 now. (In theory you always could,
>> but there was one stale package that was screwing that up.)
>>
>> Pushing this thread back to the list so it goes in the archives.
>>
>>
>> On Thu, 5 Sep 2013, Kyle McCarty wrote:
>>
>>> This seems to work (at least until I get another version error, but
>>> I'll have to get the server admin to fix that one). Thanks for your
>>> help! Once I get an up-to-date Java version, I will attempt my
>>> analysis again and see if I can get it going now.
>>>
>>>
>>> On Thu, Sep 5, 2013 at 12:47 PM, Sho Uemura <[log in to unmask]> wrote:
>>>
>>>> Note: If you're running on background HPSTrackingDefaults.lcsim may
>>>> not really do what you want; there's no trigger so many of your
>>>> events won't have tracks. You really want to do readout and
>>>> reconstruction separately if you're doing any sort of actual
>>>> analysis. But it should run, which I think is all you care about at the moment.
>>>>
>>>>
>>>> On Thu, 5 Sep 2013, Sho Uemura wrote:
>>>>
>>>> The process is simulation -> readout -> reconstruction -> analysis.
>>>> SLIC
>>>>> does the simulation, so you need to do readout and reconstruction.
>>>>> HPSTrackingDefaults.lcsim (see bottom of the linked page) should do both.
>>>>>
>>>>> https://confluence.slac.**stanford.edu/display/hpsg/**
>>>>> Running+Reconstruction<https://confluence.slac.stanford.edu/displa
>>>>> Running+y/hpsg/Running+Reconstruction>
>>>>>
>>>>> On Thu, 5 Sep 2013, Kyle McCarty wrote:
>>>>>
>>>>> The input LCIO file is a file I generated from the data file
>>>>>> "egs_0.0025x0_450na_100kb_1.**stdhep" which I believe is
>>>>>> background data. I created it using
>>>>>>
>>>>>> ./slic -g
>>>>>> /net/home/mccaky/hps/hps-**detectors/detectors/HPS-**
>>>>>> Proposal2014-v4-6pt6/HPS-**Proposal2014-v4-6pt6.lcdd
>>>>>> -i /net/taro/data/HPS/StdHep/6.**6GeV/beam/egs_0.0025x0_450na_**
>>>>>> 100kb_1.stdhep
>>>>>> -x -o hpsTest -r 10000
>>>>>>
>>>>>> Of course, this is just simulating the data, I suppose, and not
>>>>>> reconstructing it, hence the error. What should I use to
>>>>>> reconstruct the data for further analysis?
>>>>>>
>>>>>>
>>>>>> On Thu, Sep 5, 2013 at 12:08 PM, Sho Uemura
>>>>>> <[log in to unmask]>
>>>>>> wrote:
>>>>>>
>>>>>> The third error - what's the input LCIO file? That steering file
>>>>>> will
>>>>>>> only
>>>>>>> work with reconstruction output. The error is complaining that
>>>>>>> the MatchedTracks (reconstructed tracks) collection doesn't exist.
>>>>>>>
>>>>>>>
>>>>>>> On Thu, 5 Sep 2013, Sho Uemura wrote:
>>>>>>>
>>>>>>> The first error is my fault - the Confluence page example was
>>>>>>> missing the
>>>>>>>
>>>>>>>> runNumber variable. Fixed.
>>>>>>>>
>>>>>>>> The second error refers to your Java version. If you get Java
>>>>>>>> 1.7 you should be fine. In theory 1.6 is supposed to work but
>>>>>>>> there are some packages that are stuck at the wrong version.
>>>>>>>>
>>>>>>>> On Thu, 5 Sep 2013, Kyle McCarty wrote:
>>>>>>>>
>>>>>>>> Thanks for the quick reply. The "-r" was indeed the reason for
>>>>>>>> the error
>>>>>>>>
>>>>>>>>> I
>>>>>>>>> was getting. I was trying to link to external files. I have
>>>>>>>>> attempted to run the commands now without the "-r" and no
>>>>>>>>> longer get the MalformedURLException, but I now get different
>>>>>>>>> errors. Using the sample commands page (
>>>>>>>>> https://confluence.slac.**stan**ford.edu/display/hpsg/**<http:
>>>>>>>>> //stanford.edu/display/hpsg/**>
>>>>>>>>> Running+Readout+Simulation<htt**ps://confluence.slac.stanford.
>>>>>>>>> Running+Readout+**
>>>>>>>>> edu/display/hpsg/Running+**Readout+Simulation<https://confluen
>>>>>>>>> ce.slac.stanford.edu/display/hpsg/Running+Readout+Simulation>
>>>>>>>>>>
>>>>>>>>> )
>>>>>>>>> again to avoid any mistakes in my steering files, I ran:
>>>>>>>>>
>>>>>>>>> java -jar
>>>>>>>>> /net/home/mccaky/hps/hps-java/****target/hps-java-1.7-**
>>>>>>>>> SNAPSHOT-**bin.jar
>>>>>>>>> /net/home/mccaky/hps/hps-java/****target/classes/org/lcsim/**h
>>>>>>>>> ps/** steering/readout/****TestRunReadoutToLcio.lcsim
>>>>>>>>> -i filtered.slcio -DoutputFile=readout
>>>>>>>>>
>>>>>>>>> which gave the error
>>>>>>>>>
>>>>>>>>> Exception in thread "main" java.lang.RuntimeException:
>>>>>>>>> Variable not
>>>>>>>>> defined: runNumber
>>>>>>>>>       at
>>>>>>>>> org.lcsim.job.****JobControlManager.****substituteVariables(**
>>>>>>>>> JobControlManager.java:609)
>>>>>>>>>       at
>>>>>>>>> org.lcsim.job.****JobControlManager.****substituteVariables(**
>>>>>>>>> JobControlManager.java:622)
>>>>>>>>>       at
>>>>>>>>> org.lcsim.job.****JobControlManager.****substituteVariables(**
>>>>>>>>> JobControlManager.java:622)
>>>>>>>>>       at
>>>>>>>>> org.lcsim.job.****JobControlManager.****substituteVariables(**
>>>>>>>>> JobControlManager.java:622)
>>>>>>>>>       at
>>>>>>>>> org.lcsim.job.****JobControlManager.****substituteVariables(**
>>>>>>>>> JobControlManager.java:568)
>>>>>>>>>       at org.lcsim.job.****JobControlManager.setup(**
>>>>>>>>> JobControlManager.java:514)
>>>>>>>>>       at org.lcsim.job.****JobControlManager.setup(**
>>>>>>>>> JobControlManager.java:492)
>>>>>>>>>       at org.lcsim.job.****JobControlManager.setup(**
>>>>>>>>> JobControlManager.java:450)
>>>>>>>>>       at
>>>>>>>>> org.lcsim.job.****JobControlManager.****parseCommandLineOption
>>>>>>>>> s(**
>>>>>>>>> JobControlManager.java:322)
>>>>>>>>>       at org.lcsim.job.****JobControlManager.main(**
>>>>>>>>> JobControlManager.java:168)
>>>>>>>>>
>>>>>>>>> and
>>>>>>>>>
>>>>>>>>> java -jar
>>>>>>>>> /net/home/mccaky/hps/hps-java/****target/hps-java-1.7-**
>>>>>>>>> SNAPSHOT-**bin.jar
>>>>>>>>> /net/home/mccaky/hps/hps-java/****target/classes/org/lcsim/**h
>>>>>>>>> ps/** steering/readout/****HPS2014ReadoutToLcio.lcsim
>>>>>>>>> -i hpsTest.slcio -DoutputFile=readout
>>>>>>>>>
>>>>>>>>> which gives the error
>>>>>>>>>
>>>>>>>>> java.lang.****UnsupportedClassVersionError:
>>>>>>>>> org/jlab/coda/jevio/**** EvioException
>>>>>>>>> :
>>>>>>>>> Unsupported major.minor version 51.0
>>>>>>>>>       at java.lang.ClassLoader.****defineClass1(Native Method)
>>>>>>>>>       at
>>>>>>>>> java.lang.ClassLoader.****defineClass(ClassLoader.java:***
>>>>>>>>> *634)
>>>>>>>>>       at
>>>>>>>>> java.security.****SecureClassLoader.defineClass(****
>>>>>>>>> SecureClassLoader.java:142)
>>>>>>>>>       at
>>>>>>>>> java.net.URLClassLoader.****defineClass(URLClassLoader.**
>>>>>>>>> java:277)
>>>>>>>>>       at
>>>>>>>>> java.net.URLClassLoader.****access$000(URLClassLoader.****
>>>>>>>>> java:73)
>>>>>>>>>       at java.net.URLClassLoader$1.run(****URLClassLoader.java:212)
>>>>>>>>>       at
>>>>>>>>> java.security.****AccessController.doPrivileged(****Native
>>>>>>>>> Method)
>>>>>>>>>       at
>>>>>>>>> java.net.URLClassLoader.****findClass(URLClassLoader.java:*
>>>>>>>>> ***205)
>>>>>>>>>       at
>>>>>>>>> java.lang.ClassLoader.****loadClass(ClassLoader.java:****
>>>>>>>>> 321)
>>>>>>>>>       at sun.misc.Launcher$****AppClassLoader.loadClass(**
>>>>>>>>> Launcher.java:294)
>>>>>>>>>       at
>>>>>>>>> java.lang.ClassLoader.****loadClass(ClassLoader.java:****
>>>>>>>>> 266)
>>>>>>>>>       at
>>>>>>>>> org.lcsim.hps.evio.****TestRunTriggeredReconToLcio.****startOf
>>>>>>>>> Data(**
>>>>>>>>> TestRunTriggeredReconToLcio.****java:82)
>>>>>>>>>       at org.lcsim.util.Driver.****startOfData(Driver.java:172)
>>>>>>>>>       at org.lcsim.util.DriverAdapter.***
>>>>>>>>> *start(DriverAdapter.java:92)
>>>>>>>>>       at
>>>>>>>>> org.freehep.record.loop.****AbstractLoopListener.process(****
>>>>>>>>> AbstractLoopListener.java:22)
>>>>>>>>>       at
>>>>>>>>> org.freehep.record.loop.****DefaultRecordLoop.****fireLoopEven
>>>>>>>>> ts(**
>>>>>>>>> DefaultRecordLoop.java:125)
>>>>>>>>>       at
>>>>>>>>> org.freehep.record.loop.****DefaultRecordLoop.execute(**
>>>>>>>>> DefaultRecordLoop.java:561)
>>>>>>>>>       at org.lcsim.util.loop.LCSimLoop.****loop(LCSimLoop.java:153)
>>>>>>>>>       at org.lcsim.job.****JobControlManager.run(**
>>>>>>>>> JobControlManager.java:393)
>>>>>>>>>       at org.lcsim.job.****JobControlManager.main(**
>>>>>>>>> JobControlManager.java:169)
>>>>>>>>>
>>>>>>>>> Finally, I also tried the command
>>>>>>>>>
>>>>>>>>> java -jar
>>>>>>>>> /net/home/mccaky/hps/hps-java/****target/hps-java-1.7-**
>>>>>>>>> SNAPSHOT-**bin.jar
>>>>>>>>> /net/home/mccaky/hps/hps-java/****target/classes/org/lcsim/**h
>>>>>>>>> ps/** steering/analysis/****StarterAnalysis.lcsim
>>>>>>>>> -i hpsTest.slcio -DoutputFile=readout
>>>>>>>>>
>>>>>>>>> which starts to run, unlike the others which crash
>>>>>>>>> immediately, but it crashes as soon as Event 0 is printed with
>>>>>>>>> the error
>>>>>>>>>
>>>>>>>>> java.lang.****IllegalArgumentException: Unknown event
>>>>>>>>> component MatchedTracks
>>>>>>>>>       at hep.physics.event.BaseEvent.****get(BaseEvent.java:48)
>>>>>>>>>       at org.lcsim.event.base.****BaseLCSimEvent.get(**
>>>>>>>>> BaseLCSimEvent.java:105)
>>>>>>>>>       at
>>>>>>>>> org.lcsim.hps.examples.****StarterAnalysisDriver.****processTr
>>>>>>>>> acks(**
>>>>>>>>> StarterAnalysisDriver.java:87)
>>>>>>>>>       at
>>>>>>>>> org.lcsim.hps.examples.****StarterAnalysisDriver.process(****
>>>>>>>>> StarterAnalysisDriver.java:45)
>>>>>>>>>       at org.lcsim.util.Driver.****doProcess(Driver.java:273)
>>>>>>>>>       at
>>>>>>>>> org.lcsim.util.Driver.****processChildren(Driver.java:****
>>>>>>>>> 284)
>>>>>>>>>       at org.lcsim.util.Driver.process(****Driver.java:198)
>>>>>>>>>       at
>>>>>>>>> org.lcsim.util.DriverAdapter.****recordSupplied(DriverAdapter.
>>>>>>>>> **
>>>>>>>>> **java:74)
>>>>>>>>>       at
>>>>>>>>> org.freehep.record.loop.****DefaultRecordLoop.****consumeRecor
>>>>>>>>> d(**
>>>>>>>>> DefaultRecordLoop.java:832)
>>>>>>>>>       at
>>>>>>>>> org.freehep.record.loop.****DefaultRecordLoop.loop(**
>>>>>>>>> DefaultRecordLoop.java:668)
>>>>>>>>>       at
>>>>>>>>> org.freehep.record.loop.****DefaultRecordLoop.execute(**
>>>>>>>>> DefaultRecordLoop.java:566)
>>>>>>>>>       at org.lcsim.util.loop.LCSimLoop.****loop(LCSimLoop.java:153)
>>>>>>>>>       at org.lcsim.job.****JobControlManager.run(**
>>>>>>>>> JobControlManager.java:393)
>>>>>>>>>       at org.lcsim.job.****JobControlManager.main(**
>>>>>>>>> JobControlManager.java:169)
>>>>>>>>>
>>>>>>>>> I assume that I am still doing something incorrectly, but now
>>>>>>>>> the errors seem to be all different. Any ideas?
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>> Kyle
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Sep 5, 2013 at 11:47 AM, Sho Uemura
>>>>>>>>> <[log in to unmask]>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> This error means hps-java can't find your steering file.
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> If you use the -r option, the steering file path is a Java
>>>>>>>>>> resource path - it refers to a file you compiled into the
>>>>>>>>>> jar. But if you're modifying steering files, it's better to
>>>>>>>>>> not use "-r" so you don't have to rebuild every time you
>>>>>>>>>> change your steering file - I think that's what you wanted
>>>>>>>>>> here.
>>>>>>>>>>
>>>>>>>>>> So use the same command, but drop the "-r".
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Thu, 5 Sep 2013, Kyle McCarty wrote:
>>>>>>>>>>
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> I am trying to run hps-java and am getting some errors.
>>>>>>>>>>> Specifically,
>>>>>>>>>>> I am
>>>>>>>>>>> receiving a "java.net.******MalformedURLException" error
>>>>>>>>>>> when I try to run a steering file through the software. As
>>>>>>>>>>> an example, I tried running the sample commands on the
>>>>>>>>>>> website to make sure that it wasn't something weird in my
>>>>>>>>>>> steering file. I ran the command
>>>>>>>>>>>
>>>>>>>>>>> java -jar
>>>>>>>>>>> /net/home/mccaky/hps/hps-java/******target/hps-java-1.7-****
>>>>>>>>>>> SNAPSHOT-**bin.jar
>>>>>>>>>>> -r
>>>>>>>>>>> /net/home/mccaky/hps/hps-java/******target/classes/org/lcsim
>>>>>>>>>>> /***
>>>>>>>>>>> *hps/**
>>>>>>>>>>> steering/readout/******TestRunReadoutToLcio.lcsim
>>>>>>>>>>> -i filtered.slcio -DoutputFile=readout
>>>>>>>>>>>
>>>>>>>>>>> This crashed giving the error message
>>>>>>>>>>>
>>>>>>>>>>> Exception in thread "main" java.lang.RuntimeException:
>>>>>>>>>>> java.net.MalformedURLException
>>>>>>>>>>>       at org.lcsim.job.******JobControlManager.setup(**
>>>>>>>>>>> JobControlManager.java:488)
>>>>>>>>>>>       at org.lcsim.job.******JobControlManager.setup(**
>>>>>>>>>>> JobControlManager.java:461)
>>>>>>>>>>>       at
>>>>>>>>>>> org.lcsim.job.******JobControlManager.******
>>>>>>>>>>> parseCommandLineOptions(**
>>>>>>>>>>> JobControlManager.java:315)
>>>>>>>>>>>       at org.lcsim.job.******JobControlManager.main(**
>>>>>>>>>>> JobControlManager.java:168)
>>>>>>>>>>> Caused by: java.net.MalformedURLException
>>>>>>>>>>>       at java.net.URL.<init>(URL.java:******617)
>>>>>>>>>>>       at java.net.URL.<init>(URL.java:******480)
>>>>>>>>>>>       at java.net.URL.<init>(URL.java:******429)
>>>>>>>>>>>       at
>>>>>>>>>>> org.apache.xerces.impl.******XMLEntityManager.****
>>>>>>>>>>> setupCurrentEntity(Unknown
>>>>>>>>>>> Source)
>>>>>>>>>>>       at
>>>>>>>>>>> org.apache.xerces.impl.******XMLVersionDetector.****
>>>>>>>>>>> determineDocVersion(Unknown
>>>>>>>>>>> Source)
>>>>>>>>>>>       at org.apache.xerces.parsers.******
>>>>>>>>>>> XML11Configuration.parse(**** Unknown
>>>>>>>>>>> Source)
>>>>>>>>>>>       at org.apache.xerces.parsers.******
>>>>>>>>>>> XML11Configuration.parse(**** Unknown
>>>>>>>>>>> Source)
>>>>>>>>>>>       at
>>>>>>>>>>> org.apache.xerces.parsers.******XMLParser.parse(Unknown
>>>>>>>>>>> Source)
>>>>>>>>>>>       at org.apache.xerces.parsers.******
>>>>>>>>>>> AbstractSAXParser.parse(**** Unknown
>>>>>>>>>>> Source)
>>>>>>>>>>>       at org.apache.xerces.jaxp.******
>>>>>>>>>>> SAXParserImpl$JAXPSAXParser.** parse(Unknown
>>>>>>>>>>> Source)
>>>>>>>>>>>       at org.jdom.input.SAXBuilder.******
>>>>>>>>>>> build(SAXBuilder.java:453)
>>>>>>>>>>>       at org.jdom.input.SAXBuilder.******
>>>>>>>>>>> build(SAXBuilder.java:770)
>>>>>>>>>>>       at org.lcsim.job.******JobControlManager.setup(**
>>>>>>>>>>> JobControlManager.java:486)
>>>>>>>>>>>       ... 3 more
>>>>>>>>>>> Caused by: java.lang.NullPointerException
>>>>>>>>>>>       at java.net.URL.<init>(URL.java:******522)
>>>>>>>>>>>       ... 15 more
>>>>>>>>>>>
>>>>>>>>>>> Note that "filtered.slcio" is in the directory which I ran
>>>>>>>>>>> the command from, and the preceding command
>>>>>>>>>>>
>>>>>>>>>>> java -cp
>>>>>>>>>>> /net/home/mccaky/hps/hps-java/******target/hps-java-1.7-**
>>>>>>>>>>> SNAPSHOT-**
>>>>>>>>>>> bin.jar
>>>>>>>>>>> org.lcsim.hps.users.meeg.******FilterMCBunches hpsTest.slcio
>>>>>>>>>>> filtered.slcio
>>>>>>>>>>> -e250
>>>>>>>>>>>
>>>>>>>>>>> works perfectly. My version of the software was compiled
>>>>>>>>>>> last week, so it should be very up-to-date.
>>>>>>>>>>>
>>>>>>>>>>> Since I got this same message any time I tried to put a
>>>>>>>>>>> steering file in, I assume that I am just doing something
>>>>>>>>>>> dumb and giving hps-java bad information. Can you point me
>>>>>>>>>>> to where my mistake is?
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>>
>>>>>>>>>>> Kyle McCarty
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>
>>>
>>
>> #####################################################################
>> ###
>> Use REPLY-ALL to reply to list
>>
>> To unsubscribe from the HPS-SOFTWARE list, click the following link:
>> https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1
>
> ######################################################################
> ##
> Use REPLY-ALL to reply to list
>
> To unsubscribe from the HPS-SOFTWARE list, click the following link:
> https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1
>

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1