google-code-export / appengine-jruby

Automatically exported from code.google.com/p/appengine-jruby
0 stars 0 forks source link

Error when process POST from /_ah/xmpp/message/chat/ #75

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm not using appengine-jruby, instead I start my app from scratch. Sorry
to post this issue here, because I don't know if there is anywhere else I
can ask for help.
I'm using sinatra, and these jruby related jars under WEB-INT/lib:
jruby-core-1.4.0.jar jruby-rack-0.9.7.jar jruby-stdlib-1.4.0.jar
Here is my web.xml:
<!DOCTYPE web-app PUBLIC
  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
  "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>

  <context-param>
    <param-name>public.root</param-name>
    <param-value>/</param-value>
  </context-param>

  <context-param>
    <param-name>rackup</param-name>
    <param-value># vim: set ft=ruby:
require 'rubygems'
gem 'sinatra'
# I put sinatra porject under the lib directory.
require './lib/demo'
set :run, false
set :environment, :production
set :rr_login_url, 'http://passport.renren.com/RL.do'
set :rr_rest, 'http://api.renren.com/restserver.do'
run Sinatra::Application
</param-value>
  </context-param>

  <context-param>
    <param-name>jruby.min.runtimes</param-name>
    <param-value>1</param-value>
  </context-param>

  <context-param>
    <param-name>jruby.max.runtimes</param-name>
    <param-value>1</param-value>
  </context-param>

  <filter>
    <filter-name>RackFilter</filter-name>
    <filter-class>org.jruby.rack.RackFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>RackFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <listener>
    <listener-class>org.jruby.rack.RackServletContextListener</listener-class>
  </listener>

</web-app>

and my appengine-web.xml:
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>tsing-yue</application>
    <version>1</version>
    <static-files>
      <include path="/**.ico"/>
    </static-files>
    <resource-files />
    <sessions-enabled>false</sessions-enabled>
    <inbound-services>
      <service>xmpp_message</service>
    </inbound-services>
    <system-properties>
      <property name="jruby.management.enabled" value="false" />
      <property name="os.arch" value="" />
      <property name="jruby.compile.mode" value="JIT"/> <!-- JIT|FORCE|OFF -->
      <property name="jruby.compile.fastest" value="true"/>
      <property name="jruby.compile.frameless" value="true"/>
      <property name="jruby.compile.positionless" value="true"/>
      <property name="jruby.compile.threadless" value="false"/>
      <property name="jruby.compile.fastops" value="false"/>
      <property name="jruby.compile.fastcase" value="false"/>
      <property name="jruby.compile.chainsize" value="500"/>
      <property name="jruby.compile.lazyHandles" value="false"/>
      <property name="jruby.compile.peephole" value="true"/>
   </system-properties>
</appengine-web-app>

When I'm testing with appengine's xmpp receive service, I got this error
log in admin console:
#

1.
      04-15 02:20AM 28.843 /_ah/xmpp/message/chat/ 500 346ms 613cpu_ms 1kb
      See details

      0.1.0.10 - - [15/Apr/2010:02:20:29 -0700] "POST
/_ah/xmpp/message/chat/ HTTP/1.1" 500 1735 - - "tsing-yue.appspot.com"

2.
      E 04-15 02:20AM 28.864

      javax.servlet.ServletContext log: Application Error
      java.security.AccessControlException: access denied
(java.io.FilePermission
/base/data/home/apps/tsing-yue/1.341268178850821139/WEB-INF/RackMultipart.681359
1.2712
write)
        at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:355
)
        at
java.security.AccessController.checkPermission(AccessController.java:567)
        at java.lang.SecurityManager.checkPermission(Unknown Source)
        at
com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(Cus
tomSecurityManager.java:45)
        at java.lang.SecurityManager.checkWrite(Unknown Source)
        at java.io.File.createNewFile(File.java:963)
        at org.jruby.RubyTempfile.initialize(RubyTempfile.java:114)
        at
