Well, in this case, you were attempting to resolve a "resource" (i.e. sprinc-context.xml) not a class, hence the FileNotFoundException.
In most cases, entries on the classpath must be absolute. The exception maybe if the path is relative to the JVM process's (in this case, the GemFire Server's) working directory. For instance if you had specified... gfsh>start server --name=Test *--dir=/path/to/server/working/directory* ... *--classpath=target/classes.jar* Then... /path/to/server/working/directory/Test.log /path/to/server/working/directory/*target/classes.jar* This *may* have worked, although, I suspect this does not either. Note, the /path/to/server/working/directory is the location that the GemFire Server JVM process will be ran from, see ProcessBuilder.directory(:File) <http://docs.oracle.com/javase/8/docs/api/java/lang/ProcessBuilder.html#directory-java.io.File-> [0]. -John [0] - http://docs.oracle.com/javase/8/docs/api/java/lang/ProcessBuilder.html#directory-java.io.File- On Tue, Dec 29, 2015 at 1:25 PM, Nikhil Chandrappa <[email protected]> wrote: > I was not aware that classpath entries should have absolute path and it's > good to know. > > However most of my local sandbox configurations used to have relative path > for --classpath entries and I believe those jars were being picked up, in > the sense I should have run into classnotfound exceptions right. Just > making an observation. > > Thanks, > Nikhil > > On Tue, Dec 29, 2015 at 4:07 PM, John Blum <[email protected]> wrote: > >> Nikhil- >> >> A few more observations here... >> >> 1. You should either encapsulate your entire configuration in Spring or >> using GemFire's native cache.xml, but NOT both.... >> >> --properties-file=config/gemfire.properties *--cache-**xml-file=config/* >> *serverCache.xml* >> *--spring-xml-location=spring/context/spring-context.xml* --initial-heap=100m >> --max-heap=100m >> >> I believe in this case, your serverCache.xml file will be ignored! >> >> 2. As you seem to already be aware, all path-based options in *Gfsh* >> (e.g. --properties-file, --cache-xml-file, etc) are relative to *Gfsh's* >> working directory. However, this does not apply to the --classpath >> option; all classpath entries must be absolute. >> >> Thanks, >> -John >> >> >> >> On Mon, Dec 28, 2015 at 4:40 PM, John Blum <[email protected]> wrote: >> >>> Note, the gfsh>start server --name=Test ... *--spring-xml-location* >>> =<classpath-to-spring-xml-config> option accepts a CLASSPATH location >>> be default, which means that the Spring XML config file (e.g. >>> spring-context.xml) must be contained in the CLASSPATH of the GemFire >>> Server being started for it to be found. As Kirk mentioned, your JAR file >>> path (*../target/*Gemfire-JMS-Integration-0.0.1-SNAPSHOT.jar) was >>> incorrect (needs to be absolute). >>> >>> You can, of course, use other Spring Resource location "specifiers" to >>> locate your Spring XML configuration file, as allowed by Spring >>> <http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#resources-resourceloader> >>> (see >>> Table 7.1 - Resource strings). >>> >>> -John >>> >>> >>> On Mon, Dec 28, 2015 at 4:10 PM, Nikhil Chandrappa < >>> [email protected]> wrote: >>> >>>> Ahhh, yes absolute path to the jar fixed it. >>>> >>>> Thanks >>>> >>>> On Mon, Dec 28, 2015 at 7:02 PM, Kirk Lund <[email protected]> wrote: >>>> >>>>> The classpath in server1.log lists absolute paths for everything >>>>> except Gemfire-JMS-Integration-0.0.1-SNAPSHOT.jar. You might want to try >>>>> using an absolute path instead of a relative path. >>>>> >>>>> Other than that, your start server command looks like what I see in >>>>> one of the geode tests. >>>>> >>>>> -Kirk >>>>> >>>>> >>>>> On Mon, Dec 28, 2015 at 3:40 PM, Nikhil Chandrappa < >>>>> [email protected]> wrote: >>>>> >>>>>> Hi All, >>>>>> >>>>>> I am trying to start a cache server from gfsh with spring context >>>>>> configuration file and I receive a exception saying, >>>>>> >>>>>> java.io.FileNotFoundException: class path resource >>>>>> [spring/context/spring-context.xml] cannot be opened because it does not >>>>>> exist >>>>>> >>>>>> Following is Start Server command >>>>>> >>>>>> start server --name=server1 --server-port=0 --classpath=../target/ >>>>>> *Gemfire-JMS-Integration-0.0.1-SNAPSHOT.jar*:/Users/nchandrappa >>>>>> /Documents/workspace/Gemfire-JMS-Integration/grid/lib/* >>>>>> --properties-file=config/gemfire.properties >>>>>> --cache-xml-file=config/serverCache.xml >>>>>> *--spring-xml-location=spring/context/spring-context.xml* >>>>>> --initial-heap=100m --max-heap=100m >>>>>> >>>>>> *Jar Structure* >>>>>> >>>>>> Gemfire-JMS-Integration >>>>>> >>>>>> src >>>>>> >>>>>> main >>>>>> >>>>>> - java >>>>>> >>>>>> - resources >>>>>> >>>>>> spring >>>>>> >>>>>> context >>>>>> >>>>>> spring-context.xml >>>>>> >>>>>> >>>>>> *serverCache.xml* >>>>>> >>>>>> <cache> >>>>>> >>>>>> <pdx read-serialized="true" persistent="false"/> >>>>>> >>>>>> <initializer> >>>>>> >>>>>> <class-name> >>>>>> org.springframework.data.gemfire.support.SpringContextBootstrappingInitializer >>>>>> </class-name> >>>>>> >>>>>> <parameter name="basePackages"> >>>>>> >>>>>> <string>io.pivotal.gemfire.core,io.pivotal.jms.core</string> >>>>>> >>>>>> </parameter> >>>>>> >>>>>> </initializer> >>>>>> >>>>>> </cache> >>>>>> >>>>>> >>>>>> *gemfire.properties* >>>>>> >>>>>> mcast-port=0 >>>>>> >>>>>> locators=localhost[10334] >>>>>> >>>>>> log-level=config >>>>>> >>>>>> >>>>>> please let me know, if I have missed any configurations in start >>>>>> server command that I've mentioned above. >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Nikhil >>>>>> -- >>>>>> >>>>>> *Nikhil Chandrappa *| Data Engineer | New York >>>>>> >>>>>> (315) 396 - 3789 | [email protected] | Pivotal Software Inc. >>>>>> <http://www.pivotal.io/> >>>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> >>>> *Nikhil Chandrappa *| Data Engineer | New York >>>> >>>> (315) 396 - 3789 | [email protected] | Pivotal Software Inc. >>>> <http://www.pivotal.io/> >>>> >>> >>> >>> >>> -- >>> -John >>> 503-504-8657 >>> john.blum10101 (skype) >>> >> >> >> >> -- >> -John >> 503-504-8657 >> john.blum10101 (skype) >> > > > > -- > > *Nikhil Chandrappa *| Data Engineer | New York > > (315) 396 - 3789 | [email protected] | Pivotal Software Inc. > <http://www.pivotal.io/> > -- -John 503-504-8657 john.blum10101 (skype)
