I use Netbeans IDE, I've never had an issue with anything to my knowledge.

I tried some piece of code that was supposed to show me my classpath.

It was something like System.getProperties(some parameter to classpath);' and 
it printed out probably 20 different links.  One of which was 
workingclass/build/classes so I assume that is correct?


Also do I do classpath:packagename.classname? or classpath:classname?  Should 
it be kept in a normal package or...?




I also have the web app portion where I had to access a file in my package via 
the LocalHost so I'm assuming that is also my classspath, right?

Thanks for the help, I don't know why it's giving me issues....
From: [email protected]
Subject: Re: issue setting shiro.ini with classpath variable in regular Java 
application
Date: Mon, 10 Nov 2014 08:51:52 -0500
To: [email protected]

Are you sure you build tool is setting up your class path correctly?

-Brian
On Nov 8, 2014, at 4:32 PM, Konrad Zuse <[email protected]> wrote:




Hello all,

>From this link http://shiro.apache.org/configuration.html



Creating a SecurityManager from INIHere are two examples of how to build a 
SecurityManager based on INI configuration.SecurityManager from an INI 
resourceWe can create the SecurityManager instance from an INI resource path. 
Resources can be acquired from the file system, classpath, or URLs when 
prefixed with file:, classpath:, or url: respectively. This example uses a 
Factory to ingest a shiro.ini file from the root of the classpath and return 
the SecurityManager instance:import org.apache.shiro.SecurityUtils;
import org.apache.shiro.util.Factory;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.config.IniSecurityManagerFactory;

...

Factory<SecurityManager> factory = new 
IniSecurityManagerFactory("classpath:shiro.ini");
SecurityManager securityManager = factory.getInstance();
SecurityUtils.setSecurityManager(securityManager);When I try to set it like 
this I get this error

Exception in Application constructorjava.lang.reflect.InvocationTargetException 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)   
     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)     at 
com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:367)
     at 
com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:305)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)   
     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)     at 
sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)Caused by: 
java.lang.RuntimeException: Unable to construct Application instance: class 
uploader.Uploader   at 
com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:884)
    at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:56) 
    at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:158) at 
java.lang.Thread.run(Thread.java:744)Caused by: 
java.lang.reflect.InvocationTargetException  at 
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
 at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:408)      at 
com.sun.javafx.application.LauncherImpl$7.run(LauncherImpl.java:791) at 
com.sun.javafx.application.PlatformImpl$7.run(PlatformImpl.java:335) at 
com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:301)       at 
com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:298)       at 
java.security.AccessController.doPrivileged(Native Method)   at 
com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:298) at 
com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
     at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)  at 
com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)       at 
com.sun.glass.ui.win.WinApplication$4$1.run(WinApplication.java:112) ... 1 
moreCaused by: org.apache.shiro.config.ConfigurationException: 
java.io.IOException: Resource [classpath:shiro.ini] could not be found.    at 
org.apache.shiro.config.Ini.loadFromPath(Ini.java:242)       at 
org.apache.shiro.config.Ini.fromResourcePath(Ini.java:225)   at 
org.apache.shiro.config.IniSecurityManagerFactory.<init>(IniSecurityManagerFactory.java:69)
  at uploader.Uploader.<init>(Uploader.java:44)   ... 15 moreCaused by: 
java.io.IOException: Resource [classpath:shiro.ini] could not be found.   at 
org.apache.shiro.io.ResourceUtils.getInputStreamForPath(ResourceUtils.java:139) 
     at org.apache.shiro.config.Ini.loadFromPath(Ini.java:240)       ... 18 
moreException running application uploader.UploaderJava Result: 1BUILD 
SUCCESSFUL (total time: 4 seconds)

I have tried to do classpath:pkgname.shiro.ini,

I have tried moving shiro.ini to the default package,

and I have tried creating a WEB-INF folder as well with no luck (do I need a 
web folder first then Web-INF)? 


Either way I am getting annoyed.

I checked my classpath and it goes to build/classes so I figured that was the 
best place to work from but nothing is working which is :(.

Thanks all for any help                                           
                                          

Reply via email to