It turns out that I was using the wrong scope on my jsf managed bean. Switching 
from @SessionScoped to @ViewScoped apparently solved the problem. Thank you so 
much for the assistance 

Kind regards

Andreas 


> Den 16/10/2014 kl. 18.23 skrev Jody Garnett <jody.garn...@gmail.com>:
> 
> It is possible that you had an assembly step that combined several jars. If 
> you do take that route you need ensure that the META-INF/services files are 
> combined in the final product.
> 
> * http://docs.geotools.org/stable/userguide/welcome/integration.html
> * 
> http://docs.geotools.org/stable/userguide/faq.html#how-do-i-create-an-executable-jar-for-my-geotools-app
> 
> Jody Garnett
> 
>> On Thu, Oct 16, 2014 at 1:01 AM, Andreas Mogensen <ad.mogen...@gmail.com> 
>> wrote:
>> Indeed it does work. I have no idea why I've been getting this nullpointer. 
>> Perhaps my IDE (Netbeans) didn't deploy the app correctly on the server 
>> (Glassfish 4.0). Sorry for the inconvenience.
>> 
>> 
>>> Den 16/10/2014 kl. 07.36 skrev Jody Garnett <jody.garn...@gmail.com>:
>>> 
>> 
>>> That is the correct way, any idea why it would return null for you?
>>> 
>>> You can step through the code with a debugger, FileDataStoreFinder calls 
>>> the methods on a data store factory - so if you need to you can call those 
>>> methods yourself to figure out what is odd about your environment.
>>> 
>>> You may need to check your app server sandboxing to ensure your EE 
>>> application has permission to see the file system.
>>> 
>>> Jody Garnett
>>> 
>>>> On Wed, Oct 15, 2014 at 5:11 AM, Andreas Mogensen <ad.mogen...@gmail.com> 
>>>> wrote:
>>>> Hi Everyone,
>>>> 
>>>> I'm trying to create a FileDataStore-object in a managed bean in a 
>>>> JSF-application via the following expression:
>>>> 
>>>> FileDataStore store = FileDataStoreFinder.getDataStore(file);
>>>> 
>>>> However I the FileDataStoreFinder.getDataStore(file) returns null instead 
>>>> a ShapefileFeatureStore.
>>>> 
>>>> What is the correct way to instantiate the FileDataStore-object in a 
>>>> container managed application i.e. a J2EE/JSF application?
>>>> 
>>>> 
>>>> Thanks
>>>> 
>>>> Andreas
>>>> 
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Comprehensive Server Monitoring with Site24x7.
>>>> Monitor 10 servers for $9/Month.
>>>> Get alerted through email, SMS, voice calls or mobile push notifications.
>>>> Take corrective actions from your mobile device.
>>>> http://p.sf.net/sfu/Zoho
>>>> _______________________________________________
>>>> GeoTools-GT2-Users mailing list
>>>> GeoTools-GT2-Users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> 
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to