I installed rhodes as per the tutorial on the website and i also installed rhosync
Now when i try to start rhosync then i get error
[12:06:07 PM 2011-02-23] Rhosync Server v2.1.1 started...
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- application (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from config.ru:27:in `block in <main>'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `<main>'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:100:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/bin/rackup:4:in `<top (required)>'
from /usr/local/bin/rackup:19:in `load'
from /usr/local/bin/rackup:19:in `<main>'
[EOF - dtach terminating]
Is this a Path Issue??...If it is then how to set correct path???
If you are using ruby 1.9.1+ then you have to change your config.ru
replace "require 'application'" with require './application'
because "$: doesn't include the current direcotry."
http://www.ruby-lang.org/en/news/2010/08/18/ruby-1-9.2-released/
Try switching to Ruby version 1.8.7
Please check the following things :
make sure you have started redis.
you are in same directory as your application
Cheers
Abhishek Nalwaya
Best option is to install rhosync in windows with the msi installer (download page), then start the redis.
Related
I am using SUPER DEV MODE to run my existing project (built using GWT SDk 2.5.0).
Everything works fine,but only problem is that I am unable to make calls to my RPCs.I tried the solution i.e setting -Dgwt.codeserver.port=9876 in VM arguments,but still I am unable to call RPCs.It gives me following exception:-
[WARN] springGwtRemoteServiceServlet: An IncompatibleRemoteServiceException was thrown while processing this call.
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: Type 'com.xxx.appcore.client.ui.ActionMode' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer. For security purposes, this type will not be deserialized.
at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:323)
at org.spring4gwt.server.SpringGwtRemoteServiceServlet.processCall(SpringGwtRemoteServiceServlet.java:32)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'com.lbtmind.appcore.client.ui.ActionMode' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer. For security purposes, this type will not be deserialized.
at com.google.gwt.user.server.rpc.impl.LegacySerializationPolicy.validateDeserialize(LegacySerializationPolicy.java:127)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:651)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.readObject(ServerSerializationStreamReader.java:567)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader$ValueReader$8.readValue(ServerSerializationStreamReader.java:140)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java:425)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeClass(ServerSerializationStreamReader.java:807)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeImpl(ServerSerializationStreamReader.java:878)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:662)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.readObject(ServerSerializationStreamReader.java:567)
at com.google.gwt.user.server.rpc.core.java.util.Collection_ServerCustomFieldSerializerBase.deserialize(Collection_ServerCustomFieldSerializerBase.java:38)
at com.google.gwt.user.server.rpc.core.java.util.ArrayList_ServerCustomFieldSerializer.deserialize(ArrayList_ServerCustomFieldSerializer.java:40)
at com.google.gwt.user.server.rpc.core.java.util.ArrayList_ServerCustomFieldSerializer.deserializeInstance(ArrayList_ServerCustomFieldSerializer.java:54)
at com.google.gwt.user.server.rpc.core.java.util.ArrayList_ServerCustomFieldSerializer.deserializeInstance(ArrayList_ServerCustomFieldSerializer.java:33)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeImpl(ServerSerializationStreamReader.java:859)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:662)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.readObject(ServerSerializationStreamReader.java:567)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader$ValueReader$8.readValue(ServerSerializationStreamReader.java:140)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java:425)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeClass(ServerSerializationStreamReader.java:807)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeImpl(ServerSerializationStreamReader.java:878)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:662)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.readObject(ServerSerializationStreamReader.java:567)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader$ValueReader$8.readValue(ServerSerializationStreamReader.java:140)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java:425)
at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:312)
... 22 more
Please provide me the solution to solve this problem.
Thanx well in advance..!!
-Dgwt.codeserver.port has only been introduced in GWT 2.6.
For older versions, you can manually copy the serialization policies from the CodeServer to your server hosting the servlets; or override doGetSerializationPolicy to load it via HTTP from the CodeServer (at http://localhost:9876/). Have a look at the code from a 2.6+ version of GWT for an example of how to do it.
…though honestly it's probably easier to just update to GWT 2.6.1 or, even better, 2.7.0.
Check your class com.lbtmind.appcore.client.ui.ActionMode.
Either it doesn't implement java.lang.Serializable or com.google.gwt.user.client.isSerializable
or it has no public no-arg constructor
or your widgetset needs to be recompiled
or you need to update the WEB-INF/lib/gwt-servlet.jar to the version you built with
I am working with Liferay portal on weblogic server and I have problems to debug with eclipse.
I use Eclipse Juno with OEPE Pack extension, Oracle Weblogic Server 11gR1 (10.3.5) and Liferay 6.1.
When i start without debug options i launch weblogic admin server OK and liferay server OK.
But when I change local domain file setDomainEnv.sh with this lines
set JAVA_DEBUG=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=%DEBUG_PORT%,server=y,suspend=n -Djava.compiler=NONE
set JAVA_OPTIONS=%JAVA_OPTIONS% %enableHotswapFlag% -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole.`
Weblogic serve starts OK
Server Log
Listening for transport dt_socket at address: 8453
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Oracle JRockit(R) (build R28.1.3-11-141760-1.6.0_24-20110301-1429-windows-ia32, compiled mode)
Starting WLS with line:
E:\Oracle\MIDDLE~1\JROCKI~1.2-4\bin\java -jrockit -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n -Djava.compiler=NONE
-Xms512m -Xmx512m -Dweblogic.Name=Admin -Djava.security.policy=E:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy -Dweblogic.ProductionModeEn
abled=true -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole... -Dplatform.home=E:\Or
acle\MIDDLE~1\WLSERV~1.3 -Dwls.home=E:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=E:\Oracle\MIDDLE~1\WLSERV~1.3\server -Ddomain.home=E:\WLS\DO
MINI~1\LOCAL_~1 -Does.client.home=E:\Oracle\MIDDLE~1\OES -Doracle.home=E:\Oracle\MIDDLE~1\OES -Doracle.security.jps.config=E:\WLS\DOMINI~1\LOCAL_~1\co
nfig\oeswlssmconfig\Admin\jps-config.xml -Dweblogic.management.discover=true -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConso
le=false -Dweblogic.ext.dirs=E:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_oepe180\profiles\def
ault\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_ocp360\profiles\default\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_jdev1111\profiles\d
efault\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_adfr1111\profiles\default\sysext_manifest_classpath weblogic.Server
Listening for transport dt_socket at address: 8453
but when I start liferay server fails
Liferay script
set DOMAIN_HOME=E:\WLS\Dominio_wls11\local_domain1
call "%DOMAIN_HOME%\bin\startManagedWebLogic.cmd" liferay %*)
Server log
starting weblogic with Java version:
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
[ERROR] aborted
JRockit aborted: Unknown error (50)
Starting WLS with line:
E:\Oracle\MIDDLE~1\JROCKI~1.2-4\bin\java -jrockit -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n -Djava.compiler=NONE -Xms512m -Xmx512m -Dweblogic.Name=liferay -Djava.security.policy=E:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy -Dweblogic.ProductionModeEnabled=true -Dweblogic.security.SSL.trustedCAKeyStore="E:\Oracle\Middleware\wlserver_10.3\server\lib\cacerts" -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole... -Dplatform.home=E:\Oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=E:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=E:\Oracle\MIDDLE~1\WLSERV~1.3\server -Ddomain.home=E:\WLS\DOMINI~1\LOCAL_~1 -Does.client.home=E:\Oracle\MIDDLE~1\OES -Doracle.home=E:\Oracle\MIDDLE~1\OES -Doracle.security.jps.config=E:\WLS\DOMINI~1\LOCAL_~1\config\oeswlssmconfig\liferay\jps-config.xml -Dweblogic.management.discover=false -Dweblogic.management.server=http://localhost:9819 -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConsole=false -Dweblogic.ext.dirs=E:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_oepe180\profiles\default\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_ocp360\profiles\default\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_adfr1111\profiles\default\sysext_manifest_classpath weblogic.Server
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
[ERROR] aborted
JRockit aborted: Unknown error (50)
Why does liferay server fail?
I think that i need to configurate servers in eclipse for connect to weblogic in debug mode. How could i do this?
I have seen that i don´t have Liferay 6.1 server for weblogic in the server list only Liferay 6.1 server to Tomcat 6 o 7. I try to install Liferay IDE plugin but it fails due to different conflicts with OEPE Pack.
You're using the same debug port (8453) for both JVMs. "Address already in use" means that Java cannot create a socket on this port because another socket occupies it.
EDIT: I got the application working using TorqueBox, so I guess the problem is related to Trinidad. However, I think my guestion about the preferred way to run Sinatra applications is still valid.
I am using JRuby, Bundler, and modular style. Here's my application code:
# myapp.rb
class MyApp < Sinatra::Base
configure :development do
register Sinatra::Reloader
end
set :server, 'trinidad'
set :environment, :development
set :logging, true
#...
end
# config.ru
require 'bundler/setup'
Bundler.require(:default)
$: << File.dirname(__FILE__)
require 'myapp'
run MyApp
# Gemfile
source 'http://rubygems.org'
gem 'rack'
gem 'sinatra', :require => 'sinatra/base'
gem 'sinatra-contrib', :require => 'sinatra/reloader'
gem 'coffee-script'
gem 'neography'
gem 'gon-sinatra'
gem 'sass'
gem 'trinidad'
What is the proper way (i.e. what kind of command) to launch my application? I'm using Trinidad, because I read that it's good solution for JRuby applications (I couldn't get TorqueBox to work). Currently I'm running my app by 'trinidad config.ru', but it throws following kind error messages:
application error
org.jruby.rack.RackInitializationException: no such file to load -- bundler/setup
from org/jruby/RubyKernel.java:991:in `require'
from /home/myhome/.rvm/rubies/jruby-1.7.0.preview1/lib/ruby/shared/rubygems/custom_require.rb:36:in `require'
from /home/myhome/RubymineProjects/myapp/config.ru:1:in `(root)'
from org/jruby/RubyBasicObject.java:1818:in `instance_eval'
from jar:file:/home/myhome/.rvm/gems/jruby-1.7.0.preview1/gems/jruby-rack-1.1.9/lib/jruby-rack-1.1.9.jar!/vendor/rack-1.4.1/rack/builder.rb:51:in `initialize'
from /home/myhome/RubymineProjects/myapp/config.ru:1:in `(root)'
at org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:224)
at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:58)
at org.jruby.rack.PoolingRackApplicationFactory.createApplication(PoolingRackApplicationFactory.java:323)
at org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:171)
at org.jruby.rack.DefaultRackDispatcher.getApplication(DefaultRackDispatcher.java:27)
at org.jruby.rack.AbstractRackDispatcher.process(AbstractRackDispatcher.java:32)
at org.jruby.rack.AbstractServlet.service(AbstractServlet.java:37)
at org.jruby.rack.AbstractServlet.service(AbstractServlet.java:43)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- bundler/setup
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:991)
at Kernel.require(/home/myhome/.rvm/rubies/jruby-1.7.0.preview1/lib/ruby/shared/rubygems/custom_require.rb:36)
at RUBY.(root)(/home/myhome/RubymineProjects/myapp/config.ru:1)
at org.jruby.RubyBasicObject.instance_eval(org/jruby/RubyBasicObject.java:1818)
at RUBY.initialize(jar:file:/home/myhome/.rvm/gems/jruby-1.7.0.preview1/gems/jruby-rack-1.1.9/lib/jruby-rack-1.1.9.jar!/vendor/rack-1.4.1/rack/builder.rb:51)
at RUBY.(root)(/home/myhome/RubymineProjects/myapp/config.ru:1)
ignoring null application
I'm using versions 1.4.1 of Trinidad and Rack, 1.7.0.preview1 of JRuby, and 1.3.3 of Sinatra.
If I run 'bundle exec trinidad config.ru', I get following errors:
application error
org.jruby.rack.RackInitializationException: Valid types are [:development, :runtime],
from /home/myhome/.rvm/rubies/jruby-1.7.0.preview1/lib/ruby/shared/rubygems/dependency.rb:45:in `initialize'
from /home/myhome/.rvm/rubies/jruby-1.7.0.preview1/lib/ruby/shared/rubygems/specification.rb:821:in `add_dependency_with_type'
from :1:in `'
from :1:in `'
from org/jruby/RubyKernel.java:1037:in `eval'
from org/jruby/RubyArray.java:1611:in `each'
from org/jruby/RubyArray.java:1611:in `each'
from org/jruby/RubyEnumerable.java:649:in `find_all'
from org/jruby/RubyKernel.java:991:in `require'
from org/jruby/RubyKernel.java:991:in `require'
from org/jruby/RubyKernel.java:991:in `require'
at org.jruby.rack.DefaultRackApplicationFactory.createApplication(DefaultRackApplicationFactory.java:235)
at org.jruby.rack.DefaultRackApplicationFactory.newApplication(DefaultRackApplicationFactory.java:49)
at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:57)
at org.jruby.rack.PoolingRackApplicationFactory.createApplication(PoolingRackApplicationFactory.java:323)
at org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:171)
at org.jruby.rack.DefaultRackDispatcher.getApplication(DefaultRackDispatcher.java:27)
at org.jruby.rack.AbstractRackDispatcher.process(AbstractRackDispatcher.java:32)
at org.jruby.rack.AbstractServlet.service(AbstractServlet.java:37)
at org.jruby.rack.AbstractServlet.service(AbstractServlet.java:43)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.jruby.exceptions.RaiseException: (ArgumentError) Valid types are [:development, :runtime],
at Gem::Dependency.initialize(/home/myhome/.rvm/rubies/jruby-1.7.0.preview1/lib/ruby/shared/rubygems/dependency.rb:45)
at Gem::Specification.add_dependency_with_type(/home/myhome/.rvm/rubies/jruby-1.7.0.preview1/lib/ruby/shared/rubygems/specification.rb:821)
at RUBY.(:1)
at RUBY.(:1)
at org.jruby.RubyKernel.eval(org/jruby/RubyKernel.java:1037)
at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1611)
at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1611)
at org.jruby.RubyEnumerable.find_all(org/jruby/RubyEnumerable.java:649)
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:991)
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:991)
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:991)
ignoring null application
rubygems is not loaded by default (at least with jruby --1.8) thus you'll either add require 'rubygems' on top of the config.ru as JRuby (actually JRuby-Rack) loads your app in a separate "runtime" (kind of a new ruby process but inside the same JVM process) by default.
alternatively, you might as well run using rackup -s trinidad
As far as the CLI command to invoke your rack configuration and application, kares is right. Using "rackup" with "-s trinidad" is the way to go if you are not using Torquebox.
As far as the Ruby command to call your application from within your rack config, here is what I do.. Not sure if this applies in your situation, if this is what you're looking for, but it will help regardless of HTTP handler:
You have MyApp, which mixes in Sinatra::Base. If you trim that class down to only configure your environment, and run "before do" and "after do" for every pageload... but not actually handle and get/post calls; then you can create specialized classes which handle certain paths in your overall application. This uses Rack::Builder's map() method...
require 'myapp'
require 'mylanding'
require 'myauthentication'
require 'myautocomplete'
require 'mysearch'
#de run MyApp
map "/" do
run MyLanding #de Catch-all, which would have "get '/*' do" in it too.
end
map "/authentication/" do
run MyAuthentication
end
map "/autocomplete/" do
run MyAutocomplete
end
map "/search/" do
run MySearch
end
Then inside each My* class, do this:
class MyLanding < MyApp
get "/*" do
..handle landing.. or see what's in the splat.
end
end
class MyAuthentication < MyApp
get "/sign/in" do
..present sign-in..
end
post "/sign/in" do
..handle sign-in..
end
end
etc...
Your sub-classes have the overall MyApp treatment of every pageload, but add routes, such that /authentication/sign/in is handled by MyAuthentication's /sign/in, for example. It's a cool way of having somewhat focused sub-applications all using the same foundation: MyApp.
I trying to configure an XA DB2 DataSource, xa-datasource (based on http://community.jboss.org/wiki/SetUpADB2Datasource) using com.ibm.db2.jcc.DB2XADataSource class (local-tx-datasource works using the com.ibm.db2.jcc.DB2Driver). The target server is DB2 Connect V9.7
Actual xa-datasource config:
<xa-datasource>
<jndi-name>jdbc/DB2ServerDS</jndi-name>
<use-java-context>false</use-java-context>
<track-connection-by-tx>true</track-connection-by-tx>
<xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:db2://db2server:50000/FINDB</xa-datasource-property>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DB2ExceptionSorter</exception-sorter-class-name>
<xa-datasource-property name="DriverType">4</xa-datasource-property>
<check-valid-connection-sql>SELECT * FROM ACC.SETTINGS 1=2</check-valid-connection-sql>
<user-name>findbuser</user-name>
<password>findbuser</password>
<min-pool-size>2</min-pool-size>
<max-pool-size>10</max-pool-size>
<blocking-timeout-millis>10000</blocking-timeout-millis>
<type-mapping>DB2</type-mapping>
<no-tx-separate-pools/>
</xa-datasource>
and the following jar in the JBoss node lib directory:
db2umplugin.jar
db2policy.jar
db2dbgm.jar
db2jcc_license_cu.jar
db2jcc.jar
db2jcc4.jar
db2java.zip
db2jcc_license_cisuz.jar
but i'm getting the error:
Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][10389][12245][3.57.82] Failure in loading native library db2jcct2, java.lang.UnsatisfiedLinkError: no db2jcct2 in java.library.path: ERRORCODE=-4472, SQLSTATE=null
The driver for XA is trying to use native libraries, despite the fact that i'm using a JDBC Type 4 driver.
Why is the driver trying to use native libraries? Is there anything i need to add to my config?
The solution is not to use the URL to specify the connection settings.
<xa-datasource>
<jndi-name>jdbc/DB2ServerDS</jndi-name>
<use-java-context>false</use-java-context>
<track-connection-by-tx>true</track-connection-by-tx>
<xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DB2ExceptionSorter</exception-sorter-class-name>
<xa-datasource-property name="ServerName">db2server</xa-datasource-property>
<xa-datasource-property name="PortNumber">50000</xa-datasource-property>
<xa-datasource-property name="DatabaseName">FINDB</xa-datasource-property>
<xa-datasource-property name="DriverType">4</xa-datasource-property>
<xa-datasource-property name="User">findbuser</xa-datasource-property>
<xa-datasource-property name="Password">findbuser</xa-datasource-property>
<xa-datasource-property name="DriverType">4</xa-datasource-property>
<check-valid-connection-sql>SELECT * FROM ACC.SETTINGS 1=2</check-valid-connection-sql>
<user-name>findbuser</user-name>
<password>findbuser</password>
<min-pool-size>2</min-pool-size>
<max-pool-size>10</max-pool-size>
<blocking-timeout-millis>10000</blocking-timeout-millis>
<type-mapping>DB2</type-mapping>
<no-tx-separate-pools/>
</xa-datasource>
Credit to http://dev.wavemaker.com/forums/?q=node/3127
The correct JARs are
db2jcc_license_cu.jar
db2jcc4.jar
db2jcc_license_cisuz.jar
Should you get an error like:
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-5042, SQLSTATE= , SQLERRMC= ;1208;FINDBUSER;FINDB;QDB2; ; ; ;1208; , DRIVER=4.7.85)
check http://www-01.ibm.com/support/docview.wss?uid=swg21405243&myns=swgimgmt&mynp=OCSSEPGG&mync=R for the solution.
I hope this saves others some frustration and time.
I have actually figured this problem out, but it took me days, so I thought I would paste my solution here to aide others.
I am using Fedora 11, and in Eclipse I tried adding a Tomcat 6 server and starting it. I would get the following error:
'Starting Tomcat v6.0 Server at localhost' has encountered a problem.
Server Tomcat v6.0 Server at localhost failed to start.
Then in my console I got the following:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:54)
Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
... 1 more
Could not find the main class: org.apache.catalina.startup.Bootstrap. Program will exit.
I'll post the solution in an answer below.
I found the solution here: http://forums.opensuse.org/applications/391114-tomcat6-eclipse-not-working.html
In Eclipse, Open the "Server" tab.
Double click on the "Tomcat6" entry to see the configuration.
Then click on the "Open launch configuration" link in the "General information" block.
In the dialog, select the "Classpath" tab.
Click the "Add external jar" button.
Select the file "/usr/share/tomcat6/bin/tomcat-juli.jar"
Close the dialog.
Start tomcat 6 from Eclipse.
Hopefully posting it here will help some poor soul.
I copied the contents of the "C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf" directory to the "workspace\Servers\Tomcat v6.0 Server at localhost-config" directory for Eclipse. I refreshed the "Servers\Tomcat v6.0 Server at localhost-config" folder in the Eclipse Project Explorer and then everything was good.
install tomcat
# yum install tomcat6*
edit tomcat conf file
# vim /etc/tomcat6/tomcat-users.xml
something like:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="TomcatAdmin" password="tomcat" roles="admin,manager"/>
</tomcat-users>
create root directory for your J2EE project, example:
$ mkdir -p ~/Project/java/
do symbolic link, /usr/share/tomcat6/webapps/ to ~/Project/java/
# ln -s /home//Project/java//dist/.war /usr/share/tomcat6/webapps/.war
Note: war archive file is created automatcaly when you use netbeans
0r you can do:
# ln -s /home/<login>/Project/java/<myProject>/webapps /usr/share/tomcat6/webapps/<myProject>
check /etc/hosts file, this file must contain the machine name, mine hosts file
jonathan 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
start httpd service
# service httpd start
check loclahost web page
start tomcat6
# service tomcat6 start
check localhost:8080 web page
check that tomcat show your project
if not:
check symbolic link and restart tomcat6 service
or add manualy with tomcat manager web page
a) Set project name
b) Se path to web.xml file
c) Valid
d) start your project (from web page)
for fedora 13 and under they are some problem, how fix it:
# chmod -R g+w /var/log/tomcat6 /etc/tomcat6/Catalina
# chmod -R g+w /usr/share/tomcat6/work/
check in log files located in /var/log/tomcat6/ if they are anymore "permission denied" message
aforementioned solutions did not help me, I could solve it by re-installing the Tomcat server which took few seconds.
On my PC I had to open the Tomcat6 entry again after the 7th step mentioned above and then change the default option under Server locations to Use tomcat installation.