Rails 3, JRuby and Warbler - ruby-on-rails

I am trying to deploy a Rails 3 application on Tomcat 6.0.24. The JRuby version is 1.6.2 (ruby-1.8.7-p330) and Warbler is 1.3.0. I use bundler to handle the gem dependencies.
Checked the WEB-INF/lib folder and the following jars are present:
jruby-rack-1.0.9.jar
jruby-core-1.6.2.jar
jruby-stdlib-1.6.2.jar
But, however after the server starts, hitting the application results in the following exception:
javax.servlet.ServletException: Filter execution threw an exception
java.lang.NoClassDefFoundError: Could not initialize class com.kenai.jaffl.struct.Struct$Constants
com.kenai.jaffl.struct.Struct$Signed64.<init>(Struct.java:1074)
org.jruby.ext.posix.HeapStruct$Int64.<init>(HeapStruct.java:41)
org.jruby.ext.posix.LinuxHeapFileStat.<init>(LinuxHeapFileStat.java:35)
org.jruby.ext.posix.LinuxPOSIX.allocateStat(LinuxPOSIX.java:26)
org.jruby.ext.posix.LinuxPOSIX.stat(LinuxPOSIX.java:107)
org.jruby.ext.posix.LazyPOSIX.stat(LazyPOSIX.java:226)
org.jruby.RubyFileTest.directory_p(RubyFileTest.java:102)
org.jruby.RubyFileTest.directory_p(RubyFileTest.java:87)
org.jruby.RubyFileTest$FileTestFileMethods.directory_p(RubyFileTest.java:428)
org.jruby.RubyFileTest$FileTestFileMethods$s$1$0$directory_p.call(RubyFileTest$FileTestFileMethods$s$1$0$directory_p.gen:65535)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:282)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:139)
org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
org.jruby.ast.IfNode.interpret(IfNode.java:111)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:147)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:163)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:262)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:105)
org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:63)
org.jruby.ast.IfNode.interpret(IfNode.java:117)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:120)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:145)
org.jruby.runtime.callsite.SuperCallSite.cacheAndCall(SuperCallSite.java:286)
org.jruby.runtime.callsite.SuperCallSite.callBlock(SuperCallSite.java:70)
org.jruby.runtime.callsite.SuperCallSite.call(SuperCallSite.java:75)
org.jruby.ast.ZSuperNode.interpret(ZSuperNode.java:101)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104).....
Does that ring any bells?
[Answer Updated]: The issue was with the java implementation on the server. It was Open JDK. I switched it over to Sun Java 1.6.0_26 and everything started working :)

Not sure if this is a new bug or an old one. Consider googling the error or looking on http://bugs.jruby.org.
You might try setting -Djruby.native.enabled=false in the VM to use the pure-Java POSIX layer and avoid this error.

The issue was with the java implementation on the server. It was Open JDK. I switched it over to Sun Java 1.6.0_26 and everything started working

Related

ArgumentError: cannot interpret as DNS name: nil capybara

