Grails

Grails 2.0 basic warfile doesn't run on Weblogic 10.2

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Incomplete
  • Affects Version/s: 2.0 final
  • Fix Version/s: 2.0.4
  • Component/s: Build System
  • Environment:
    $ uname -a
    Linux lxdnd968 2.6.9-101.ELsmp #1 SMP Fri May 27 18:56:38 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
    $ which java
    /prod/appl/bea/home10.2/jrockit_150_17/bin/java

Description

Created a basic 2.0 grails app in spring source tool suite 2.8.1 with grails and groovy plugins. Configured for grails home 2.0.0 and groovy 1.8.3. Using JDK 1.6 with compatibility set to 1.5.
War creates fine - but then 2 issues when I go to deploy on weblogic.
1. War Doesn't include the needed standard.jar but I think there's another Jira on this.

  • Added this using a copy command in buildconfig.groovy.
    2. Get exceptions trying to create the pluginManager from applicationContext.xml.
  • Not the same problem as reported for weblogic 10.3 in previous version of Grails... I followed the suggestions to create a weblogic.xml file with context root, rename sessionid cookie, and specify prefer-webinf-classes. Same issue. Log file attached.

Issue Links

Activity

Hide
Graeme Rocher added a comment -

The root cause is not shown in the error, is there any other error log files which show the actual cause of the NPE

Show
Graeme Rocher added a comment - The root cause is not shown in the error, is there any other error log files which show the actual cause of the NPE
Hide
Daniel Chapman added a comment -

This is all I get - I don't have visibility into the weblogic.server.internal.EventManager line 458.

I turned the debugging way up on weblogic but no more information.

Show
Daniel Chapman added a comment - This is all I get - I don't have visibility into the weblogic.server.internal.EventManager line 458. I turned the debugging way up on weblogic but no more information.
Hide
Burt Beckwith added a comment -

Could you show your weblogic.xml?

Show
Burt Beckwith added a comment - Could you show your weblogic.xml?
Hide
Burt Beckwith added a comment -

I don't see 10.2 as a download option at http://www.oracle.com/technetwork/middleware/ias/downloads/wls-main-097127.html to test with but I was able to deploy a simple application to 10.3.5. Are you able to upgrade?

Show
Burt Beckwith added a comment - I don't see 10.2 as a download option at http://www.oracle.com/technetwork/middleware/ias/downloads/wls-main-097127.html to test with but I was able to deploy a simple application to 10.3.5. Are you able to upgrade?
Hide
Graeme Rocher added a comment -

reducing priority, awaiting feedback

Show
Graeme Rocher added a comment - reducing priority, awaiting feedback
Hide
Bobby Warner added a comment -

There's no such thing as WebLogic 10.2 (http://en.wikipedia.org/wiki/Weblogic#Application_Server_versions). I recommend closing this issue. Thanks, Bobby

Show
Bobby Warner added a comment - There's no such thing as WebLogic 10.2 (http://en.wikipedia.org/wiki/Weblogic#Application_Server_versions). I recommend closing this issue. Thanks, Bobby
Hide
Graeme Rocher added a comment -

closed to lack of feedback

Show
Graeme Rocher added a comment - closed to lack of feedback
Hide
Daniel Chapman added a comment -

Sorry I had to quit this project. Now just getting back into things. Regarding Weblogic 10.2 comment by Bobby - it does exist, it's "Weblogic Platform": http://docs.oracle.com/cd/E13196_01/platform/suppconfigs/configs102/102_over/overview.html
... which consists of WebLogic Server 10.0 MP2. Same thing. I should've referred to WLS 10.0 MP2 - I think that alone would produce same results.

I'm updating my env to use same app, and deploy to same server, but using grails 2.0.3 and STS 2.9.1, still jdk1.5 compatibility.

Show
Daniel Chapman added a comment - Sorry I had to quit this project. Now just getting back into things. Regarding Weblogic 10.2 comment by Bobby - it does exist, it's "Weblogic Platform": http://docs.oracle.com/cd/E13196_01/platform/suppconfigs/configs102/102_over/overview.html ... which consists of WebLogic Server 10.0 MP2. Same thing. I should've referred to WLS 10.0 MP2 - I think that alone would produce same results. I'm updating my env to use same app, and deploy to same server, but using grails 2.0.3 and STS 2.9.1, still jdk1.5 compatibility.
Hide
Lari Hotari added a comment -

Grails 2.0.3 doesn't yet run on JDK1.5 because grails-datastore 1.0.4 version has been compiled for JDK 1.6 . The problem is fixed and will be released in 2.0.4.
Add this dependency to BuildConfig.groovy's dependencies to upgrade grails-datastore in 2.0.3 :