org.jruby.RubyTempfile$i_method_0_1$RUBYFRAMEDINVOKER$initialize.call(org/jruby/
RubyTempfile$i_method_0_1$RUBYFRAMEDINVOKER$initialize.gen)
        at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:270
)
        at
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:78)
        at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
        at org.jruby.RubyClass.newInstance(RubyClass.java:674)
        at org.jruby.RubyIO.newInstance(RubyIO.java:840)
        at
org.jruby.RubyIO$s_method_0_0$RUBYFRAMEDINVOKER$newInstance.call(org/jruby/RubyI
O$s_method_0_0$RUBYFRAMEDINVOKER$newInstance.gen)
        at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:180)
        at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:176)
        at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:310
)
        at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:149)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.DAsgnNode.interpret(DAsgnNode.java:110)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.ast.IfNode.interpret(IfNode.java:117)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.ast.IfNode.interpret(IfNode.java:117)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.ast.UntilNode.interpret(UntilNode.java:120)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:317)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:268)
        at org.jruby.runtime.Block.yield(Block.java:194)
        at org.jruby.RubyKernel.loop_1_9(RubyKernel.java:1182)
        at
org.jruby.RubyKernel$s_method_0_0$RUBYFRAMEDINVOKER$loop_1_9.call(org/jruby/Ruby
Kernel$s_method_0_0$RUBYFRAMEDINVOKER$loop_1_9.gen)
        at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:300
)
        at
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:118)
        at
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:133)
        at
org.jruby.ast.FCallNoArgBlockNode.interpret(FCallNoArgBlockNode.java:32)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.ast.IfNode.interpret(IfNode.java:117)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java
:173)
        at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:169)
        at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:147)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java
:173)
        at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:169)
        at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:147)
        at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
        at
org.jruby.ast.AttrAssignTwoArgNode.interpret(AttrAssignTwoArgNode.java:36)
        at org.jruby.ast.IfNode.interpret(IfNode.java:111)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.ast.IfNode.interpret(IfNode.java:117)
        at org.jruby.ast.IfNode.interpret(IfNode.java:119)
        at org.jruby.ast.IfNode.interpret(IfNode.java:119)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java
:136)
        at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:153)
        at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:107)
        at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.OrNode.interpret(OrNode.java:94)
        at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.ast.IfNode.interpret(IfNode.java:117)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java
:173)
        at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:169)
        at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:147)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.ToAryNode.interpret(ToAryNode.java:69)
        at org.jruby.ast.MultipleAsgnNode.interpret(MultipleAsgnNode.java:128)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java
:173)
        at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:169)
        at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:147)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:317)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:251)
        at
org.jruby.runtime.InterpretedBlock.yieldSpecific(InterpretedBlock.java:185)
        at org.jruby.runtime.Block.yieldSpecific(Block.java:99)
        at org.jruby.ast.ZYieldNode.interpret(ZYieldNode.java:25)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.IfNode.interpret(IfNode.java:119)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java
:155)
        at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:161)
        at
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:116)
        at
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:133)
        at
org.jruby.ast.FCallNoArgBlockNode.interpret(FCallNoArgBlockNode.java:32)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java
:173)
        at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:169)
        at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:147)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java
:173)
        at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:169)
        at org.jruby.RubyClass.finvoke(RubyClass.java:568)
        at
org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:409)
        at org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:317)
        at
org.jruby.javasupport.JavaEmbedUtils$1.callMethod(JavaEmbedUtils.java:143)

But my script is simply:
post '/_ah/xmpp/message/chat/' do
end

Hope anyone give me a clue.

Original issue reported on code.google.com by wayward...@126.com on 15 Apr 2010 at 9:46

GoogleCodeExporter commented 9 years ago
I have just figure it out, the post data of '/_ah/xmpp/message/chat/' is 
encoded in
multipart/form, and rack(or something else) will first save that kind of post as
files, so error occurs.

But I still have no idea what to do with that.

Original comment by wayward...@126.com on 16 Apr 2010 at 1:37

GoogleCodeExporter commented 9 years ago
I modified utils.rb in "jruby-rack-0.9.7.jar", it works.

Original comment by wayward...@126.com on 19 Apr 2010 at 1:49

GoogleCodeExporter commented 9 years ago

Original comment by rib...@gmail.com on 2 Jun 2010 at 3:15