Apache Shiro First Use in NetBeans

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Apache Shiro First Use in NetBeans

Asme
This post has NOT been accepted by the mailing list yet.
I am trying to use to use Apache Shiro to secure a simple Java Web application.
So here is how I preceded:

1 I downloaded the Shiro-web.jar.

2 I created a new web Java web Application.

3 I add the Jar file to the libraries folder

4 I created a web.xml file and change it to look like this:

                   <?xml version="1.0" encoding="UTF-8"?>

        <web-app xmlns="http://java.sun.com/xml/ns/javaee"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
                version="3.0">
            <session-config>
                <session-timeout>
                    30
                </session-timeout>
            </session-config>
        </web-app>


        <listener>
            <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
        </listener>
        <filter>
            <filter-name>shiroFilter</filter-name>
            <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>shiroFilter</filter-name>
            <url-pattern>/*</url-pattern>
            <dispatcher>REQUEST</dispatcher>
            <dispatcher>FORWARD</dispatcher>
            <dispatcher>INCLUDE</dispatcher>
            <dispatcher>ERROR</dispatcher>
        </filter-mapping>


5 I created shiro.ini file in web\WEB-INF

        [main]
        authc.loginUrl = /login.jsp

        [users]
        admin = password

        [urls]
        /index.jsp = authcBasic

6 And I add the login page:

        <%@page contentType="text/html" pageEncoding="UTF-8"%>
        <!DOCTYPE html>
        <html>
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                <title>Login Page</title>
            </head>
            <body>

                   

Login

            <form method="post">
                <label for="username">Username:</label>
                <input type="text" id="username" name="username" />
                <br/>
                <label for="password">Password:</label>
                <input type="password" id="password" name="password" />
                <br/> 
                <input type="submit" value="Login" />
            </form>

            </body>
        </html>


And when I run the application, I get this error:

                init:
                deps-module-jar:
                deps-ear-jar:
                deps-jar:
                Created dir: C:\Users\WORK\Documents\NetBeansProjects\ShiroTestApp\build\web\WEB-INF\classes
                Created dir: C:\Users\WORK\Documents\NetBeansProjects\ShiroTestApp\build\web\META-INF
                Copying 1 file to C:\Users\WORK\Documents\NetBeansProjects\ShiroTestApp\build\web\META-INF
                Copying 4 files to C:\Users\WORK\Documents\NetBeansProjects\ShiroTestApp\build\web
                library-inclusion-in-archive:
                library-inclusion-in-manifest:
                Created dir: C:\Users\WORK\Documents\NetBeansProjects\ShiroTestApp\build\empty
                Created dir: C:\Users\WORK\Documents\NetBeansProjects\ShiroTestApp\build\generated-sources\ap-source-output
                compile:
                compile-jsps:
                In-place deployment at C:\Users\WORK\Documents\NetBeansProjects\ShiroTestApp\build\web
                Initializing...
                deploy?DEFAULT=C:\Users\WORK\Documents\NetBeansProjects\ShiroTestApp\build\web&name=ShiroTestApp&contextroot=/ShiroTestApp&force=true failed on GlassFish Server 3+
                 Exception while deploying the app : java.io.IOException: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
                C:\Users\WORK\Documents\NetBeansProjects\ShiroTestApp\nbproject\build-impl.xml:721: The module has not been deployed.
                See the server log for details.
                BUILD FAILED (total time: 7 seconds)

Do I need to add or modify something?
Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

Wilson Bogado
This post has NOT been accepted by the mailing list yet.
Your web.xml file is not well-formed. All elements must be inside the web-app element.

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
         version="3.0">

    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>
    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
</web-app>
Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

KonradZuse
I knoe this is old, but I am getting the same issues.

I tried your example, but it doesn't work either.

I was having issues getting my project to work, I was getting "tag issues" but then I realized my web.xml isn't correct, so I tried adding the needed stuff but now it gives me the same error.  This is my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
   
       
     <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>ShiroFilter</filter-name>
        <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>ShiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    <servlet>
        <servlet-name>viewerServlet</servlet-name>
        <servlet-class>viewerServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>viewerServlet</servlet-name>
        <url-pattern>/viewerServlet</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>

</web-app>


I have tried moving the thing around inside seeing if that might have bugged it out, but nothing.  Everything is inside the web-app tags.

The issue happens when I call      
     <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>ShiroFilter</filter-name>
        <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>ShiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

I have a working example that I cloned from the shiro site, but I cannot get it working in my own project... ugh..

Thanks for any help!
Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

Jared Bunting-2

Can you share your error?

On Jul 26, 2014 4:22 PM, "KonradZuse" <[hidden email]> wrote:
I knoe this is old, but I am getting the same issues.

I tried your example, but it doesn't work either.

I was having issues getting my project to work, I was getting "tag issues"
but then I realized my web.xml isn't correct, so I tried adding the needed
stuff but now it gives me the same error.  This is my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">


     <listener>

<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>ShiroFilter</filter-name>

<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>ShiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    <servlet>
        <servlet-name>viewerServlet</servlet-name>
        <servlet-class>viewerServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>viewerServlet</servlet-name>
        <url-pattern>/viewerServlet</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>

</web-app>


I have tried moving the thing around inside seeing if that might have bugged
it out, but nothing.  Everything is inside the web-app tags.

The issue happens when I call
     <listener>

<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>ShiroFilter</filter-name>

<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>ShiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

I have a working example that I cloned from the shiro site, but I cannot get
it working in my own project... ugh..

Thanks for any help!



--
View this message in context: http://shiro-user.582556.n2.nabble.com/Apache-Shiro-First-Use-in-NetBeans-tp7578762p7580100.html
Sent from the Shiro User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

KonradZuse
I'm sorry, my mistake, I thought it was the same as his error.



In-place deployment at C:\Users\Konrad\Documents\NetBeansProjects\WebViewer\build\web
GlassFish Server 4, deploy, null, false
C:\Users\Konrad\Documents\NetBeansProjects\WebViewer\nbproject\build-impl.xml:1050: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 34 seconds)


Line 1050 is         <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>

Any thoughts would be appreciated :).
Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

KonradZuse
Sorry for the double post, but the edit said it wuldn't apprear on the mailing list so I wanted to make sure this got there.

I tried subscribing multiple different ways as suggested by the auto-mailer, but I cannot get access to the mailing list?  Does anyone know who I can email to add me?

Thank you everyone!
Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

lprimak
In reply to this post by KonradZuse
This doesn't look like it has anything to do with Shiro.
I use Shiro with glassfish and netbeans with maven builds and it works fine.
I am unfamiliar with the non-maven netbeans build system.

On Jul 26, 2014, at 10:05 PM, KonradZuse wrote:

> I'm sorry, my mistake, I thought it was the same as his error.
>
>
>
> In-place deployment at
> C:\Users\Konrad\Documents\NetBeansProjects\WebViewer\build\web
> GlassFish Server 4, deploy, null, false
> C:\Users\Konrad\Documents\NetBeansProjects\WebViewer\nbproject\build-impl.xml:1050:
> The module has not been deployed.
> See the server log for details.
> BUILD FAILED (total time: 34 seconds)
>
>
> Line 1050 is         <nbdeploy clientUrlPart="${client.urlPart}"
> debugmode="false" forceRedeploy="${forceRedeploy}"/>
>
> Any thoughts would be appreciated :).
>
>
>
> --
> View this message in context: http://shiro-user.582556.n2.nabble.com/Apache-Shiro-First-Use-in-NetBeans-tp7578762p7580102.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

KonradZuse
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>
    <filter>
        <filter-name>ShiroFilter</filter-name>
        <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>ShiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <servlet>
        <servlet-name>viewerServlet</servlet-name>
        <servlet-class>viewerServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>viewerServlet</servlet-name>
        <url-pattern>/viewerServlet</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
</web-app>

This is the entire web.xml, without the shiro code it works, and this is what was premade via netbeans.
Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

Jared Bunting-2

I see this: "The module has not been deployed.
See the server log for details."

Is there an error in the server log?

On Jul 27, 2014 12:04 AM, "KonradZuse" <[hidden email]> wrote:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
    <listener>

<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>
    <filter>
        <filter-name>ShiroFilter</filter-name>

<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>ShiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <servlet>
        <servlet-name>viewerServlet</servlet-name>
        <servlet-class>viewerServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>viewerServlet</servlet-name>
        <url-pattern>/viewerServlet</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
</web-app>

This is the entire web.xml, without the shiro code it works, and this is
what was premade via netbeans.



--
View this message in context: http://shiro-user.582556.n2.nabble.com/Apache-Shiro-First-Use-in-NetBeans-tp7578762p7580105.html
Sent from the Shiro User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

KonradZuse
The error is

[2014-07-27T21:07:46.123-0400] [glassfish 4.0] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=36 _ThreadName=admin-listener(3)] [timeMillis: 1406509666123] [levelValue: 1000] [[
  Exception during lifecycle processing
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
        at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
        at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
        at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
        at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:360)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
        at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
        at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
        at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
        at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
        at java.lang.Thread.run(Thread.java:744)
]]
[2014-07-27T21:07:46.124-0400] [glassfish 4.0] [SEVERE] []
[javax.enterprise.system.core] [tid: _ThreadID=36 _ThreadName=admin-listener(3)]
 [timeMillis: 1406509666124] [levelValue: 1000]
[[  Exception while loading the app]]

[2014-07-27T21:07:46.124-0400] [glassfish 4.0] [SEVERE] [AS-WEB-GLUE-00192] [javax.enterprise.web] [tid: _ThreadID=36 _ThreadName=admin-listener(3)] [timeMillis: 1406509666124] [levelValue: 1000]
[[Undeployment failed for context /WebViewer]]

[2014-07-27T21:07:46.144-0400] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core]
 [tid: _ThreadID=36 _ThreadName=admin-listener(3)] [timeMillis: 1406509666144] [levelValue: 1000]
 [[ Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory]]


I do see in my runtime dependensies in the" apache webapp tutorial" there are the following

jcl-over-slf4j
logback-classic
stormpath ------ I pknow I don't need this
commons-codec
httlp-client
httlp-core
jackson-core-asl
jackson-mapper-asl
logback-core
stormpath-sdkhttp

So I;'m curious if I should have any of these in my appkication?

All I have is the downloaded Shiro-core and Shiro-web both ver 1.2.3

I also do notice there is a logback.xml file in the apache tutorial, which I'm not sure if I need or not, but it seems like I am missing the first one jcl-over-slf4j, since it says "java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory"

I tried downloading the slf4j, but it didn't work, so Idk :(
Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

Jared Bunting-2
It looks like you are missing slf4j-api.jar  Add that, and this error should go away.


On Sun, Jul 27, 2014 at 8:31 PM, KonradZuse <[hidden email]> wrote:
The error is

[2014-07-27T21:07:46.123-0400] [glassfish 4.0] [SEVERE] [NCLS-CORE-00026]
[javax.enterprise.system.core] [tid: _ThreadID=36
_ThreadName=admin-listener(3)] [timeMillis: 1406509666123] [levelValue:
1000] [[
  Exception during lifecycle processing
java.lang.Exception: java.lang.IllegalStateException:
ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
java.lang.IllegalArgumentException: javax.servlet.ServletException:
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
        at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
        at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
        at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
        at
org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
        at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
        at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
        at
org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
        at
com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
        at
com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:360)
        at
com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
        at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
        at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
        at
com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
        at
com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
        at
com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
        at
com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
        at
com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
        at
org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
        at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
        at
org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
        at
org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
        at
org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
        at
org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
        at
org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
        at
org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
        at
org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
        at
org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
        at
org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
        at
org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
        at
org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
        at
org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
        at
org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
        at
org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
        at
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
        at
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
        at java.lang.Thread.run(Thread.java:744)
]]
[2014-07-27T21:07:46.124-0400] [glassfish 4.0] [SEVERE] []
[javax.enterprise.system.core] [tid: _ThreadID=36
_ThreadName=admin-listener(3)]
 [timeMillis: 1406509666124] [levelValue: 1000]
[[  Exception while loading the app]]

[2014-07-27T21:07:46.124-0400] [glassfish 4.0] [SEVERE] [AS-WEB-GLUE-00192]
[javax.enterprise.web] [tid: _ThreadID=36 _ThreadName=admin-listener(3)]
[timeMillis: 1406509666124] [levelValue: 1000]
[[Undeployment failed for context /WebViewer]]

[2014-07-27T21:07:46.144-0400] [glassfish 4.0] [SEVERE] []
[javax.enterprise.system.core]
 [tid: _ThreadID=36 _ThreadName=admin-listener(3)] [timeMillis:
1406509666144] [levelValue: 1000]
 [[ Exception while loading the app : java.lang.IllegalStateException:
ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
java.lang.IllegalArgumentException: javax.servlet.ServletException:
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory]]


I do see in my runtime dependensies in the" apache webapp tutorial" there
are the following

jcl-over-slf4j
logback-classic
stormpath ------ I pknow I don't need this
commons-codec
httlp-client
httlp-core
jackson-core-asl
jackson-mapper-asl
logback-core
stormpath-sdkhttp

So I;'m curious if I should have any of these in my appkication?

All I have is the downloaded Shiro-core and Shiro-web both ver 1.2.3

I also do notice there is a logback.xml file in the apache tutorial, which
I'm not sure if I need or not, but it seems like I am missing the first one
jcl-over-slf4j, since it says "java.lang.NoClassDefFoundError:
org/slf4j/LoggerFactory"

I tried downloading the slf4j, but it didn't work, so Idk :(



--
View this message in context: http://shiro-user.582556.n2.nabble.com/Apache-Shiro-First-Use-in-NetBeans-tp7578762p7580107.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

KonradZuse
tried both the jcl-over-slf4j and the slf4j-api and nothing :(

Why exactly do I need that?  Shouldn't this also be added to the download section as a necessity for those of us not using maven?  Is there something in my code that needs it?  I tried looking for it and couldn't find anything, what part of the tutorial app I wonder had it...
Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

KonradZuse
Oh wait now the server log says

  Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/apache/commons/beanutils/PropertyUtils]]

What the hell, haha...

I guess that worked then, is there a difference between the jcl-over-... vs the api one?

Also is there a reason I need all of these?  Is it because I copied the files from the tutorial or is it needing something from these apis?
Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

Jared Bunting-2
That error implies that you are missing commons-beanutils.  

You need these libraries because shiro depends on them.

The download page specifies that you need slf4j-api and commons-beanutils - http://shiro.apache.org/download.html#latestBinary
That same section also mentions that you'll need an slf4j binding jar. logback-classic and logback-core satisfy this dependency.

Yes there is a difference between slf4j-api and jcl-over-slf4j - they're different libraries. You don't *need* jcl-over-slf4j, but I recommend it. I believe that commons-beanutils requires either commons-logging or jcl-over-slf4j.
For more information about supporting slf4j, see its site: http://slf4j.org/




On Sun, Jul 27, 2014 at 8:41 PM, KonradZuse <[hidden email]> wrote:
Oh wait now the server log says

  Exception while loading the app : java.lang.IllegalStateException:
ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
java.lang.NoClassDefFoundError: org/apache/commons/beanutils/PropertyUtils]]

What the hell, haha...

I guess that worked then, is there a difference between the jcl-over-... vs
the api one?

Also is there a reason I need all of these?  Is it because I copied the
files from the tutorial or is it needing something from these apis?



--
View this message in context: http://shiro-user.582556.n2.nabble.com/Apache-Shiro-First-Use-in-NetBeans-tp7578762p7580110.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Apache Shiro First Use in NetBeans

KonradZuse
Makes sense, I didn't see that in the notes last time so sorry about that, and I appreciate the help...

It says I need to verify the keys.  I've seen this before, but never have done it myself, is there a simple way to do this, I tried looking it up but nothing really helpful....

I don't know why things have to be so complicated :P.

I added both slf4j jar files and sources.