Hi all can anyone help me to resolve the issue
'ArgumentError: cannot interpret as DNS name: nil'
The error is coming when doing capybara selenium integration testing in rails 4
here I am using jruby-1.7.9 and ruby version inside JRuby is 2.0.0p195
already I had used the Ruby version is 1.9.7 at that time I faced the error
'cant connect to chrome driver error'
in pure ruby like without using JRuby its the integration testing is working. but my application is in JRuby. and I am using ubuntu platform.
So anyone have any solution on this. what should I do to resolve this??
Here iam adding the exception backtrace
["/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:1181:in create'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:1027:ingenerate_candidates'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:1052:in resolv'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:518:ineach_resource'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:411:in each_address'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:120:ineach_address'", "org/jruby/RubyArray.java:1613:in each'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:119:ineach_address'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:97:in getaddress'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/resolv.rb:48:ingetaddress'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/1.9/resolv-replace.rb:10:in getaddress'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/1.9/resolv-replace.rb:22:ininitialize'", "org/jruby/RubyIO.java:1178:in open'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/net/http.rb:882:inconnect'", "org/jruby/ext/timeout/Timeout.java:144:in timeout'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/net/http.rb:881:inconnect'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/net/http.rb:866:in do_start'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/net/http.rb:855:instart'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/2.0/net/http.rb:582:in start'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara/server.rb:81:inresponsive?'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara/server.rb:97:in boot'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara/session.rb:72:ininitialize'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara.rb:324:in current_session'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara/dsl.rb:47:inpage'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara/dsl.rb:52:in visit'", "/media/sidharthan/NewVolume/sidharthan_fooddev/foodapp/webapp/food/test/test_helper.rb:115:inIntegrationTest'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/capybara-2.9.1/lib/capybara.rb:67:in configure'", "/media/sidharthan/NewVolume/sidharthan_fooddev/foodapp/webapp/food/test/test_helper.rb:102:inIntegrationTest'", "org/jruby/RubyBasicObject.java:1565:in instance_exec'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:446:inmake_lambda'", "org/jruby/RubyProc.java:271:in call'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:192:insimple'", "org/jruby/RubyProc.java:271:in call'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:504:incall'", "org/jruby/RubyArray.java:1613:in each'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:504:incall'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:92:in __run_callbacks__'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:782:in_run_setup_callbacks'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:81:in run_callbacks'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activesupport-4.2.6/lib/active_support/testing/setup_and_teardown.rb:41:inbefore_setup'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/activerecord-4.2.6/lib/active_record/fixtures.rb:827:in before_setup'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:105:inrun'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:204:in capture_exceptions'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:104:inrun'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:255:in time_it'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:103:inrun'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:348:in on_signal'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:275:inwith_info_handler'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest/test.rb:102:in run'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:799:inrun_one_method'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:322:in run_one_method'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:310:inrun'", "org/jruby/RubyArray.java:1613:in each'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:309:inrun'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:348:in on_signal'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:335:inwith_info_handler'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:308:in run'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:158:in__run'", "org/jruby/RubyArray.java:2409:in map'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:158:in__run'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:135:in run'", "/home/sidharthan/.rbenv/versions/jruby-1.7.9/lib/ruby/gems/shared/gems/minitest-5.9.1/lib/minitest.rb:62:inautorun'"]
Thanks in advance
From the stacktrace you can see it's erring inside https://github.com/teamcapybara/capybara/blob/2.9.1/lib/capybara/server.rb#L81 - which is while Capybara is waiting for the application to be tested to start up.
This could mean you have set Capybara.server_host or Capybara.server_port incorrectly. Without the real code you're running that generates the stacktrace it's impossible to say.
You also probably want to update to the latest 2.x version of Capybara -- 2.9.1 is really old.

Grails 3 schemaExport contains warning with FileNotFoundException that looks for sitemesh.xml

When schemaExport is executed using Gradle for a Grails 3.3 application, below warning is in the log though ddl.sql is created. According to Grails 3 documentation sitemesh.xml is removed so naturally the file wouldn't be available. Am I missing something?
Tools and version: Grails 3.3.0, Gradle 3.3, Hibnerate 5, Sybase ASE 15.7
2017-09-13 12:50:45.264 WARN --- [ main] o.s.mock.web.MockServletContext : Couldn't determine real path of resource class path resource [src/main/webapp/WEB-INF/sitemesh.xml]
java.io.FileNotFoundException: class path resource [src/main/webapp/WEB-INF/sitemesh.xml] cannot be resolved to URL because it does not exist
at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:187)
at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:49)
at org.springframework.mock.web.MockServletContext.getRealPath(MockServletContext.java:458)
at org.grails.web.sitemesh.Grails5535Factory.<init>(Grails5535Factory.java:78)
at org.grails.web.servlet.view.SitemeshLayoutViewResolver.loadSitemeshConfig(SitemeshLayoutViewResolver.java:105)
at org.grails.web.servlet.view.SitemeshLayoutViewResolver.init(SitemeshLayoutViewResolver.java:67)
at org.grails.web.servlet.view.SitemeshLayoutViewResolver.onApplicationEvent(SitemeshLayoutViewResolver.java:146)
at org.grails.web.servlet.view.SitemeshLayoutViewResolver.onApplicationEvent(SitemeshLayoutViewResolver.java:42)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at grails.boot.GrailsApp.run(GrailsApp.groovy:83)
at grails.ui.command.GrailsApplicationContextCommandRunner.run(GrailsApplicationContextCommandRunner.groovy:55)
at grails.ui.command.GrailsApplicationContextCommandRunner.main(GrailsApplicationContextCommandRunner.groovy:102)
This is just a WARN message. The underlying spring class is looking for it and just saying it's not there. The default the log level does not show this output.
You can safely ignore the message or adjust your logger to not show it.
https://github.com/spring-projects/spring-framework/blob/master/spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java#L460

