1 2 3 4 Previous Next 50 Replies Latest reply on Mar 6, 2017 11:01 AM by Juw

    Filter exception ADF Essentials 12.2.1.1 on Glassfish 4

    jflack

      I'm trying to deploy an ADF 12.2.1.1 application to Glassfish 4.1.1 with ADF Essentials.  Deployment seems to work, I get the login form, I enter a valid username and password, and I think it is authenticating properly against my LDAP directory. But I don't get through to the home page for the application - the error is:

      javax.servlet.ServletException: Filter execution threw an exception

      root cause

      java.lang.NoClassDefFoundError: Could not initialize class oracle.adf.share.security.identitymanagement.UserProfile

       

      This class is in adf-share-ca.jar, which is in C:\glassfish4\glassfish\domains\domain1\lib.  I already know that you have to put these .jar files in "lib", not "lib\applibs" as the docs say - if you put them in applibs it won't deploy at all.  And I did unzip the ADF Essentials libraries with the -j option.

        • 1. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
          Cvele_new_account

          Wait, are you trying  to use ADF security with ADF Essentials? You can't do that

          • 2. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
            jflack

            No, I'm using container managed security - configured in web.xml with security-constraints.

             

            But - what should I look for to make sure that ADF security didn't get configured accidentally?

            • 3. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
              Dinil Mithra

              Hello Flack,

               

              You can check your project properties and remove any security or MDS related library reference from viewcontroller project and Model project.

               

              Thanks,

              DM

              • 4. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
                jflack

                I did as d'Mith suggested and re-deployed, but it didn't make any difference.

                I'm wondering if the problem has something to do with where I put the ADF Essentials .jar files.  The docs say to put these in lib/applibs, but when I did this, it won't deploy at all. Other information I found says to put them in lib (the parent directory).  When I did this, the application will deploy, but it gets the error I referenced before.

                Could lib/applibs be correct, but you have to do something else to tell Glassfish that this is the right place to look for the libraries?

                • 5. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
                  Dinil Mithra

                  can you share stack trace

                  • 6. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
                    Cvele_new_account

                    Copy the adf_essentials.zip to the lib directory of your Glassfish domain - on a default windows install this would be: C:\glassfish3\glassfish\domains\domain1\lib

                    then, go the the above lib directory and issue a unzip -j adf_essentials.zip

                     

                    https://blogs.oracle.com/shay/entry/deploying_oracle_adf_applications_to

                    • 7. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
                      jflack
                        StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
                      java.lang.NoClassDefFoundError: Could not initialize class oracle.adf.share.security.identitymanagement.UserProfile
                          at oracle.adf.share.security.SecurityContextImpl.getUserProfile(SecurityContextImpl.java:147)
                          at oracle.adfinternal.share.util.AdfShareInternalUtils.getCurrentUserProfile(AdfShareInternalUtils.java:94)
                          at oracle.adfinternal.share.util.AdfShareInternalUtils.getSecurityContextUserIdentifier(AdfShareInternalUtils.java:47)
                          at oracle.adf.share.config.ADFContextMDSConfigHelperImpl.createBaseSessionOptions(ADFContextMDSConfigHelperImpl.java:148)
                          at oracle.adf.share.config.ADFContextMDSConfigHelperImpl.createSessionOptions(ADFContextMDSConfigHelperImpl.java:168)
                          at oracle.adf.share.config.ADFContextMDSConfigHelperImpl.createMDSSession(ADFContextMDSConfigHelperImpl.java:63)
                          at oracle.adf.share.ADFContext.getMDSSessionAsObject(ADFContext.java:2356)
                          at oracle.adf.share.mds.MDSTransManager.getCurrentMDSSession(MDSTransManager.java:352)
                          at oracle.adf.share.mds.MDSTransManager.isMDSRefreshNeeded(MDSTransManager.java:176)
                          at oracle.adf.share.mds.MDSTransManager.cancelIfUnflushed(MDSTransManager.java:437)
                          at oracle.adf.share.mds.MDSTransManager.reset(MDSTransManager.java:475)
                          at oracle.adf.share.mds.MDSTransManager.reset(MDSTransManager.java:469)
                          at oracle.adf.model.BindingRequestHandler.endRequest(BindingRequestHandler.java:341)
                          at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:217)
                          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
                          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
                          at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:105)
                          at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:529)
                          at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
                          at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:529)
                          at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:354)
                          at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:232)
                          at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
                          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
                          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
                          at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:169)
                          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
                          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
                          at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:169)
                          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
                          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
                          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
                          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
                          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
                          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
                          at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
                          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
                          at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
                          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
                          at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
                          at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
                          at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
                          at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
                          at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
                          at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
                          at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
                          at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
                          at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
                          at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
                          at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
                          at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
                          at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
                          at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
                          at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
                          at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
                          at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
                          at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
                          at java.lang.Thread.run(Thread.java:745)
                      
                      
                      • 8. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
                        jflack

                        Did that already - and I've read that blog entry.

                        I've had no problem deploying ADF Essentials applications using 12.1.3 to Glassfish 3 using Shay's instructions. But this is my first 12.2.1 application, and I wanted to deploy to Glassfish 4 - I know this is pretty new, and liable to have problems.  I don't think I can deploy to Glassfish 3, because 12.2 is using a later version of JSF than is included in GF3, and needs Java 8.

                        Of course, I could try downgrading the application to 12.1 - I don't think I'm using any of the new features of 12.2.  But I don't want to do this unless I have to.

                        • 9. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
                          jflack

                          As I look at the stack trace again, I notice calls to classes like:

                          ADFContextMDSConfigHelperImpl

                          I thought I removed all references to MDS - I'll have to look again.

                          • 10. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
                            Dinil Mithra

                            Hello Jflack,

                             

                            I do have a local setup with 12.2.1.1 and Glassfish 4. I am able to run and deploy ADF application on glassfish server without errors. I strongly believe, your application has a reference to ADF security.

                             

                            Please cross check whether you have below reference in your model or view project

                            1.PNG

                            Thanks,

                            DM

                            • 11. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
                              jflack

                              So just to narrow this down:

                              1. I have an application built on the HR schema that I use for trying stuff and producing reproducible test cases.
                              2. I migrated a copy of the HRTest application to JDev/ADF 12.2.1.1 and configured it for deployment on Glassfish 4.1.1.
                              3. The original version of the application has NO security - no authentication or authorization needed.
                              4. I deployed it to Glassfish 4, and it worked.  No problem (well, several problems, but I fixed them and now it works).
                              5. I made minimal changes to require authentication and authorization:
                                • Edited web.xml to add login-config for BASIC authentication using myrealm. (this realm is configured in the Glassfish domain to use my LDAP - same configuration as works in Glassfish 3)
                                • Added a security-role for a group that I know is in my LDAP.
                                • Added a security-constraint with an auth-constraint pointing to my role.  url-pattern is /faces/*.
                                • Added a security-role-mapping to the glassfish-web.xml that I created as part of #2.
                                • Notice that I did NOT configure ADF Security - only changed web.xml and glassfish-web.xml.
                              6. Deployed to Glassfish 4.  When I try it, I get prompted for username and password as expected for Basic authentication.  But when I give these, I get the same error as I was with my real application.
                              • 12. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
                                Dinil Mithra

                                Jflack, Is it possible to create a sample application with your test case and share me the link?

                                • 13. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
                                  jflack

                                  Yes - I've attached it.

                                  This is a tiny application based on the HR schema.  So all you have to do is configure for ADF Essentials, add a data source for jdbc/hrDS and deploy from the profile named HRTest_Glassfish to an .ear or directly to Glassfish 4 from JDev 12.2.1.1.  Version I uploaded should work.  Then you can uncomment the commented sections of web.xml and glassfish-web.xml and create a user in the "file" realm in the group named "HR_USER". Deploy again and you should see the errors that I see.

                                  • 14. Re: Filter exception ADF Essentials 12.2.1.1 on Glassfish 4
                                    Dinil Mithra

                                    Thanks JFlack. I am able to reproduce this issue.... I will work on my free time.

                                    1 2 3 4 Previous Next