Coherence 12 + Lucene

Dear,
I have a problem using the lucene with coherence.
The error occurs when I try to create the index in the cache. Can you help?  (searchFactory.createIndex(locationscache);)
Error:
Wrapped: Failed request execution for DistributedCache service on Member(Id=1, Timestamp=2014-11-24 02:18:29.874, Address=192.168.1.143:8088, MachineId=34361, Location=site:,machine:jequi,process:8416, Role=WeblogicServer)) java.lang.AbstractMethodError: org.gridkit.coherence.search.SearchFactory$SearchIndexExtractor.createIndex(ZLjava/util/Comparator&#59;Ljava/util/Map&#59;Lcom/tangosol/net/BackingMapContext&#59;)Lcom/tangosol/util/MapIndex&#59;
   at com.tangosol.util.Base.ensureRuntimeException(Base.java:289)
   at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.tagException(Grid.CDB:50)
   at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onIndexRequest(PartitionedCache.CDB:78)
   at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$IndexRequest.run(PartitionedCache.CDB:1)
   at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:1)
   at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:32)
   at com.tangosol.coherence.component.util.DaemonPool$Daemon.onNotify(DaemonPool.CDB:65)
   at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:51)
   at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.AbstractMethodError: org.gridkit.coherence.search.SearchFactory$SearchIndexExtractor.createIndex(ZLjava/util/Comparator&#59;Ljava/util/Map&#59;Lcom/tangosol/net/BackingMapContext&#59;)Lcom/tangosol/util/MapIndex&#59;
   at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.addIndex(PartitionedCache.CDB:32)
   at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onIndexRequest(PartitionedCache.CDB:42)
Code:
public class PersistenceLocation implements Serializable {
    final static Logger logger = LogManager.getLogger(PersistenceLocation.class);
    private final NamedCache locationscache;
    private final NamedCache keysetmap;
    /*Utilizando Lucene para fazer indexação e consulta*/
    private final LuceneDocumentExtractor extractor;
    private final LuceneSearchFactory searchFactory;
    public PersistenceLocation() {
        logger.trace("Create a new instace of Persistence");
        keysetmap = CacheFactory.getCache("keysetscache");
        locationscache = CacheFactory.getCache("locationscache");
        /*locationscache.addIndex(new ReflectionExtractor("getName"), true
                , null);*/
        /*Utilizando Lucene para fazer indexação e consulta*/
        extractor = new LuceneDocumentExtractor();
        extractor.addText("Name", new ReflectionExtractor("getName"));
        extractor.addText("Zipcode", new ReflectionExtractor("getZipcode"));
        extractor.addText("Address", new ReflectionExtractor("getAddress"));
        extractor.addText("City", new ReflectionExtractor("getCity"));
        extractor.addText("Country", new ReflectionExtractor("getCountry"));
        searchFactory = new LuceneSearchFactory(extractor);
        searchFactory.createIndex(locationscache);
The object "Location", used in cache:
public class Location implements Serializable {
    private int locationid;
    private String name;
    private String zipcode;
    private String address;
    private String city;
    private String country;
    private String latitude;
    private String longitude;
    public Location() {
     public String getName() {
     public String getZipcode() {
     public String getAddress() {
     public String getCity() {
     public void setCountry(String country) {
Thanks!
Renan Paz

Added a Jira ticket for the same COHINC-94 issue can be tracked over there so closing the thread.
Ashish Garg

Similar Messages

  • Is there a way of getting Coherence to run without starting up a cluster?

    It's painful to run unit-tests against Coherence because I can't find a way of configuring it with a simple local in-memory scheme, but still get to test features requiring custom POF types, etc..
    I have implemented the advice here: http://coherence.oracle.com/display/COH35UG/Setting+Single+Server+Mode
    But it still seems far too slow when you are used to unit tests taking milliseconds- and things seem to have got slower with Coherence 3.5.
    Are there any plans to allow disabling of the TCMP/clustering layer? This would greatly improve the product in my opinion.

    You can set the "<join-timeout-milliseconds>" (on [<multicast-listener>|http://coherence.oracle.com/display/COH35UG/multicast-listener]) to the lowest possible number. Make sure to remember to set it to the recommended value when you want to start testing in a cluster again.
    Rob
    :Coherence Team:

  • Error when starting Weblogic server with Coherence

    We want to use Coherence 3.6 with Weblogic Server 10.3. During server startup, we get the following error. My understanding is the cluster should be started automatically based on the configuration listed below the error. Appreciate any pointers.
    <Dec 15, 2011 3:20:11 PM PST> <Error> <Coherence> <BEA-000000> <2011-12-15 15:20:11.920/67.311 Oracle Coherence SE 3.6.0.4 <Error> (thread=Cluster, member=n/a): This member could not join the cluster because of a configuration mismatch between this member and the configuration being used by the rest of the cluster. This member specified a cluster name of "EPCIS" which did not match the name of the running cluster. This indicates that there are multiple clusters on this network attempting to use overlapping network configurations. Rejected by Member(Id=9, Timestamp=2011-11-16 13:58:42.941, Address=10.229.189.30:8088, MachineId=21022, Location=site:us.oracle.com,machine:adc2101177,process:30667, Role=WeblogicServer).>
    <Dec 15, 2011 3:20:11 PM PST> <Error> <oracle.apps.pas.epc.framework.db.Cache> <BEA-000000> <java.lang.RuntimeException: Failed to start Service "Cluster" (ServiceState=SERVICE_STOPPED, STATE_JOINING)>
    <Dec 15, 2011 3:20:11 PM PST> <Error> <Coherence> <BEA-000000> <2011-12-15 15:20:11.957/67.349 Oracle Coherence SE 3.6.0.4 <Error> (thread=[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Error while starting cluster: java.lang.RuntimeException: Failed to start Service "Cluster" (ServiceState=SERVICE_STOPPED, STATE_JOINING)
    CONFIGURATION:
    We have the following descriptor (epcis-coherence-cache-config.xml) in $DOMAIN_HOME/epc-config:
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
    <caching-scheme-mapping>
    <cache-mapping>
    <cache-name>*</cache-name>
    <scheme-name>distributed</scheme-name>
    </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
    <distributed-scheme>
    <scheme-name>distributed</scheme-name>
    <service-name>DistributedCache</service-name>
    <backing-map-scheme>
    <local-scheme></local-scheme>
    </backing-map-scheme>
    <autostart>true</autostart>
    </distributed-scheme>
    </caching-schemes>
    </cache-config>
    We also have tangosol-coherence-override.xml in the same dir:
    <coherence>
    <cluster-config>
    <member-identity>
    <cluster-name system-property="tangosol.coherence.clustername">EPCIS</cluster-name>
    </member-identity>
    </cluster-config>
    <configurable-cache-factory-config>
    <class-name>com.tangosol.net.DefaultConfigurableCacheFactory</class-name>
    <init-params>
    <init-param>
    <param-type>java.lang.String</param-type>
    <param-value>epcis-coherence-cache-config.xml</param-value>
    </init-param>
    </init-params>
    </configurable-cache-factory-config>
    <license-config>
    <edition-name system-property="tangosol.coherence.edition">SE</edition-name>
    <license-mode system-property="tangosol.coherence.mode">dev</license-mode>
    </license-config>
    </coherence>
    We have modified startWebLogic.sh by adding:
    PRE_CLASSPATH="/slot/xyz/oracle/mwhome/oracle_common/modules/oracle.coherence_3.6/coherence.jar:${DOMAIN_HOME}/epc-config/:${PRE_CLASSPATH}"

    As the error message says, your WebLogic server is trying to join a cluster that has a different cluster name.
    This bit in your tangosol-coherence-override.xml file or the tangosol.coherence.clustername system property must be the same in all members of the cluster
    <cluster-name system-property="tangosol.coherence.clustername">EPCIS</cluster-name>JK

  • Getting schema validation working in Eclipse with Coherence 3.7.1.0

    Just wondered if anyone had got schema validation to work in Eclipse (3.5 - Galileo) for Coherence 3.7.1.0?
    The Coherence developer docs show that you should add sections like this:
    <pof-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://xmlns.oracle.com/coherence/coherence-pof-config"
    xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-pof-config
    coherence-pof-config.xsd">
    However, if I use that "shortened" form (for cache, pof, etc. configs) Eclipse gives a warning "No grammar constraints (DTD or XML schema) detected for the document." and the schema validation fails to work (i.e. no "auto pop-ups" when entering content, and rubbish content is gladly accepted.)
    In Coherence 3.7.0, I'd used the following "extended" form (note the longer "schemaLocation") to get things working correctly:
    <pof-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://xmlns.oracle.com/coherence/coherence-pof-config"
    xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-pof-config
    http://xmlns.oracle.com/coherence/coherence-pof-config/1.0/coherence-pof-config.xsd">
    Also note that entering the "http://xmlns.oracle.com/coherence/coherence-pof-config/1.0/coherence-pof-config.xsd" in a web browser opens the xsd, as you'd expect.
    Now...
    I'm looking at the PofAnnotationSerializer in 3.7.1.0 and the "auto indexing" option. The declaration in my pof file for it fails as the "class" (or fully-qualified java.lang.Class version) in the "init-params" section isn't valid. If I look at the xsd on the url above, this is indeed the case, that option does not appear.
    However, if I look at the POF xsd in the coherence.jar file for 3.7.1.0, the "class" option has been added, and has a newer 'version="1.1"' added to it's schema declaration. So I therefore tried to point my "extended" declaration to point to " http://xmlns.oracle.com/coherence/coherence-pof-config/1.1/coherence-pof-config.xsd", in order to get schema validation to work in Eclipse with this new schema. Unfortunately that url doesn't exist - you get a "Content Server Request Failed" error.
    So, I guess my question is, is there a way to get myself pointed at the 1.1 versions of the xsd's so I can have schema validation working in Ecliipse? Or is there another workaround (did a bit of Googling, but that mainly seemed to be people switching validation off to simply get rid of the error...)
    Cheers,
    Steve

    Cheers, Dave.
    I had in fact had a try at extracting the xsd and pointing to it directly, and that did indeed work (had to do this following the same steps shown below using an "entry" in the XML Catalog.)
    I had a look around at some of the other "entries" in Eclipse by default and noticed that they actually refer to xsd's directly within the jars, hence saving the extraction step and keeping screw-ups down to a minimum; a bit of playing around to get the syntax right and I finally managed to get it working.
    For those who are interested (NB. my Coherence 3.7.1.0 install is in a directory "c:\coherence3.7"), the steps are:
    In Eclipse, Go to Window->Preferences->XML->XML Catalog. Then create a "User Specified Entry".
    In the "Location", add (without the quotes): "jar:file:/C:/coherence3.7/coherence/lib/coherence.jar!/coherence-pof-config.xsd"
    In the "Key Type", add (without the quotes): "Namespace Name"
    In the "Key", add (without the quotes): "http://xmlns.oracle.com/coherence/coherence-pof-config"
    The schema validation now works fine. Eclipse shows no warnings/errors, and the auto-complete and validation are fully functional.
    Still, it would be nice to get the "1.1" urls updated to point to the schemas on the Oracle site, to avoid all our developers from having to make these changes (and of course avoid them pointing at an older, out-of-date local install of coherence.)
    Cheers,
    Steve

  • Coherence*Web on GlassFish Server Issues

    Hi!
    We are using Coherence 3.7.1.8 in our application in GlassFish 3.1.2 both as application cache and for storing session data (Coherence*Web) so it can be shared between multiple EARs and App server instances. Session data sharing between EARs in the same container works fine, but when we try to share session data between application server instances the server stops responding and has to be restarted. The only thing we get on the log is this exception:
    #|SEVERE|oracle-glassfish3.1.2|com.tangosol.coherence.servlet.ParallelReapTask|_ThreadID=169;_ThreadName=Thread-2;|An exception was thrown while reaping a session.
    com.tangosol.coherence.servlet.commonj.WorkException: Work Failed.
      at com.tangosol.coherence.servlet.commonj.impl.WorkItemImpl.run(WorkItemImpl.java:167)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:722)
    Caused by: java.lang.ClassCastException: com.tangosol.coherence.servlet.SplittableHolder cannot be cast to com.tangosol.coherence.servlet.AttributeHolder
      at com.tangosol.coherence.servlet.AbstractHttpSessionModel.readAttributes(AbstractHttpSessionModel.java:1815)
      at com.tangosol.coherence.servlet.AbstractHttpSessionModel.readExternal(AbstractHttpSessionModel.java:1735)
      at com.tangosol.util.ExternalizableHelper.readExternalizableLite(ExternalizableHelper.java:2042)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2346)
      at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2747)
      at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:263)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ConverterFromBinary.convert(PartitionedCache.CDB:4)
      at com.tangosol.util.ConverterCollections$ConverterMap.get(ConverterCollections.java:1656)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.get(PartitionedCache.CDB:1)
      at com.tangosol.coherence.component.util.SafeNamedCache.get(SafeNamedCache.CDB:1)
      at com.tangosol.net.cache.CachingMap.get(CachingMap.java:491)
      at com.tangosol.coherence.servlet.DefaultCacheDelegator.getModel(DefaultCacheDelegator.java:122)
      at com.tangosol.coherence.servlet.AbstractHttpSessionCollection.getModel(AbstractHttpSessionCollection.java:2288)
      at com.tangosol.coherence.servlet.AbstractReapTask.checkAndInvalidate(AbstractReapTask.java:140)
      at com.tangosol.coherence.servlet.ParallelReapTask$ReapWork.run(ParallelReapTask.java:89)
      at com.tangosol.coherence.servlet.commonj.impl.WorkItemImpl.run(WorkItemImpl.java:164)
      ... 3 more
    We tried to restrict the shared session data by implementing a custom SessionDistributionController, but according to the documentation, this feature requires coherence-sticky-sessions optimization to be enabled and this last one requires coherence-session-member-locking to be enabled. This led us to the following error:
    #|SEVERE|oracle-glassfish3.1.2|org.apache.catalina.connector.CoyoteAdapter|_ThreadID=202;_ThreadName=Thread-2;|PWC3989: An exception or error occurred in the container during the request processing
    java.lang.IllegalStateException: attempt to exit session VhSnfqkcwAza when it was not owned
        at com.tangosol.coherence.servlet.AbstractHttpSessionCollection.exit(AbstractHttpSessionCollection.java:799)
        at com.tangosol.coherence.servlet.AbstractHttpSessionCollection.exit(AbstractHttpSessionCollection.java:696)
        at com.tangosol.coherence.servlet.glassfish31.CoherenceWebSessionManager.exit(CoherenceWebSessionManager.java:536)
        at com.tangosol.coherence.servlet.glassfish31.CoherenceWebSession.unlockForeground(CoherenceWebSession.java:451)
        at org.apache.catalina.connector.Request.unlockSession(Request.java:4222)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:342)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
        at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
        at java.lang.Thread.run(Thread.java:722)
    We want to know if we are missing something in our configuration. We are using com.tangosol.coherence.servlet.AbstractHttpSessionCollection$GlobalScopeController. The session-cache-config.xml file has only this item added:
            <replicated-scheme>
                <scheme-name>default-replicated</scheme-name>
                <service-name>ReplicatedCache</service-name>
                <backing-map-scheme>
                    <class-scheme>
                        <scheme-ref>default-backing-map</scheme-ref>
                    </class-scheme>
                </backing-map-scheme>
            </replicated-scheme>
            <class-scheme>
                <scheme-name>default-backing-map</scheme-name>
                <class-name>com.tangosol.util.SafeHashMap</class-name>
            </class-scheme>
    Any help or light would be greatly appreciated. Thanks in advance.

    Depending on the version of WebLogic (which unfortunately I cannot remember off of the top of my head), you don't have to use the installer, because WebLogic has added built-in Coherence*Web support. Have you checked the WebLogic documentation for using Coherence*Web?
    Peace,
    Cameron Purdy | Oracle Coherence
    http://coherence.oracle.com/

  • Values from a java archive file that uses Coherence are null

    This is essentially the details of my project.
    Check the values in andrew's coherence cluster.
    Checkign the values in the stats class.
    z:\javaclasses\stats.jar
    Some sample code:
    -- initialize
    /* start the stats class (the fields you want to look) */
    Stats.init(StatsField._1_DAY_HIGH, StatsField._1_DAY_LOW,
    StatsField.PREV_CLOSE);
    -- pulling data
    if (Stats.get(sSymbol).PREV_CLOSE != null) {
    fValue = Stats.get(sSymbol).PREV_CLOSE;
    -- in your .bat file (Before setting the classpaths)
    call z:\coherence\bin\prod_setup.bat
    set java_opts=%java_opts%
    -Dtangosol.coherence.cacheconfig=z:/coherence/cache-config-extend-client.xml
    myclasspaths
    myclasspaths
    myclasspaths
    My bat file looks like this.
    call z:\coherence\bin\prod_setup.bat
    set java_opts=%java_opts% -Dtangosol.coherence.cacheconfig=z:/coherence/cache-config-extend-client.xml
    cd \
    cd C:\Users\Dan\Documents\Documents_for_4th_Project
    SET PATH=%PATH%;Z:\jdk1.7.0\bin
    SET CLASSPATH=
    SET CLASSPATH=%CLASSPATH%;.
    SET CLASSPATH=%CLASSPATH%;z:\javaclasses\stats.jar
    SET CLASSPATH=%CLASSPATH%;Z:\coherence\lib3702\coherence.jar
    javac ValuesInStats.java
    java ValuesInStats
    pause
    My ValuesInStats.java looks like this below.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    //package ValuesInStats;
    import stats.*;
    import java.io.*;
    * @author Dan
    public class ValuesInStats
    * @param args the command line arguments
    private double dayHigh;
    private double dayLow;
    private double prevClose;
    public void startStatClass()
    Stats.init(StatsField._1_DAY_HIGH, StatsField._1_DAY_LOW, StatsField.PREV_CLOSE);
    public void pullDataFromStatClass()
    if (Stats.get("GOOG")._1_DAY_HIGH != null)
    dayHigh = Stats.get("GOOG")._1_DAY_HIGH;
    if (Stats.get("IBM")._1_DAY_LOW != null)
    dayLow = Stats.get("IBM")._1_DAY_LOW;
    if (Stats.get("SLB").PREV_CLOSE != null)
    prevClose = Stats.get("").PREV_CLOSE;
    public static void main(String[] args)
    ValuesInStats stat = new ValuesInStats();
    stat.startStatClass();
    stat.pullDataFromStatClass();
    try
    PrintWriter inputToFile = new PrintWriter(new BufferedWriter(new FileWriter("C:\\Users\\Dan\\Documents\\Documents_for_4th_Project\\DANS_StatReport.txt")));
    inputToFile.println(stat.dayHigh);
    inputToFile.println(stat.dayLow);
    inputToFile.println(stat.prevClose);
    inputToFile.close();
    catch(Exception e)
    e.getMessage();
    e.printStackTrace();
    The results i'm getting are included below.
    C:\Users\Dan\Documents\Documents_for_4th_Project>call z:\coherence\bin\prod_setup.bat
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM Call this batch file before setting any PATH or CP or JAVA_OPTS.
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM You can override anything you don't like afterwards.
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM
    C:\Users\Dan\Documents\Documents_for_4th_Project>title
    C:\Users\Dan\Documents\Documents_for_4th_Project>set JAVA_HOME=z:\jdk7
    C:\Users\Dan\Documents\Documents_for_4th_Project>set JAVA_EXE=z:\jdk7\bin\java_for_.exe
    C:\Users\Dan\Documents\Documents_for_4th_Project>set PATH=z:\jdk7\bin
    C:\Users\Dan\Documents\Documents_for_4th_Project>for /F "tokens=1,2" %u in ('date /t') do set d=%v
    C:\Users\Dan\Documents\Documents_for_4th_Project>set d=10/11/2011
    C:\Users\Dan\Documents\Documents_for_4th_Project>set timestr=20111011
    C:\Users\Dan\Documents\Documents_for_4th_Project>for /F "tokens=1,2,3 delims=: " %i in ('time /t') do set q=%i%j%k
    C:\Users\Dan\Documents\Documents_for_4th_Project>set q=1052AM
    C:\Users\Dan\Documents\Documents_for_4th_Project>set datetime=20111011_1052AM
    C:\Users\Dan\Documents\Documents_for_4th_Project>echo 20111011_1052AM
    20111011_1052AM
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM token=14 for vista, 15 for XP
    C:\Users\Dan\Documents\Documents_for_4th_Project>for /F "tokens=14,15" %a in ('c:\windows\system32\ipconfig | c:\windows\system32\findstr /R "Address.*XXX.XXX.X."') do (IF "%a" == ":" (set my_ip=%b ) ELSE (set my_ip=%a ) )
    C:\Users\Dan\Documents\Documents_for_4th_Project>(IF "XXX.XXX.X.XXX" == ":" (set my_ip= ) ELSE (set my_ip=XXX.XXX.X.XXX ) )
    IP=XXX.XXX.X.XXX
    C:\Users\Dan\Documents\Documents_for_4th_Project>for /F %i in ('z:\coherence\bin\getpid.exe') do set my_pid=%i
    C:\Users\Dan\Documents\Documents_for_4th_Project>set my_pid=1464
    C:\Users\Dan\Documents\Documents_for_4th_Project>IF /I "" == "OMS" goto OMS
    C:\Users\Dan\Documents\Documents_for_4th_Project>goto DONE
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM ---PROD---
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM ---PROD---
    C:\Users\Dan\Documents\Documents_for_4th_Project>rem ==== COHERENCE ====
    C:\Users\Dan\Documents\Documents_for_4th_Project>rem ==== COHERENCE ====
    C:\Users\Dan\Documents\Documents_for_4th_Project>set java_opts= -Dtangosol.coherence.localhost=XXX.XXX.X.XXX -Dtangosol.coherence.distributed.localstorage=false -Dtangosol.coherence.member=Dan -Xms -Xmx -server -showversion -Djava.
    eferIPv4Stack=true -Dtangosol.coherence.log.level=3 -Dtangosol.coherence.log=z:\oms2\logs\.Dan.XXX.XXX.X.XXX.20111011_1052AM.log -Xloggc:z:\oms2\logs\.Dan.XXX.XXX.X.XXX.20111011_1052AM.gc -Dtangosol.pof.config=z:/coherence/pof-conf
    -Dtangosol.coherence.cacheconfig=z:/coherence/cache-config.xml -Dtangosol.coherence.clusteraddress=255.0.0.1 -Dtangosol.coherence.clusterport=54321 -Dtangosol.coherence.cluster=oms_prod -Dtangosol.coherence.rack= -Dtangosol.cohere
    te=1464 -Dtangosol.coherence.cacheconfig=z:/coherence/cache-config-extend-client.xml
    C:\Users\Dan\Documents\Documents_for_4th_Project>cd \
    C:\>cd C:\Users\Dan\Documents\Documents_for_4th_Project
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET PATH=z:\jdk7\bin;Z:\jdk1.7.0\bin
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET CLASSPATH=
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET CLASSPATH=;.
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET CLASSPATH=;.;z:\javaclasses\stats.jar
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET CLASSPATH=;.;z:\javaclasses\stats.jar;Z:\coherence\lib3702\coherence.jar
    C:\Users\Dan\Documents\Documents_for_4th_Project>javac ValuesInStats.java
    C:\Users\Dan\Documents\Documents_for_4th_Project>java ValuesInStats
    2011-10-11 10:52:21.299/2.277 Oracle Coherence 3.7.0.2 <Info> (thread=main, member=n/a): Loaded operational configuration from "jar:file:/Z:/coherence/lib3702/coherence.jar!/tangosol-coherence.xml"
    2011-10-11 10:52:21.408/2.386 Oracle Coherence 3.7.0.2 <Info> (thread=main, member=n/a): Loaded operational overrides from "jar:file:/Z:/coherence/lib3702/coherence.jar!/tangosol-coherence-override-dev.xml"
    2011-10-11 10:52:21.408/2.386 Oracle Coherence 3.7.0.2 <D5> (thread=main, member=n/a): Optional configuration override "/tangosol-coherence-override.xml" is not specified
    2011-10-11 10:52:21.408/2.386 Oracle Coherence 3.7.0.2 <D5> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
    Oracle Coherence Version 3.7.0.2 Build 25173
    Grid Edition: Development mode
    Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
    2011-10-11 10:52:22.625/3.603 Oracle Coherence GE 3.7.0.2 <Info> (thread=main, member=n/a): Loaded Reporter configuration from "jar:file:/Z:/coherence/lib3702/coherence.jar!/reports/report-group.xml"
    2011-10-11 10:52:22.844/3.822 Oracle Coherence GE 3.7.0.2 <Info> (thread=main, member=n/a): Loaded cache configuration from "jar:file:/Z:/coherence/lib3702/coherence.jar!/coherence-cache-config.xml"
    2011-10-11 10:52:24.029/5.007 Oracle Coherence GE 3.7.0.2 <D4> (thread=main, member=n/a): TCMP bound to /XXX.XXX.X.XXX:8102 using SystemSocketProvider
    2011-10-11 10:52:24.560/5.538 Oracle Coherence GE 3.7.0.2 <Info> (thread=Cluster, member=n/a): This Member(Id=9, Timestamp=2011-10-11 10:52:24.482, Address=XXX.XXX.X.XXX:8102, MachineId=27506, Location=process:5892, Role=ValuesInSt
    uesInStats, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2) joined cluster "cluster:0x96AB" with senior Member(Id=1, Timestamp=2011-10-07 14:15:01.108, Address=XXX.XXX.X.XXX:8088, MachineId=27506, Location=proces
    , Role=CoherenceConsole, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2)
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=2, Timestamp=2011-10-07 14:15:44.572, Address=XXX.XXX.X.XXX:8090, MachineId=27506, Location=process:3904, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=3, Timestamp=2011-10-07 14:21:36.311, Address=XXX.XXX.X.XXX:8092, MachineId=27506, Location=process:628, Role=CoherenceConsole)
    Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=4, Timestamp=2011-10-07 14:21:50.655, Address=XXX.XXX.X.XXX:8094, MachineId=27506, Location=process:4212, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=5, Timestamp=2011-10-07 14:22:18.338, Address=XXX.XXX.X.XXX:8096, MachineId=27506, Location=process:5224, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=6, Timestamp=2011-10-07 14:23:41.229, Address=XXX.XXX.X.XXX:8098, MachineId=27506, Location=process:5608, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=7, Timestamp=2011-10-07 14:24:16.971, Address=XXX.XXX.X.XXX:8100, MachineId=27506, Location=process:5924, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.622/5.600 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.622/5.600 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Management with senior member 1
    2011-10-11 10:52:24.638/5.616 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 2 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.638/5.616 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 2 joined Service Management with senior member 1
    2011-10-11 10:52:24.638/5.616 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 3 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.638/5.616 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 3 joined Service Management with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 7 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 7 joined Service Management with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 4 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 4 joined Service Management with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 5 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 5 joined Service Management with senior member 1
    2011-10-11 10:52:24.669/5.647 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 6 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.669/5.647 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 6 joined Service Management with senior member 1
    2011-10-11 10:52:24.669/5.647 Oracle Coherence GE 3.7.0.2 <Info> (thread=main, member=n/a): Started cluster Name=cluster:0x96AB
    Group{Address=224.3.7.0, Port=37000, TTL=4}
    MasterMemberSet
    ThisMember=Member(Id=9, Timestamp=2011-10-11 10:52:24.482, Address=XXX.XXX.X.XXX:8102, MachineId=27506, Location=process:5892, Role=ValuesInStatsValuesInStats)
    OldestMember=Member(Id=1, Timestamp=2011-10-07 14:15:01.108, Address=XXX.XXX.X.XXX:8088, MachineId=27506, Location=process:1632, Role=CoherenceConsole)
    ActualMemberSet=MemberSet(Size=8, BitSetCount=2
    Member(Id=1, Timestamp=2011-10-07 14:15:01.108, Address=XXX.XXX.X.XXX:8088, MachineId=27506, Location=process:1632, Role=CoherenceConsole)
    Member(Id=2, Timestamp=2011-10-07 14:15:44.572, Address=XXX.XXX.X.XXX:8090, MachineId=27506, Location=process:3904, Role=CoherenceConsole)
    Member(Id=3, Timestamp=2011-10-07 14:21:36.311, Address=XXX.XXX.X.XXX:8092, MachineId=27506, Location=process:628, Role=CoherenceConsole)
    Member(Id=4, Timestamp=2011-10-07 14:21:50.655, Address=XXX.XXX.X.XXX:8094, MachineId=27506, Location=process:4212, Role=CoherenceConsole)
    Member(Id=5, Timestamp=2011-10-07 14:22:18.338, Address=XXX.XXX.X.XXX:8096, MachineId=27506, Location=process:5224, Role=CoherenceConsole)
    Member(Id=6, Timestamp=2011-10-07 14:23:41.229, Address=XXX.XXX.X.XXX:8098, MachineId=27506, Location=process:5608, Role=CoherenceConsole)
    Member(Id=7, Timestamp=2011-10-07 14:24:16.971, Address=XXX.XXX.X.XXX:8100, MachineId=27506, Location=process:5924, Role=CoherenceConsole)
    Member(Id=9, Timestamp=2011-10-11 10:52:24.482, Address=XXX.XXX.X.XXX:8102, MachineId=27506, Location=process:5892, Role=ValuesInStatsValuesInStats)
    RecycleMillis=1200000
    RecycleSet=MemberSet(Size=0, BitSetCount=0
    TcpRing{Connections=[7]}
    IpMonitor{AddressListSize=0}
    2011-10-11 10:52:24.872/5.850 Oracle Coherence GE 3.7.0.2 <D5> (thread=Invocation:Management, member=9): Service Management joined the cluster with senior service member 1
    2011-10-11 10:52:25.871/6.849 Oracle Coherence GE 3.7.0.2 <D5> (thread=DistributedCache, member=9): Service DistributedCache joined the cluster with senior service member 9
    Stats init _1_DAY_HIGH
    Stats init _1_DAY_LOW
    Stats init PREV_CLOSE
    Stats.get() hm has null for GOOG
    Stats.get() hm has null for IBM
    Stats.get() hm has null for SLB
    2011-10-11 10:52:28.605/9.583 Oracle Coherence GE 3.7.0.2 <D4> (thread=ShutdownHook, member=9): ShutdownHook: stopping cluster node
    2011-10-11 10:52:28.620/9.598 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=9): Service Cluster left the cluster
    C:\Users\Dan\Documents\Documents_for_4th_Project>pause
    Press any key to continue . . .
    I'm not sure why I'm getting null values. Let me know if additional information is needed. Thanks!
    P.S. IP Addresses represent XXX.XXX.X.XXX for security purposes.

    Here's the details of the stat class from the stats.jar. Thanks!
    package stats;
    import java.lang.reflect.Field;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Set;
    public class Stats implements com.tangosol.util.MapListener, com.tangosol.net.MemberListener {
    public String SYMBOL;
    public String NAME;
    public String CUSIP;
    public Long POSITION_LIMIT;
    public Float YEAR_HIGH;
    public String NEWS_BUY_RATING;
    public String NEWS_SELL_RATING;
    public String NEWS_NOTES;
    public Long AVG_DAILY_VOLUME;
    public Float MARKET_CAP;
    public Float _1_DAY_GROUP_PERCENT_CHANGE;
    public String PRIMARY_GROUP;
    public String ZACKS_RANK;
    public String FUND_GRADE;
    public String CRAMER_CALL;
    public Float PREV_CLOSE;
    public Float KSLOW;
    public Float DSLOW;
    public Float _90_DAY_HIGH;
    public Float _90_DAY_LOW;
    public Float _90_DAY_PERCENT_OF_RANGE;
    public Float _52_WEEK_HIGH;
    public Float _52_WEEK_LOW;
    public Float _52_WEEK_PERCENT_OF_RANGE;
    public Date NEXT_EARNINGS_DATE;
    public String NEXT_EARNINGS_ANNOUNCEMENT_TIME;
    public Object OPENING_INDICATION;
    public oms.OrderExchange PRIMARY_EXCHANGE;
    public Float _1_DAY_PERCENT_CHANGED;
    public Float _1_DAY_PERCENT_CHANGED_TEST;
    public Float _1_DAY_HIGH;
    public Float _1_DAY_LOW;
    public Long POSTMARKET_VOLUME;
    public Long PREMARKET_VOLUME;
    public Float OPEN_PRICE;
    public Integer POSTMARKET_TRADES;
    public Integer PREMARKET_TRADES;
    public Float POSTMARKET_HIGH;
    public Float POSTMARKET_LOW;
    public Float PREMARKET_HIGH;
    public Float PREMARKET_LOW;
    public Float POSTMARKET_VOLUME_WEIGHTED_AVG_PRICE;
    public Float PREMARKET_VOLUME_WEIGHTED_AVG_PRICE;
    public Float POSTMARKET_AVG_PRICE;
    public Float PREMARKET_AVG_PRICE;
    public Boolean IS_OPEN_ON_NYSE;
    public Boolean IS_HALTED;
    public Integer NEWSWARE_STORY_COUNT;
    public Float _1_DAY_PERCENT_OF_RANGE;
    public Boolean IS_ETF;
    public Integer ROUND_LOT_SIZE;
    public Integer LOCATED_SHARES_AVAILABLE;
    public Boolean IS_OPTIONABLE;
    private static HashMap<String, Stats> hm;
    private static List<com.tangosol.net.NamedCache> subscribedCacheList;
    private static Stats INSTANCE;
    private Set<StatsUpdateListener> updateListenerSet;
    public Stats() {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void memberJoined(com.tangosol.net.MemberEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void memberLeaving(com.tangosol.net.MemberEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void memberLeft(com.tangosol.net.MemberEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public static Stats get(String string) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public static void init(StatsField[] sfs) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    private static Field getField(com.tangosol.util.MapEvent me) throws NoSuchFieldException {
    //compiled code
    throw new RuntimeException("Compiled Code");
    private void notifyUpdateListeners(Field field, Object o) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void addStatsUpdateListener(StatsUpdateListener sl) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void removeStatsUpdateListener(StatsUpdateListener sl) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    private void processInsertOrUpdate(com.tangosol.util.MapEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public synchronized void entryInserted(com.tangosol.util.MapEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public synchronized void entryUpdated(com.tangosol.util.MapEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void entryDeleted(com.tangosol.util.MapEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    }

  • A problem with Lucene In a J2EE project

    Hi everyone:
    I am newer for Lucene which is used to build a search eigneer in my J2EE project.
    But I can hardly understand how it works because of my poor English.
    So I need you help:
    * TxtFileIndexer.java
    * Created on 2006�N12��8��, ����3:46
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package classes.php.lucene;
    * @author eingmarra
    import java.io.File;
    import java.io.FileReader;
    import java.io.Reader;
    import java.util.Date;
    import org.apache.lucene.analysis.Analyzer;
    import org.apache.lucene.analysis.standard.StandardAnalyzer;
    import org.apache.lucene.document.Document;
    import org.apache.lucene.document.Field;
    import org.apache.lucene.index.IndexWriter;
    import org.apache.lucene.index.Term;
    import org.apache.lucene.search.Hits;
    import org.apache.lucene.search.IndexSearcher;
    import org.apache.lucene.search.TermQuery;
    import org.apache.lucene.store.FSDirectory;
    public class TxtFileIndexer {
         public String test() {
              return "test is ok hohoho";
          * @param args
         public String createIndex(String indexDir_path,String dataDir_path) throws Exception {
              String result = "";
              File indexDir = new File(indexDir_path);
              File dataDir = new File(dataDir_path);
              Analyzer luceneAnalyzer = new StandardAnalyzer();
              File[] dataFiles = dataDir.listFiles();
              IndexWriter indexWriter = new IndexWriter(indexDir,luceneAnalyzer,true);
              long startTime = new Date().getTime();
              for(int i=0; i < dataFiles.length; i++) {
                   if(dataFiles.isFile() && dataFiles[i].getName().endsWith(".html")) {
                        result += "Indexing file" + dataFiles[i].getCanonicalPath()+"<br />";
                        Document document = new Document();
                        Reader txtReader = new FileReader(dataFiles[i]);
                        document.add(Field.Text("path",dataFiles[i].getCanonicalPath())); //can not pass the Netbeans IDE, maybe the Field class is not support the signature of the fuction Text anymore!!
                        document.add(Field.Text("contents",txtReader)); //can not pass the Netbeans IDE, maybe the Field class is not support the signature of the fuction Text anymore!!
                        indexWriter.addDocument(document);
              indexWriter.optimize();
              indexWriter.close();
              long endTime = new Date().getTime();
              result += "It takes"+(endTime-startTime)
                        + " milliseconds to create index for the files in directory "
                        + dataDir.getPath();
              return result;
         public String searchword(String ss,String index_path) throws Exception {
         String queryStr = ss;
         String result = "Result:<br />";
         //This is the directory that hosts the Lucene index
    File indexDir = new File(index_path);
    FSDirectory directory = FSDirectory.getDirectory(indexDir,false);
    IndexSearcher searcher = new IndexSearcher(directory);
    if(!indexDir.exists()){
         result = "The Lucene index is not exist";
         return result;
    Term term = new Term("contents",queryStr.toLowerCase());
    TermQuery luceneQuery = new TermQuery(term);
    Hits hits = searcher.search(luceneQuery);
    for(int i = 0; i < hits.length(); i++){
         Document document = hits.doc(i);
         result += "<br /><a href='getfile.php?w="+ss+"&f="+document.get("path")+"'>File: " + document.get("path")+"</a>\n";
    return result;
    the code above is from google and it works perfectly in the Lucene1.4. But it not pass the compiler by Netbeans IDE because I use Lucene2.0
    If you have some idea,plz replace these two lines' code with the correct ones.
    Thanks a lot !!

    Hi everyone:
    I am newer for Lucene which is used to build a search eigneer in my J2EE project.
    But I can hardly understand how it works because of my poor English.
    So I need you help:
    * TxtFileIndexer.java
    * Created on 2006�N12��8��, ����3:46
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package classes.php.lucene;
    * @author eingmarra
    import java.io.File;
    import java.io.FileReader;
    import java.io.Reader;
    import java.util.Date;
    import org.apache.lucene.analysis.Analyzer;
    import org.apache.lucene.analysis.standard.StandardAnalyzer;
    import org.apache.lucene.document.Document;
    import org.apache.lucene.document.Field;
    import org.apache.lucene.index.IndexWriter;
    import org.apache.lucene.index.Term;
    import org.apache.lucene.search.Hits;
    import org.apache.lucene.search.IndexSearcher;
    import org.apache.lucene.search.TermQuery;
    import org.apache.lucene.store.FSDirectory;
    public class TxtFileIndexer {
         public String test() {
              return "test is ok hohoho";
          * @param args
         public String createIndex(String indexDir_path,String dataDir_path) throws Exception {
              String result = "";
              File indexDir = new File(indexDir_path);
              File dataDir = new File(dataDir_path);
              Analyzer luceneAnalyzer = new StandardAnalyzer();
              File[] dataFiles = dataDir.listFiles();
              IndexWriter indexWriter = new IndexWriter(indexDir,luceneAnalyzer,true);
              long startTime = new Date().getTime();
              for(int i=0; i < dataFiles.length; i++) {
                   if(dataFiles.isFile() && dataFiles[i].getName().endsWith(".html")) {
                        result += "Indexing file" + dataFiles[i].getCanonicalPath()+"<br />";
                        Document document = new Document();
                        Reader txtReader = new FileReader(dataFiles[i]);
                        document.add(Field.Text("path",dataFiles[i].getCanonicalPath())); //can not pass the Netbeans IDE, maybe the Field class is not support the signature of the fuction Text anymore!!
                        document.add(Field.Text("contents",txtReader)); //can not pass the Netbeans IDE, maybe the Field class is not support the signature of the fuction Text anymore!!
                        indexWriter.addDocument(document);
              indexWriter.optimize();
              indexWriter.close();
              long endTime = new Date().getTime();
              result += "It takes"+(endTime-startTime)
                        + " milliseconds to create index for the files in directory "
                        + dataDir.getPath();
              return result;
         public String searchword(String ss,String index_path) throws Exception {
         String queryStr = ss;
         String result = "Result:<br />";
         //This is the directory that hosts the Lucene index
    File indexDir = new File(index_path);
    FSDirectory directory = FSDirectory.getDirectory(indexDir,false);
    IndexSearcher searcher = new IndexSearcher(directory);
    if(!indexDir.exists()){
         result = "The Lucene index is not exist";
         return result;
    Term term = new Term("contents",queryStr.toLowerCase());
    TermQuery luceneQuery = new TermQuery(term);
    Hits hits = searcher.search(luceneQuery);
    for(int i = 0; i < hits.length(); i++){
         Document document = hits.doc(i);
         result += "<br /><a href='getfile.php?w="+ss+"&f="+document.get("path")+"'>File: " + document.get("path")+"</a>\n";
    return result;
    the code above is from google and it works perfectly in the Lucene1.4. But it not pass the compiler by Netbeans IDE because I use Lucene2.0
    If you have some idea,plz replace these two lines' code with the correct ones.
    Thanks a lot !!

  • How open and edit the coherence.xml file?

    How can I open and edit the coherence.xml file?
    I cannot find the coherence.xml file in the coherence.jar package.
    Thank you,
    June

    If you are intent on changing the coherence.xml file, then you could use the JAR command (that comes with Java) to extract the coherence.xml file from coherence.jar and the later repackage the coherence.jar file using the udpated coherence.xml file, e.g.:
    C:\java\opt\coherence-331\lib>jar -xvf coherence.jar tangosol-coherence.xmlextracted: tangosol-coherence.xml>
    Instead of using JAR, on Windows you can associate the .JAR, .WAR and .EAR extensions with WinZip and use it to access / modify the contents of JAR files.
    However, the suggested approach is as follows, and does not include any changes to the tangosol.jar file:
    The tangosol-coherence-override-dev.xml file can be found in the coherence.jar file. After editing this file (in this case to define a unique value for the port system-property value for the multicast listener), save the file and add it to the server's classpath. When the server is executed, the values in the tangosol-coherence-override-dev.xml file will override any corresponding settings in the tangosol-coherence.xml file.Peace,
    Cameron Purdy | Oracle Coherence

  • Not able to start Coherence Server on Unix environment

    Hi,
    I am trying to configure Coherence-Web on Weblogic server on Unix. But when i try to start the server getting the below error.
    I am tried with Coherence 3.7.1 but say Bad class version so then tried with Coherence 3.6.1
    And i used the below commond to run the server.
    java -Xms128m -Xmx128m -Dcom.sun.management.jmxremote -Dtangosol.coherence.management=all -Dtangosol.coherence.management.remote=true -cp "$COHERENCE_HOME/lib/coherence.jar:$COHERENCE_HOME/lib/coherence-web-spi.war" -Dtangosol.coherence.cacheconfig=session-cache-config.xml com.tangosol.net.DefaultCacheServer
    2013-03-22 13:08:23.245/4.372 Oracle Coherence GE 3.6.1.0 <Info> (thread=main, member=n/a): Loaded Reporter configuration from "jar:file:$COHERENCE_HOME/lib/coherence.jar!/reports/report-group.xml"
    Exception in thread "main" (Wrapped: Failed to load the factory) java.lang.reflect.InvocationTargetException
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
    at com.tangosol.net.DefaultCacheFactoryBuilder.getDefaultFactory(DefaultCacheFactoryBuilder.java:419)
    at com.tangosol.net.DefaultCacheFactoryBuilder.getSingletonFactory(DefaultCacheFactoryBuilder.java:113)
    at com.tangosol.net.DefaultCacheFactoryBuilder.getFactory(DefaultCacheFactoryBuilder.java:173)
    at com.tangosol.net.DefaultCacheFactoryBuilder.getConfigurableCacheFactory(DefaultCacheFactoryBuilder.java:149)
    at com.tangosol.net.CacheFactory.getConfigurableCacheFactory(CacheFactory.java:657)
    at com.tangosol.net.DefaultCacheServer.getDefaultConfigurableCacheFactory(DefaultCacheServer.java:364)
    at com.tangosol.net.DefaultCacheServer.main(DefaultCacheServer.java:197)
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
    at com.tangosol.util.ClassHelper.newInstance(ClassHelper.java:662)
    at com.tangosol.net.DefaultCacheFactoryBuilder.getDefaultFactory(DefaultCacheFactoryBuilder.java:381)
    ... 6 more
    Caused by: (Wrapped: Failed to load cache configuration: session-cache-config.xml) java.io.IOException: The cache configuration is missing: "session-cache-config.xml", loader=null
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
    at com.tangosol.run.xml.XmlHelper.loadResourceInternal(XmlHelper.java:330)
    at com.tangosol.run.xml.XmlHelper.loadFileOrResource(XmlHelper.java:281)
    at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfig(DefaultConfigurableCacheFactory.java:396)
    at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfig(DefaultConfigurableCacheFactory.java:382)
    at com.tangosol.net.DefaultConfigurableCacheFactory.<init>(DefaultConfigurableCacheFactory.java:148)
    ... 12 more
    Caused by: java.io.IOException: The cache configuration is missing: "session-cache-config.xml", loader=null
    at com.tangosol.run.xml.XmlHelper.loadResourceInternal(XmlHelper.java:316)
    ... 16 more
    I really appreciated the support.

    Hi
    This part of the stack trace...
    Caused by: (Wrapped: Failed to load cache configuration: session-cache-config.xml) java.io.IOException: The cache configuration is missing: "session-cache-config.xml"...would suggest that the file session-cache-config.xml is not on the classpath of your application.
    JK

  • Coherence::net::messaging::ConnectionException: could not establish a connection to one of the following addresses: {10.242.152.242/10.242.152.242:8088}; make sure the "remote-addresses" configuration element contains an address and port of a running TcpA

    Hi
    I have installed coheI have installed coherence server "fmw_12.1.3.0.0_coherence_Disk1_1of1.zip" along with Examples on windows machine and C++ client coherence-cpp-12.1.3.0.0b51709-windows-x86-vs2012.zip on the same machine.
    I have built the "contacts" C++ Example successfully and while I execute this "contacts" using run I am facing TcpAcceptor error.
    On my coherence server the TcpAcceptor is listening on port 8088, so I have modified the extend-cache-config.xml file with values "ip address of my windows machine" and port as "8088".
    All the time I am getting below error,
    coherence::net::messaging::ConnectionException: could not establish a connection to one of the following addresses: {10.242.152.242/10.242.152.242:8088}; make sure the "remote-addresses" configuration element contains an address and port of a running TcpAcceptor
        at class coherence::lang::TypedHandle<class coherence::component::net::extend::PofConnection> __thiscall coherence::component::util::TcpInitiator::openConne
    ction(void)(TcpInitiator.cpp:307)
        at coherence::component::util::TcpInitiator::openConnection
        at coherence::component::util::Initiator::ensureConnection
        at coherence::component::net::extend::RemoteCacheService::openChannel
        at coherence::component::net::extend::RemoteService::doStart
        at coherence::component::net::extend::RemoteService::start
        at coherence::component::util::SafeService::startService
        at coherence::component::util::SafeService::restartService
        at coherence::component::util::SafeService::ensureRunningServiceInternal
        at coherence::component::util::SafeService::start
        at coherence::net::DefaultConfigurableCacheFactory::configureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureRemoteCache
        at coherence::net::DefaultConfigurableCacheFactory::configureCache
        at coherence::net::DefaultConfigurableCacheFactory::ensureCache
        at coherence::net::CacheFactory::getCache
        at unsigned __int64 coherence::lang::class_spec<class coherence::lang::Managed<class ContactId>,class coherence::lang::extends<class coherence::lang::Object,class coherence::lang::Void<class coherence::lang::Object> >,class coherence::lang::implements<void,void,void,void,void,void,void,void,void,void,void,void,void,void,void,void> >::sizeOf(bool)
        at _onexit
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at BaseThreadInitThunk
        at RtlInitializeExceptionChain
        at RtlInitializeExceptionChain
        on thread "main"
    Caused by: coherence::net::messaging::ConnectionException: coherence::component::util::TcpInitiator::TcpConnection@029EAD78{Id=NULL, Open=1, LocalAddress=NULL,
    RemoteAddress=10.242.152.242/10.242.152.242:8088}: socket disconnect
        at class coherence::lang::TypedHandle<class coherence::net::messaging::Response> __thiscall coherence::component::net::extend::AbstractPofRequest::Status::g
    etResponse(void)(AbstractPofRequest.cpp:203)
        at coherence::component::net::extend::AbstractPofRequest::Status::getResponse
        at coherence::component::net::extend::AbstractPofRequest::Status::waitForResponse
        at coherence::component::util::Initiator::openConnection
        at coherence::component::net::extend::PofConnection::open
        at coherence::component::util::TcpInitiator::openConnection
        at coherence::component::util::Initiator::ensureConnection
        at coherence::component::net::extend::RemoteCacheService::openChannel
        at coherence::component::net::extend::RemoteService::doStart
        at coherence::component::net::extend::RemoteService::start
        at coherence::component::util::SafeService::startService
        at coherence::component::util::SafeService::restartService
        at coherence::component::util::SafeService::ensureRunningServiceInternal
        at coherence::component::util::SafeService::start
        at coherence::net::DefaultConfigurableCacheFactory::configureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureRemoteCache
        at coherence::net::DefaultConfigurableCacheFactory::configureCache
        at coherence::net::DefaultConfigurableCacheFactory::ensureCache
        at coherence::net::CacheFactory::getCache
        at unsigned __int64 coherence::lang::class_spec<class coherence::lang::Managed<class ContactId>,class coherence::lang::extends<class coherence::lang::Object
    ,class coherence::lang::Void<class coherence::lang::Object> >,class coherence::lang::implements<void,void,void,void,void,void,void,void,void,void,void,void,void
    ,void,void,void> >::sizeOf(bool)
        at _onexit
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at BaseThreadInitThunk
        at RtlInitializeExceptionChain
        at RtlInitializeExceptionChain
        on thread "main"
    Caused by: coherence::io::IOException: socket disconnect
        at unsigned int __thiscall coherence::net::Socket::readInternal(unsigned char *,unsigned int)(Socket.cpp:333)
        at coherence::net::Socket::readInternal
        at coherence::net::Socket::SocketInput::read
        at coherence::io::BufferedInputStream::fillBuffer
        at coherence::io::BufferedInputStream::read
        at coherence::component::util::TcpInitiator::readMessageLength
        at coherence::component::util::TcpInitiator::TcpConnection::TcpReader::onNotify
        at coherence::component::util::Daemon::run
        at coherence::lang::Thread::run
        on thread "ExtendTcpCacheService:coherence::component::util::TcpInitiator:coherence::component::util::TcpInitiator::TcpConnection::TcpReader"

    We are facing same issue.    Could you please provide us any working .Net sample code for the version 12.1.2.0.
    <ssl>
                  <protocol>Tls</protocol>
                  <local-certificates>
                    <certificate>
                      <url>c:\Cert\</url>
                      <password>password</password>
                      <flags>DefaultKeySet</flags>
                    </certificate>
                  </local-certificates>
                </ssl>
    thanks
    Bala

  • Can you cluster Coherence over data centers?

    We're currently running two separate Coherence clusters in different data centers. One is prod, the other DR.
    Would it be possible to cluster the nodes from each of these to create one cluster spanning both data centers? Then in a failover scenario the data would already be available.
    I know Coherence nodes heartbeat to one another to retain cluster membership and that there is a TTL setting to determine packet life. Would have nodes in different data centers result in heartbeats being missed or TTLs killing packets?
    Has anyone had any success with this?

    Coherence performance is related to the latency between nodes. Having one cluster spread over 2 data centers could harm performance (some timeouts could have to be changed to prevent nodes from data center A to claim another node in datacenter B is out of reach/possibly dead).
    When you lose network connectivity between the 2 data centers (note i'm not saying "if you lose connectivity". It WILL happen), you're welcome into the "split brain world", each half of the grid believing the other is dead and claiming to be the "master". And thus, if you have data replicated on N nodes, the master/backups are redispatched all over each datacenter, harming performance for a few minutes (the timing depending of course on many parameters...). And of course the data will no longer be synchronized between the 2 data centers. The quorum has to be thought of, and stuff like that...
    I might be wrong, but AFAIK I'd rather have 2 separate clusters. I believe 12.1 has new features to replicate data the the master grid to the DR one, I have not been through all the new documentation.

  • Multiple iCloud accounts / iOS 8 iPhone cellular / Coherence

    Hello,
    My partner and I share a photo library, a music library, and a keychain. In iOS 7, we would just sign into the same iCloud account, and then for FaceTime and iMessage sign into a different account, each respective account associated with our own iPhone mobile number.
    It seems this strategy doesn't work in iOS 8 -- to use iPhone cellular or Coherence, you have to be signed into the same account.
    Associating the accounts mentioned above under a family account doesn't help.
    If each of us signs into our own iCloud account, we will have different Photo Streams which for now means our pictures can't both end up in the same iPhoto library, and, down the line, we will need iCloud Photo Libraries (probably 500 gigs worth), with no good way to sync them across accounts. We would also lose shared keychain. We could keep the same music library because of the family account.
    Is there any way to work around this? Ideally, we would sign into our own iCloud accounts but for Drive, Photo Stream/Photo Library, and Keychain, be able to connect that feature with another library. Or at least have a way to share the whole library between accounts, not just the single Family Album.
    Thanks!

    EDIT:  It seems this strategy doesn't work in iOS 8 -- to use iPhone cellular or Coherence, you have to be signed into the same account in FaceTime as the main iCloud account.

  • How to prevent multiple users from updating the same data in coherence

    Hi,
    I have a Java Web Application and for data cache am using coherence 3.5. The same data maybe shared by multiple users which maybe in hundreds. Now how do I prevent multiple users from updating the same data in coherence i.e. is there something in coherence that will only allow one user a time to update. If one user is in a process of updating a data in coherence and some other user also tries to update then the second user should get an error.
    Thanks

    I have a question on the same line. How can I restrict someone from updating a cache value when I a process is already working on it. I tried locking the cache key but it does not stop other process to update it , it only does not allow other process to get lock on it.

  • Prevent multiple users from updating coherence cache data at the same time

    Hi,
    I have a web application which have a huge amount of data instead of storing the data in Http Session are storing it in coherence. Now multiple groups of users can use or update the same data in coherence. There are 100's of groups with several thousand users in each group. How do I prevent multiple users from updating the cache data. Here is the scenario. User logs-in checks in coherence if the data there and gets it from coherence and displays it on the ui if not get it from backend i.e. mainframe systems and store it in coherence before displaying it on the screen. Now some other user at the same time can also perform the same function and if don't find the data in coherence can get it from backend and start saving it in coherence while the other user is also in the process of saving or updating. How do I prevent this in coherence. As have to use the same key when storing in coherence because the same data is shared across users and don't want to keep multiple copies of the same data. Is there something coherence provides out-of-the-box or what is best approach to handle this scenario.
    Thanks

    Hi,
    actually I believe, that if we are speaking about multiple users each with its own HttpSession, in case of two users accessing the same session attribute in their own session, the actually used cache keys will not be the same.
    On the other hand, this is probably not what you would really like, you would possibly like to share that data among sessions.
    You should probably consider using either read-through caching with the CacheLoader implementor doing the expensive data retrieval (if the data to be cached can be obtained outside of an HTTP container), or side caching with using Coherence locks or entry-processors for concurrency control on the data retrieval operations for the same key (take care of retries in this case).
    Best regards,
    Robert

  • Specifying coherence-cache-config.xml for multiple clusters

    Hi,
    I am running two cache clusters (Cluster A and B that hold different cache types). we have a web application that needs to communicate with both the clusters. we have two coherence-cache-config-g.xml files, one for each cluster.
    where do we specify the two coherence-cache-config.xml for each of these clusters in our coherence.jar that we deploy on the web app server.
    pls provide some inputs...
    thanks in advance,
    - G.

    Hi G,
    You can define a path to the cache configuration descriptor in your operation configuration override file (tangosol-coherence=override.xml) or specify it in the system property "tangosol.coherence.cacheconfig".
    Please see this Wiki page for details:
    http://wiki.tangosol.com/display/COH32UG/configurable-cache-factory-config
    Regards,
    Gene

Maybe you are looking for

  • How can I delete photos in the "Edited" album in the iPhoto app on my iPad??

    How can I delete photos in the "Edited" folder in the iPhoto App on my iPad?

  • Implement get_file_name for web forms: SOME HELP PLS

    Hi ppl, Anyone used the code in note 74140.1 as regards to the implementation of get_file_name for webforms? Because I got stuck. Till now I managed to complie the FDialog and FDialogPJC java source and the classes are stored in the /oracle_home/form

  • JPanel help

    hey, I'm making a calculator program with a function graphing part using JFrame and JPanel. But these two have been causing problems because when I run the GraphMain class, only a portion of the graph shows up. I have tested the Main and Graph classe

  • I can't install any apps! help?

    i am not able to install any FREE trials on my creative cloud app when i press "download" this appears... There is no application set to open the URL aam://SAPCode=PHSP?productVersion=15.0?passPhrase=WrQygkNF/oD1afbrBWp3Q4+71rdJ7KQaHyKvCNX Rmk4WqOyUF

  • Help! Rec'd error trying to access itunes store...

    I rec'd the following error and need help on resolving- when I clicked on itunes store, the following error appeared: external protocol request An external application must be launched to handle itms: links itms://ax.phobos.apple.edgesuite.net/webobj