classpath:shiro.ini indicates a shiro.ini file at the root of the classpath - i.e. at the top of a .jar file and not in a directory. If this doesn't work, perhaps it's a JavaFX classloader issue? Is there anything special about JavaFX classloading? I'm not sure - I haven't tried this in JavaFX myself.
-- Les Hazlewood | @lhazlewood CTO, Stormpath | http://stormpath.com | @goStormpath | 888.391.5282 On Sat, Dec 6, 2014 at 12:27 AM, Konrad Zuse <[email protected]> wrote: > Thanks for the help. > > I tried placing it in the default (which I'm assuming is the root?) and > nothing, I will try this conf/ business. I have it in another package, so > I will try to see if the / will work. I tried to do > classpath:conf.shiro.ini as that's what we normally do when referencing a > package/class. > > You mention folders though, so I don't know if I should be working in the > file view and not the project view, but I believe it doesn't matter... > right? > > > Thanks again for the help, will try this out tomorrow when I'm more awake > , and will email back the results :). > > > Date: Fri, 5 Dec 2014 21:24:11 -0700 > > From: [email protected] > > To: [email protected] > > Subject: Re: Creating securitymanager from ini, cannot read file in > classpath? > > > > > (Note that I'm not a Shiro developer, but here's my stab at answering the > > question as a fellow Java developer) > > > > Technically, you could put the shiro.ini file anywhere you want in your > > project. But /where/ you put it will affect how you reference it in your > > code. > > > > If your JavaFX application is a Maven based project, I would place the > > config file in src/main/resources. By putting it there, Maven would place > > the file at the root of the JAR/WAR it generates, which would then allow > you > > to write the code as you originally have it: > > > > Factory<SecurityManager> factory = new > > IniSecurityManagerFactory("classpath:shiro.ini"); > > > > If it isn't a Maven application, then you could still place it at the > root > > of your project's source tree. Or you could create a conf/ folder or > > somthing, and place it in there. Then the line above might look like > this: > > > > Factory<SecurityManager> factory = new > > IniSecurityManagerFactory("classpath:conf/shiro.ini"); > > > > > > > > > > > > -- > > View this message in context: > http://shiro-user.582556.n2.nabble.com/Creating-securitymanager-from-ini-cannot-read-file-in-classpath-tp7580331p7580353.html > > Sent from the Shiro User mailing list archive at Nabble.com. >