compile("org.grails:grails-datastore-gorm:1.0.7.RELEASE", "org.grails:grails-datastore-simple:1.0.7.RELEASE", "org.grails:grails-datastore-core:1.0.7.RELEASE") {
                transitive=false
        }
Show
Lari Hotari added a comment - Grails 2.0.3 doesn't yet run on JDK1.5 because grails-datastore 1.0.4 version has been compiled for JDK 1.6 . The problem is fixed and will be released in 2.0.4. Add this dependency to BuildConfig.groovy's dependencies to upgrade grails-datastore in 2.0.3 :
compile("org.grails:grails-datastore-gorm:1.0.7.RELEASE", "org.grails:grails-datastore-simple:1.0.7.RELEASE", "org.grails:grails-datastore-core:1.0.7.RELEASE") {
                transitive=false
        }
Hide
Daniel Chapman added a comment -

Thanks for the info! Was just going down this path but was trying to do a runtime include on 1.0.7 along with an excludes on 1.0.4 of grails.datastore.core, but that's not working - I'll try your suggestion next.

It seems that the JDK 1.5 issue also exists with commons-dbcp. I'm not sure where this dependency is coming from, in the ivy-dependency report it's saying from organization org.grails.internal requires commons-dbcp 1.4. If you look at http://commons.apache.org/dbcp/ it says that 1.4 only works with jdk 1.6.

Tried adding 'org.grails:grails-datastore-core:1.0.4.RELEASE' to my BuildConfig excludes but it's still there. Ideas?

Show
Daniel Chapman added a comment - Thanks for the info! Was just going down this path but was trying to do a runtime include on 1.0.7 along with an excludes on 1.0.4 of grails.datastore.core, but that's not working - I'll try your suggestion next. It seems that the JDK 1.5 issue also exists with commons-dbcp. I'm not sure where this dependency is coming from, in the ivy-dependency report it's saying from organization org.grails.internal requires commons-dbcp 1.4. If you look at http://commons.apache.org/dbcp/ it says that 1.4 only works with jdk 1.6. Tried adding 'org.grails:grails-datastore-core:1.0.4.RELEASE' to my BuildConfig excludes but it's still there. Ideas?
Hide
Daniel Chapman added a comment -

So this is where I'm stuck in deploying to WLS, I can't figure out how to force the compile to downgrade commons-dbcp to 1.3 from 1.4.

Can we reopen this ticket?

Here's the log output, it's the first thing I see after Weblogic is ready to start deploying the war:

<May 17, 2012 5:00:39 PM MDT> <Warning> <HTTP> <BEA-101162> <User defined listener org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener failed: org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: org.apache.commons.dbcp.BasicDataSource.
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: org.apache.commons.dbcp.BasicDataSource
at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:118)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:458)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
Truncated. see log file for complete stacktrace

Show
Daniel Chapman added a comment - So this is where I'm stuck in deploying to WLS, I can't figure out how to force the compile to downgrade commons-dbcp to 1.3 from 1.4. Can we reopen this ticket? Here's the log output, it's the first thing I see after Weblogic is ready to start deploying the war: <May 17, 2012 5:00:39 PM MDT> <Warning> <HTTP> <BEA-101162> <User defined listener org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener failed: org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: org.apache.commons.dbcp.BasicDataSource. org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: org.apache.commons.dbcp.BasicDataSource at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:118) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:458) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Unknown Source) Truncated. see log file for complete stacktrace
Hide
Lari Hotari added a comment -

commons-dbcp 1.3 gets used when grails.project.target.level==1.5

Do you have these settings in BuildConfig.groovy?

grails.project.target.level = 1.5
grails.project.source.level = 1.5

Did you add this to BuildConfig.groovy dependencies? (it should be defined in "compile" scope since that's where it's defined in Grails.)

compile("org.grails:grails-datastore-gorm:1.0.7.RELEASE", "org.grails:grails-datastore-simple:1.0.7.RELEASE", "org.grails:grails-datastore-core:1.0.7.RELEASE") {
                transitive=false
        }

Run "grails -refresh-dependencies clean; grails compile; grails dependency-report" to verify that correct versions of grails-datastore-gorm, -simple & -core + commons-dbcp get resolved.

Show
Lari Hotari added a comment - commons-dbcp 1.3 gets used when grails.project.target.level==1.5 Do you have these settings in BuildConfig.groovy?
grails.project.target.level = 1.5
grails.project.source.level = 1.5
Did you add this to BuildConfig.groovy dependencies? (it should be defined in "compile" scope since that's where it's defined in Grails.)
compile("org.grails:grails-datastore-gorm:1.0.7.RELEASE", "org.grails:grails-datastore-simple:1.0.7.RELEASE", "org.grails:grails-datastore-core:1.0.7.RELEASE") {
                transitive=false
        }