solr is not up when we install alfresco 5.1 and solr in different tomcat instances

I have installed alfresco & solr in different tomcat instances using below docs url. alfresco share was running file but when i run solr instance and see below error.
http://docs.alfresco.com/5.1/tasks/solr4-install-config.html
generated secure keys for Solr communication.
http://docs.alfresco.com/5.1/tasks/generate-keys-solr4.html
2016-07-18 13:25:30,037 ERROR [solr.tracker.AbstractTracker] [SolrTrackerSche
ler_Worker-14] Tracking failed
org.alfresco.error.AlfrescoRuntimeException: 06180034 api/solr/aclchangesets
turn status:403
at org.alfresco.solr.client.SOLRAPIClient.getAclChangeSets(SOLRAPIClie
.java:162)
at org.alfresco.solr.tracker.AclTracker.checkRepoAndIndexConsistency(A
Tracker.java:335)
at org.alfresco.solr.tracker.AclTracker.trackRepository(AclTracker.jav
313)
at org.alfresco.solr.tracker.AclTracker.doTrack(AclTracker.java:104)
at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.jav
185)
at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:47)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool
ava:563)
2016-07-18 13:25:30,029 ERROR [solr.tracker.AbstractTracker] [SolrTrackerSche
ler_Worker-6] Tracking failed
org.alfresco.error.AlfrescoRuntimeException: 06180033 api/solr/aclchangesets
turn status:403
at org.alfresco.solr.client.SOLRAPIClient.getAclChangeSets(SOLRAPIClie
.java:162)
at org.alfresco.solr.tracker.AclTracker.checkRepoAndIndexConsistency(A
Tracker.java:335)
at org.alfresco.solr.tracker.AclTracker.trackRepository(AclTracker.jav
313)
at org.alfresco.solr.tracker.AclTracker.doTrack(AclTracker.java:104)
at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.jav
185)
at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:47)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool
ava:563)
2016-07-18 13:25:30,056 ERROR [solr.tracker.AbstractTracker] [SolrTrackerSche
ler_Worker-11] Tracking failed
org.alfresco.error.AlfrescoRuntimeException: 06180036 GetModelsDiff return st
us is 403
at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.
va:1157)
at org.alfresco.solr.tracker.ModelTracker.trackModelsImpl(ModelTracker
ava:249)
at org.alfresco.solr.tracker.ModelTracker.trackModels(ModelTracker.jav
207)
at org.alfresco.solr.tracker.ModelTracker.doTrack(ModelTracker.java:16
at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.jav
185)
at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:47)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool
ava:563)
I had a similar problem which has been solved by changing
clientAuth="false"
to
clientAuth="want"
in Tomcat 7 server.xml
(credit goes to https://issues.alfresco.com/jira/browse/ACE-4551?focusedCommentId=424920&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-424920)

Websphere 8.5 - JSF webapp context init error: cleanupInitMaps

I have got a JSF 2.1 web application developed with mojarra 2.1.17 distibution which run with any problems on JBoss 6.1 container: now i have to change application server and I have to use websphere AS 8.5 which were born with MyFaces JSF 2 distibution. I'm trying to deploy and start my webapp ignoring MyFaces and using Mojarra, configuring my EAR as IBM official guide shows, configuring shared lib with mojarra dist included, link it to a new classloader created exclusively for my server1 instance of WAS 8.5. It doesn't work at all and when I deploy my webapp i get this stacktrace when WAS try to start the application:
com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: null
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:432)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1175)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:774)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2182)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:994)
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:502)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)
Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: null
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:759)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
... 14 more
Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: null
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:176)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)
... 16 more
Caused by: java.lang.NullPointerException
at com.sun.faces.config.InitFacesContext.cleanupInitMaps(InitFacesContext.java:283)
at com.sun.faces.config.InitFacesContext.<init>(InitFacesContext.java:107)
at com.sun.faces.config.FacesInitializer.onStartup(FacesInitializer.java:115)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:613)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:409)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
... 17 more
I debugged cleanupInitMaps() method of mojarra dist too and i saw that it tries to get two Map of kind of variable from FacesContext called threadInitContext and initContextServletContext but gets null:
Field threadMap = FacesContext.class.getDeclaredField("threadInitContext");
and
Field initContextMap = FacesContext.class.getDeclaredField("initContextServletContext");
How is this caused and how can I solve it?
Ok, i solved it !!
first of all i set classloader of my server instance to PARENT_LAST + restart. Then i followed these steps:
1) put Mojarra lib into simple shared library;
2) deploy ear with jsf web module inside and before start application from console, i linked shared lib to it and to all modules inside ear;
3) i set application classloader to PARENT_LAST;
4) start app and it works !!
That's all !!
I faced the very same issue. In my case problem was solved by removing javax.faces dependency from .war artifact. It seems to be a conflict between javax.faces implementation by WS and dependency in my .war file. If you using maven then you can set scope for youre javax.faces dependency somthing like this:
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.2.13</version>
<scope>provided</scope>
</dependency>
See also: Nullpointer exception at com.sun.faces.config.InitFacesContext.cleanupInitMaps

