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)

Reply via email to