Run "grails -refresh-dependencies clean; grails compile; grails dependency-report" to verify that correct versions of grails-datastore-gorm, -simple & -core + commons-dbcp get resolved.
Hide
Daniel Chapman added a comment -

Hi - Thanks again for your help with this.
So commons-dbcp is at 1.3 and only Evictions I see in IVY report are the two datastore evictions from 1.0.4 to 1.0.7 as expected. Now I'm getting a diff ClassDef error. Here are the first two messages and then relative snippits from the enormous stack trace:

<May 21, 2012 11:48:39 AM MDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
2012-05-21 11:48:48,753 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [HibernateGrailsPlugin]!
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:458)
....
....
Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [HibernateGrailsPlugin]!
... 34 more
Caused by: java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/orm/hibernate/HibernateDatastore : org/grails/datastore/mapping/core/AbstractDatastore
...
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:40)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
at java.lang.Class.getDeclaredMethods(Class.java:1763)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
at HibernateGrailsPlugin.<init>(HibernateGrailsPlugin.groovy:45)
...

Seems like progress. Poor visibility into what the problem is with AbstractDatastore....

Anything you want me to try?

Show
Daniel Chapman added a comment - Hi - Thanks again for your help with this. So commons-dbcp is at 1.3 and only Evictions I see in IVY report are the two datastore evictions from 1.0.4 to 1.0.7 as expected. Now I'm getting a diff ClassDef error. Here are the first two messages and then relative snippits from the enormous stack trace: <May 21, 2012 11:48:39 AM MDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> 2012-05-21 11:48:48,753 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [HibernateGrailsPlugin]! at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:458) .... .... Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [HibernateGrailsPlugin]! ... 34 more Caused by: java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/orm/hibernate/HibernateDatastore : org/grails/datastore/mapping/core/AbstractDatastore ... at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:40) at java.lang.Class.privateGetDeclaredMethods(Class.java:2395) at java.lang.Class.getDeclaredMethods(Class.java:1763) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at HibernateGrailsPlugin.<init>(HibernateGrailsPlugin.groovy:45) ... Seems like progress. Poor visibility into what the problem is with AbstractDatastore.... Anything you want me to try?
Hide
Lari Hotari added a comment -

Daniel, Can you check the content of the war file? What jar files are there under WEB-INF/lib? Is grails-datastore 1.0.7.RELEASE used or do you see any 1.0.4 jar files?

I got 3 evictions for grails-datastore related dependencies. Do you have all 3 specified in BuildConfig.groovy's dependencies:

compile("org.grails:grails-datastore-gorm:1.0.7.RELEASE", "org.grails:grails-datastore-simple:1.0.7.RELEASE", "org.grails:grails-datastore-core:1.0.7.RELEASE") {
   transitive=false
}
Show
Lari Hotari added a comment - Daniel, Can you check the content of the war file? What jar files are there under WEB-INF/lib? Is grails-datastore 1.0.7.RELEASE used or do you see any 1.0.4 jar files? I got 3 evictions for grails-datastore related dependencies. Do you have all 3 specified in BuildConfig.groovy's dependencies:
compile("org.grails:grails-datastore-gorm:1.0.7.RELEASE", "org.grails:grails-datastore-simple:1.0.7.RELEASE", "org.grails:grails-datastore-core:1.0.7.RELEASE") {
   transitive=false
}
Hide
Daniel Chapman added a comment -

OOPS! - My screen was at perfect width to see exactly two exclusions in your compile entry above.

Sorry about that. Trying again.

Show
Daniel Chapman added a comment - OOPS! - My screen was at perfect width to see exactly two exclusions in your compile entry above. Sorry about that. Trying again.
Hide
Daniel Chapman added a comment -

That did the trick it seems. But I have some weird artifact here - my default grails home page doesn't load.... no log msgs or anything either.

I CAN get to one of my controller list pages, and do everything there is to do... but that default home will not load.

Also wanted to mention - this project started as a grails 1.3.7 project now running as grails 2.0.3.