Grails 2.0 Externalized Config in Production, cannot access application - HTTP 404

when I've upgraded my Grails app to Grails 2.0.3, the application isn't accessible in production Tomcat.
When I run the app in development or even using "grails prod run-war", the application works properly. But when I move this app to Tomcat (tested on Tomcat 6 and 7), the app is not accessible anymore. It loads properly but when I go to http://localhost:8080/appName I receive HTTP 404.
The logs are empty, therefore I cannot find out where is the problem. When I remove externalized config loading from Config.groovy, the application works! Really weird. Config.groovy:
grails.config.locations = ["file:/home/user/application_homes/app_home/app-config.properties"]
Did you faced same issue? Or were there any changes from Grails 1.3.7 to Grails 2.0.3 which could affect this?
Thanks for any advice!
i'm having the exact same issue as you it would appear...
I get nothing in the logs...
It just doesn't start up... fails with:
0/04/2012 2:17:36 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
20/04/2012 2:17:36 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/abcd] startup failed due to previous errors
Seems to work when we use a classpath spring format in the
grails.config.locations section.
we have also just gone to grails 2.0.3, could it be a bug?
Also experiencing the same problems. We actually have two methods for specifying the grails.configuration.locations, using System/Env Variables or a -Dconfig.file= definition. Using the environment variable load, this causes a line of
classpath:the-config-file.properties
If a -Dconfig.file is specified, it uses the file based evaluator:
file:/full-path/the-config.file.properties
When using the System/Env method, the configuration loads fine! As soon as we shift to using the 'file' lookup, Tomcat fails to start.
It looks to be failing just after creating the internalConfigurationAnnotationProcessor bean:
2012-04-22 22:35:53,514 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext] - <Bean factory for org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext#17bcd4: org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory#752144: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,....<--- (left out the big list of others)
2012-04-22 22:35:53,538 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'>
2012-04-22 22:35:53,538 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'>
2012-04-22 22:35:53,547 (main) DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Returning cached instance of singleton bean 'grailsApplication'>
2012-04-22 22:35:53,547 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Eagerly caching bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' to allow for resolving potential circular references>
2012-04-22 22:35:53,548 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Finished creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'>
2012-04-22 22:35:53,667 (main) INFO [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Destroying singletons in org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory#752144
22/04/2012 10:35:53 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
The oddest part is just changing from a classpath:<> definition to a file:<> is causing this problem. I have put in debug statements into the grails Config.groovy file and the contents of the files are read ok.

Resources