You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by KonradZuse <Th...@hotmail.com> on 2014/09/16 09:45:18 UTC
EhCache.jar included but getting java.lang.ClassNotFoundException:
net.sf.ehcache.CacheException
Hello all,
I am trying to enable the EhCache for my applications but I am being met
with this error
Caused by: java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2658)
at java.lang.Class.getConstructor0(Class.java:2964)
at java.lang.Class.newInstance(Class.java:403)
at org.apache.shiro.util.ClassUtils.newInstance(ClassUtils.java:177)
at org.apache.shiro.util.ClassUtils.newInstance(ClassUtils.java:164)
at
org.apache.shiro.config.ReflectionBuilder.createNewInstance(ReflectionBuilder.java:144)
at
org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:119)
at
org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:161)
at
org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:124)
at
org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:102)
at
org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:88)
at
org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:46)
at
org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)
at
org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)
at uploader.LoginControl.<init>(LoginControl.java:58)
at uploader.Uploader.<init>(Uploader.java:25)
... 15 more
Caused by: java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 32 more
I know I am supposed to have the jar included, which I do, as well as having
shiro.all.1.2.3 so it should be there as well.
for some reason it is not working...
I lookined up the error in general and found others with the issue and being
told to download it from the main site http://ehcache.org/downloads/catalog
But I'm not sure exactly which one I need..... I have a web application,
and a desktop client that will be configured with it.
Any help would be appreciated, I find it weird that the Shiro jars aren't
working, but if there is an issue with the jars at least it will be known,
if it's something on my end hopefully I can fix it...
ini file for desktop client:
sessionManager = org.apache.shiro.mgt.DefaultSecurityManager
sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
securityManager.cacheManager = $cacheManager
#securityManager.sessionManager = $sessionManager
securityManager.sessionManager.sessionDAO = $sessionDAO
Thanks all! If anything else is needed let me know.
--
View this message in context: http://shiro-user.582556.n2.nabble.com/EhCache-jar-included-but-getting-java-lang-ClassNotFoundException-net-sf-ehcache-CacheException-tp7580214.html
Sent from the Shiro User mailing list archive at Nabble.com.
RE: EhCache.jar included but getting
java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
Posted by Konrad Zuse <th...@hotmail.com>.
I will remember this when doing this for the web portion, so thank you!
Date: Tue, 16 Sep 2014 20:30:22 -0300
Subject: Re: EhCache.jar included but getting java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
From: kotogadekiru@gmail.com
To: user@shiro.apache.org
Oh. If you are using a stand alone app disregard my comment.
El sep 16, 2014 8:15 PM, "KonradZuse" <Th...@hotmail.com> escribió:
>Hi,
Maybe you have to copy the jar manually to your server lib folder.
I use eclipse/glassfish and that was the case for me.
"Program Files\glassfish4\glassfish\domains\domain1\lib"
I suppose it depends on your deployment configurations but certainly it
isn't sufficient to just include the jar in your project.
Hope it helps,
Tomas
Thanks for this.
Right now I'm setting this up with a desktop client using JavaFX, so right
now no connection to my server. I'm also using Tomcat for my web
application, but that's seperate.
Why isn't it sufficient to include the jar files? This is how every other
extension jar works, I've never had a problem with adding a jar, and then
getting to work, unless there was an issue with dependencies needed.
As I mentioned I use Netbeans.
___________________________________________________________________________________
I think you need to add ehcache-core as well. I believe shiro-ehcache only
has the support to use ehcache.
http://mvnrepository.com/artifact/org.apache.shiro/shiro-ehcache/1.2.1
thanks
Amish
I downloaded echache-core-2.6.9.jar and now everything works.... Thanks so
much! I wish it was explained more clearly on the Shiro download page. TBH
I think this also happened with s4jlogger I believe I went to the direct
page, but I was confused with everything so I don't know if I even tried to
download part for Shiro-Log, but I am using Shiro-all so...
Thanks again for the help, hopefully Lez, or someone can make that more
clear in the dl section and add that link above, since they could use the
dependency, or download the jar.
Btw thanks for the link, I didn't know maven stored jars and such on their
servers, but I guess that makes sense since the dependencies have to connect
to something...
--
View this message in context: http://shiro-user.582556.n2.nabble.com/EhCache-jar-included-but-getting-java-lang-ClassNotFoundException-net-sf-ehcache-CacheException-tp7580214p7580220.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: EhCache.jar included but getting java.lang.ClassNotFoundException:
net.sf.ehcache.CacheException
Posted by Tomas Lund Petersen <ko...@gmail.com>.
Oh. If you are using a stand alone app disregard my comment.
El sep 16, 2014 8:15 PM, "KonradZuse" <Th...@hotmail.com> escribió:
> >Hi,
> Maybe you have to copy the jar manually to your server lib folder.
> I use eclipse/glassfish and that was the case for me.
> "Program Files\glassfish4\glassfish\domains\domain1\lib"
> I suppose it depends on your deployment configurations but certainly it
> isn't sufficient to just include the jar in your project.
> Hope it helps,
> Tomas
>
> Thanks for this.
>
> Right now I'm setting this up with a desktop client using JavaFX, so right
> now no connection to my server. I'm also using Tomcat for my web
> application, but that's seperate.
>
> Why isn't it sufficient to include the jar files? This is how every other
> extension jar works, I've never had a problem with adding a jar, and then
> getting to work, unless there was an issue with dependencies needed.
>
> As I mentioned I use Netbeans.
>
>
> ___________________________________________________________________________________
>
> I think you need to add ehcache-core as well. I believe shiro-ehcache only
> has the support to use ehcache.
>
> http://mvnrepository.com/artifact/org.apache.shiro/shiro-ehcache/1.2.1
>
> thanks
> Amish
>
> I downloaded echache-core-2.6.9.jar and now everything works.... Thanks so
> much! I wish it was explained more clearly on the Shiro download page.
> TBH
> I think this also happened with s4jlogger I believe I went to the direct
> page, but I was confused with everything so I don't know if I even tried to
> download part for Shiro-Log, but I am using Shiro-all so...
>
> Thanks again for the help, hopefully Lez, or someone can make that more
> clear in the dl section and add that link above, since they could use the
> dependency, or download the jar.
>
>
> Btw thanks for the link, I didn't know maven stored jars and such on their
> servers, but I guess that makes sense since the dependencies have to
> connect
> to something...
>
>
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/EhCache-jar-included-but-getting-java-lang-ClassNotFoundException-net-sf-ehcache-CacheException-tp7580214p7580220.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>
Re: EhCache.jar included but getting
java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
Posted by KonradZuse <Th...@hotmail.com>.
>Hi,
Maybe you have to copy the jar manually to your server lib folder.
I use eclipse/glassfish and that was the case for me.
"Program Files\glassfish4\glassfish\domains\domain1\lib"
I suppose it depends on your deployment configurations but certainly it
isn't sufficient to just include the jar in your project.
Hope it helps,
Tomas
Thanks for this.
Right now I'm setting this up with a desktop client using JavaFX, so right
now no connection to my server. I'm also using Tomcat for my web
application, but that's seperate.
Why isn't it sufficient to include the jar files? This is how every other
extension jar works, I've never had a problem with adding a jar, and then
getting to work, unless there was an issue with dependencies needed.
As I mentioned I use Netbeans.
___________________________________________________________________________________
I think you need to add ehcache-core as well. I believe shiro-ehcache only
has the support to use ehcache.
http://mvnrepository.com/artifact/org.apache.shiro/shiro-ehcache/1.2.1
thanks
Amish
I downloaded echache-core-2.6.9.jar and now everything works.... Thanks so
much! I wish it was explained more clearly on the Shiro download page. TBH
I think this also happened with s4jlogger I believe I went to the direct
page, but I was confused with everything so I don't know if I even tried to
download part for Shiro-Log, but I am using Shiro-all so...
Thanks again for the help, hopefully Lez, or someone can make that more
clear in the dl section and add that link above, since they could use the
dependency, or download the jar.
Btw thanks for the link, I didn't know maven stored jars and such on their
servers, but I guess that makes sense since the dependencies have to connect
to something...
--
View this message in context: http://shiro-user.582556.n2.nabble.com/EhCache-jar-included-but-getting-java-lang-ClassNotFoundException-net-sf-ehcache-CacheException-tp7580214p7580220.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: EhCache.jar included but getting
java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
Posted by amish <am...@kno.com>.
I think you need to add ehcache-core as well. I believe shiro-ehcache only
has the support to use ehcache.
http://mvnrepository.com/artifact/org.apache.shiro/shiro-ehcache/1.2.1
thanks
Amish
--
View this message in context: http://shiro-user.582556.n2.nabble.com/EhCache-jar-included-but-getting-java-lang-ClassNotFoundException-net-sf-ehcache-CacheException-tp7580214p7580218.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: EhCache.jar included but getting java.lang.ClassNotFoundException:
net.sf.ehcache.CacheException
Posted by Tomas Lund Petersen <ko...@gmail.com>.
Hi,
Maybe you have to copy the jar manually to your server lib folder.
I use eclipse/glassfish and that was the case for me.
"Program Files\glassfish4\glassfish\domains\domain1\lib"
I suppose it depends on your deployment configurations but certainly it
isn't sufficient to just include the jar in your project.
Hope it helps,
Tomas
On Tue, Sep 16, 2014 at 3:41 PM, Konrad Zuse <th...@hotmail.com>
wrote:
> As I mentioned I have added both the Shiro-all, and shiro-ehcache.jar. I
> am using netbeans IDE, so that normally deals with all the configs and such
> I need. Every other extension jar works this way, so I doubt it's
> something wrong with that... I could include the Manifest if you want.
>
> So again I'm not sure if this has to do with Shiro, or something on the
> EHCache side? Both versions are 1.2.3.
>
> ------------------------------
> Date: Tue, 16 Sep 2014 06:26:17 -0500
> Subject: Re: EhCache.jar included but getting
> java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
> From: jared.bunting@peachjean.com
> To: user@shiro.apache.org
>
>
> Do you currently have any ehcache jars on your class path?
> On Sep 16, 2014 2:45 AM, "KonradZuse" <Th...@hotmail.com> wrote:
>
> Hello all,
>
> I am trying to enable the EhCache for my applications but I am being met
> with this error
>
> Caused by: java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
> at java.lang.Class.getDeclaredConstructors0(Native Method)
> at java.lang.Class.privateGetDeclaredConstructors(Class.java:2658)
> at java.lang.Class.getConstructor0(Class.java:2964)
> at java.lang.Class.newInstance(Class.java:403)
> at
> org.apache.shiro.util.ClassUtils.newInstance(ClassUtils.java:177)
> at
> org.apache.shiro.util.ClassUtils.newInstance(ClassUtils.java:164)
> at
>
> org.apache.shiro.config.ReflectionBuilder.createNewInstance(ReflectionBuilder.java:144)
> at
>
> org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:119)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:161)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:124)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:102)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:88)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:46)
> at
>
> org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)
> at
> org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)
> at uploader.LoginControl.<init>(LoginControl.java:58)
> at uploader.Uploader.<init>(Uploader.java:25)
> ... 15 more
> Caused by: java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
> at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ... 32 more
>
>
> I know I am supposed to have the jar included, which I do, as well as
> having
> shiro.all.1.2.3 so it should be there as well.
>
> for some reason it is not working...
>
> I lookined up the error in general and found others with the issue and
> being
> told to download it from the main site
> http://ehcache.org/downloads/catalog
>
> But I'm not sure exactly which one I need..... I have a web application,
> and a desktop client that will be configured with it.
>
> Any help would be appreciated, I find it weird that the Shiro jars aren't
> working, but if there is an issue with the jars at least it will be known,
> if it's something on my end hopefully I can fix it...
>
>
>
> ini file for desktop client:
>
>
> sessionManager = org.apache.shiro.mgt.DefaultSecurityManager
> sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
>
> cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
> securityManager.cacheManager = $cacheManager
>
>
> #securityManager.sessionManager = $sessionManager
> securityManager.sessionManager.sessionDAO = $sessionDAO
>
> Thanks all! If anything else is needed let me know.
>
>
>
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/EhCache-jar-included-but-getting-java-lang-ClassNotFoundException-net-sf-ehcache-CacheException-tp7580214.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>
>
RE: EhCache.jar included but getting
java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
Posted by Konrad Zuse <th...@hotmail.com>.
As I mentioned I have added both the Shiro-all, and shiro-ehcache.jar. I am using netbeans IDE, so that normally deals with all the configs and such I need. Every other extension jar works this way, so I doubt it's something wrong with that... I could include the Manifest if you want.
So again I'm not sure if this has to do with Shiro, or something on the EHCache side? Both versions are 1.2.3.
Date: Tue, 16 Sep 2014 06:26:17 -0500
Subject: Re: EhCache.jar included but getting java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
From: jared.bunting@peachjean.com
To: user@shiro.apache.org
Do you currently have any ehcache jars on your class path?
On Sep 16, 2014 2:45 AM, "KonradZuse" <Th...@hotmail.com> wrote:
Hello all,
I am trying to enable the EhCache for my applications but I am being met
with this error
Caused by: java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2658)
at java.lang.Class.getConstructor0(Class.java:2964)
at java.lang.Class.newInstance(Class.java:403)
at org.apache.shiro.util.ClassUtils.newInstance(ClassUtils.java:177)
at org.apache.shiro.util.ClassUtils.newInstance(ClassUtils.java:164)
at
org.apache.shiro.config.ReflectionBuilder.createNewInstance(ReflectionBuilder.java:144)
at
org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:119)
at
org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:161)
at
org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:124)
at
org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:102)
at
org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:88)
at
org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:46)
at
org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)
at
org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)
at uploader.LoginControl.<init>(LoginControl.java:58)
at uploader.Uploader.<init>(Uploader.java:25)
... 15 more
Caused by: java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 32 more
I know I am supposed to have the jar included, which I do, as well as having
shiro.all.1.2.3 so it should be there as well.
for some reason it is not working...
I lookined up the error in general and found others with the issue and being
told to download it from the main site http://ehcache.org/downloads/catalog
But I'm not sure exactly which one I need..... I have a web application,
and a desktop client that will be configured with it.
Any help would be appreciated, I find it weird that the Shiro jars aren't
working, but if there is an issue with the jars at least it will be known,
if it's something on my end hopefully I can fix it...
ini file for desktop client:
sessionManager = org.apache.shiro.mgt.DefaultSecurityManager
sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
securityManager.cacheManager = $cacheManager
#securityManager.sessionManager = $sessionManager
securityManager.sessionManager.sessionDAO = $sessionDAO
Thanks all! If anything else is needed let me know.
--
View this message in context: http://shiro-user.582556.n2.nabble.com/EhCache-jar-included-but-getting-java-lang-ClassNotFoundException-net-sf-ehcache-CacheException-tp7580214.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: EhCache.jar included but getting java.lang.ClassNotFoundException:
net.sf.ehcache.CacheException
Posted by Jared Bunting <ja...@peachjean.com>.
Do you currently have any ehcache jars on your class path?
On Sep 16, 2014 2:45 AM, "KonradZuse" <Th...@hotmail.com> wrote:
> Hello all,
>
> I am trying to enable the EhCache for my applications but I am being met
> with this error
>
> Caused by: java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
> at java.lang.Class.getDeclaredConstructors0(Native Method)
> at java.lang.Class.privateGetDeclaredConstructors(Class.java:2658)
> at java.lang.Class.getConstructor0(Class.java:2964)
> at java.lang.Class.newInstance(Class.java:403)
> at
> org.apache.shiro.util.ClassUtils.newInstance(ClassUtils.java:177)
> at
> org.apache.shiro.util.ClassUtils.newInstance(ClassUtils.java:164)
> at
>
> org.apache.shiro.config.ReflectionBuilder.createNewInstance(ReflectionBuilder.java:144)
> at
>
> org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:119)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:161)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:124)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:102)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:88)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:46)
> at
>
> org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)
> at
> org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)
> at uploader.LoginControl.<init>(LoginControl.java:58)
> at uploader.Uploader.<init>(Uploader.java:25)
> ... 15 more
> Caused by: java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
> at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ... 32 more
>
>
> I know I am supposed to have the jar included, which I do, as well as
> having
> shiro.all.1.2.3 so it should be there as well.
>
> for some reason it is not working...
>
> I lookined up the error in general and found others with the issue and
> being
> told to download it from the main site
> http://ehcache.org/downloads/catalog
>
> But I'm not sure exactly which one I need..... I have a web application,
> and a desktop client that will be configured with it.
>
> Any help would be appreciated, I find it weird that the Shiro jars aren't
> working, but if there is an issue with the jars at least it will be known,
> if it's something on my end hopefully I can fix it...
>
>
>
> ini file for desktop client:
>
>
> sessionManager = org.apache.shiro.mgt.DefaultSecurityManager
> sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
>
> cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
> securityManager.cacheManager = $cacheManager
>
>
> #securityManager.sessionManager = $sessionManager
> securityManager.sessionManager.sessionDAO = $sessionDAO
>
> Thanks all! If anything else is needed let me know.
>
>
>
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/EhCache-jar-included-but-getting-java-lang-ClassNotFoundException-net-sf-ehcache-CacheException-tp7580214.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>
Re: EhCache.jar included but getting java.lang.ClassNotFoundException:
net.sf.ehcache.CacheException
Posted by Amish Shah <am...@kno.com>.
Try unjaring the war file and see if the ehcache.jar is in it. You
shouldn'= t have to add it to server libs.
Thanks
Amish
On Tue, Sep 16, 2014 at 12:45 AM, KonradZuse <Th...@hotmail.com>
wrote:
> Hello all,
>
> I am trying to enable the EhCache for my applications but I am being met
> with this error
>
> Caused by: java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
> at java.lang.Class.getDeclaredConstructors0(Native Method)
> at java.lang.Class.privateGetDeclaredConstructors(Class.java:2658)
> at java.lang.Class.getConstructor0(Class.java:2964)
> at java.lang.Class.newInstance(Class.java:403)
> at
> org.apache.shiro.util.ClassUtils.newInstance(ClassUtils.java:177)
> at
> org.apache.shiro.util.ClassUtils.newInstance(ClassUtils.java:164)
> at
>
> org.apache.shiro.config.ReflectionBuilder.createNewInstance(ReflectionBuilder.java:144)
> at
>
> org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:119)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:161)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:124)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:102)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:88)
> at
>
> org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:46)
> at
>
> org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)
> at
> org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)
> at uploader.LoginControl.<init>(LoginControl.java:58)
> at uploader.Uploader.<init>(Uploader.java:25)
> ... 15 more
> Caused by: java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
> at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ... 32 more
>
>
> I know I am supposed to have the jar included, which I do, as well as
> having
> shiro.all.1.2.3 so it should be there as well.
>
> for some reason it is not working...
>
> I lookined up the error in general and found others with the issue and
> being
> told to download it from the main site
> http://ehcache.org/downloads/catalog
>
> But I'm not sure exactly which one I need..... I have a web application,
> and a desktop client that will be configured with it.
>
> Any help would be appreciated, I find it weird that the Shiro jars aren't
> working, but if there is an issue with the jars at least it will be known,
> if it's something on my end hopefully I can fix it...
>
>
>
> ini file for desktop client:
>
>
> sessionManager = org.apache.shiro.mgt.DefaultSecurityManager
> sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
>
> cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
> securityManager.cacheManager = $cacheManager
>
>
> #securityManager.sessionManager = $sessionManager
> securityManager.sessionManager.sessionDAO = $sessionDAO
>
> Thanks all! If anything else is needed let me know.
>
>
>
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/EhCache-jar-included-but-getting-java-lang-ClassNotFoundException-net-sf-ehcache-CacheException-tp7580214.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>