I can see that it's listed in the war file views, and in classes I see the gsp compilation of index page.... Only thing I see in weblogic is:
####<May 21, 2012 5:42:09 PM MDT> <Info> <ServletContext-/titan> <lxdnd968> <titan1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1337643729265> <BEA-000000> <Initializing Spring FrameworkServlet 'gsp'>
####<May 21, 2012 5:42:09 PM MDT> <Info> <ServletContext-/titan> <lxdnd968> <titan1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1337643729265> <BEA-000000> <GSP servlet initialized>
####<May 21, 2012 5:42:09 PM MDT> <Info> <ServletContext-/titan> <lxdnd968> <titan1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1337643729307> <BEA-000000> <GroovyPagesServlet: "/index.gsp" not found>

At least we're past the DB issue and my controllers work now. Should I look for/submit new Jira for this last issue? The title still sort of captures my issue I believe...
Thanks,
Dan C.

Show
Daniel Chapman added a comment - That did the trick it seems. But I have some weird artifact here - my default grails home page doesn't load.... no log msgs or anything either. I CAN get to one of my controller list pages, and do everything there is to do... but that default home will not load. Also wanted to mention - this project started as a grails 1.3.7 project now running as grails 2.0.3. I can see that it's listed in the war file views, and in classes I see the gsp compilation of index page.... Only thing I see in weblogic is: ####<May 21, 2012 5:42:09 PM MDT> <Info> <ServletContext-/titan> <lxdnd968> <titan1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1337643729265> <BEA-000000> <Initializing Spring FrameworkServlet 'gsp'> ####<May 21, 2012 5:42:09 PM MDT> <Info> <ServletContext-/titan> <lxdnd968> <titan1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1337643729265> <BEA-000000> <GSP servlet initialized> ####<May 21, 2012 5:42:09 PM MDT> <Info> <ServletContext-/titan> <lxdnd968> <titan1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1337643729307> <BEA-000000> <GroovyPagesServlet: "/index.gsp" not found> At least we're past the DB issue and my controllers work now. Should I look for/submit new Jira for this last issue? The title still sort of captures my issue I believe... Thanks, Dan C.
Hide
Lari Hotari added a comment -

Is your "home page" a GSP called grails-app/views/index.gsp ? In Grails 2.0 there was a change that you cannot access GSPs under grails-app/views directly any more (GRAILS-7542). If that's the case, you can move the index.gsp GSP to the web-app directory.

There seems to be a Jira issue about this problem already: GRAILS-8767 . I'm not sure if it's a real problem or just caused by the GRAILS-7542 change.

Show
Lari Hotari added a comment - Is your "home page" a GSP called grails-app/views/index.gsp ? In Grails 2.0 there was a change that you cannot access GSPs under grails-app/views directly any more (GRAILS-7542). If that's the case, you can move the index.gsp GSP to the web-app directory. There seems to be a Jira issue about this problem already: GRAILS-8767 . I'm not sure if it's a real problem or just caused by the GRAILS-7542 change.
Hide
Lari Hotari added a comment -

Daniel, there is a workaround for your problem.

Show
Lari Hotari added a comment - Daniel, there is a workaround for your problem.
Hide
Daniel Chapman added a comment -

Sorry to have all the issues... Still pretty new regarding the magic parts
The workaround worked for the default index.gsp, How do I get the rest of the index actions to work?

One interesting thing to note is that where I don't define anything in the controller for index, it works, and where I have a redirect or something - it doesn't work:

Doesn't work:
CmsEnvController:
def index = { log.debug("index") //Doesn't print redirect(action: "list", params: params) }

Does work:
DonwloadsController:
def index = { //nothing, default to index.gsp }

I'll attach the log output for when I click on the CmsEnvController from the home page (which goes to index).

Show
Daniel Chapman added a comment - Sorry to have all the issues... Still pretty new regarding the magic parts The workaround worked for the default index.gsp, How do I get the rest of the index actions to work? One interesting thing to note is that where I don't define anything in the controller for index, it works, and where I have a redirect or something - it doesn't work: Doesn't work: CmsEnvController: def index = { log.debug("index") //Doesn't print redirect(action: "list", params: params) } Does work: DonwloadsController: def index = { //nothing, default to index.gsp } I'll attach the log output for when I click on the CmsEnvController from the home page (which goes to index).
Hide
Daniel Chapman added a comment -

Can't attach - probably because this issue has been closed.....

Show
Daniel Chapman added a comment - Can't attach - probably because this issue has been closed.....
Hide
Daniel Chapman added a comment -

in CmsEnvController above, there's a carriage return after "//Doesnt' print".
The next linke would be a redirect.

So I'm not noticing that this controller method gets called at all when I go to index url.

Show
Daniel Chapman added a comment - in CmsEnvController above, there's a carriage return after "//Doesnt' print". The next linke would be a redirect. So I'm not noticing that this controller method gets called at all when I go to index url.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved:
    Last Reviewed: