File Upload Problem

2008-01-20 Thread Alexander Saar

Hi all,
I have a problem with the file upload in Sling. I have a form that 
uploads a file and an according POST.jsp for handling the upload. The 
log shows that POST.jsp is resolved correct, but when I try to upload 
the file, I get the following exception:


javax.servlet.ServletException: null

org.apache.sling.scripting.resolver.impl.DefaultSlingScript.eval(DefaultSlingScript.java:97)

org.apache.sling.servlet.resolver.helper.SlingScriptServlet.service(SlingScriptServlet.java:74)

org.apache.sling.core.impl.request.RequestData.service(RequestData.java:415)

org.apache.sling.core.impl.SlingMainServlet.processRequest(SlingMainServlet.java:287)

org.apache.sling.core.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:48)

org.apache.sling.core.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:54)

org.apache.sling.core.impl.filter.ThemeResolverFilter.doFilter(ThemeResolverFilter.java:76)

org.apache.sling.core.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:52)

org.apache.sling.core.impl.filter.LocaleResolverFilter.doFilter(LocaleResolverFilter.java:85)

org.apache.sling.core.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:52)

org.apache.sling.core.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:206)

org.apache.sling.core.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:52)

org.apache.sling.core.impl.SlingMainServlet.service(SlingMainServlet.java:187)

org.apache.sling.core.impl.SlingMainServlet.service(SlingMainServlet.java:159)

org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)

org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:109)

org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:75)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.sling.launcher.webapp.SlingServlet.service(SlingServlet.java:195)

*root cause*

javax.script.ScriptException: null

org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:272)

org.apache.sling.scripting.resolver.impl.DefaultSlingScript.eval(DefaultSlingScript.java:85)

org.apache.sling.servlet.resolver.helper.SlingScriptServlet.service(SlingScriptServlet.java:74)

org.apache.sling.core.impl.request.RequestData.service(RequestData.java:415)

org.apache.sling.core.impl.SlingMainServlet.processRequest(SlingMainServlet.java:287)

org.apache.sling.core.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:48)

org.apache.sling.core.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:54)

org.apache.sling.core.impl.filter.ThemeResolverFilter.doFilter(ThemeResolverFilter.java:76)

org.apache.sling.core.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:52)

org.apache.sling.core.impl.filter.LocaleResolverFilter.doFilter(LocaleResolverFilter.java:85)

org.apache.sling.core.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:52)

org.apache.sling.core.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:206)

org.apache.sling.core.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:52)

org.apache.sling.core.impl.SlingMainServlet.service(SlingMainServlet.java:187)

org.apache.sling.core.impl.SlingMainServlet.service(SlingMainServlet.java:159)

org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)

org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:109)

org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:75)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.sling.launcher.webapp.SlingServlet.service(SlingServlet.java:195)

*root cause*

java.lang.IllegalStateException: getReader() has already been called for this 
request
org.apache.catalina.connector.Request.getInputStream(Request.java:978)

org.apache.catalina.connector.RequestFacade.getInputStream(RequestFacade.java:340)

javax.servlet.ServletRequestWrapper.getInputStream(ServletRequestWrapper.java:146)

org.apache.commons.fileupload.servlet.ServletRequestContext.getInputStream(ServletRequestContext.java:92)

org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:329)

org.apache.sling.core.impl.parameters.ParameterSupport.parseMultiPartPost(ParameterSupport.java:166)


[jira] Created: (SLING-177) Improvements to event bundle

2008-01-20 Thread Carsten Ziegeler (JIRA)
Improvements to event bundle


 Key: SLING-177
 URL: https://issues.apache.org/jira/browse/SLING-177
 Project: Sling
  Issue Type: Improvement
  Components: Event
Reporter: Carsten Ziegeler


Currently the eventing does not store events immediately into the repository in 
order to quickly respond back to the event admin. (This is in order to not get  
blacklisted). The incoming event is put into a queue and picked up from there.
It would be safer to have a separate write queue which is independent from the 
processing queue to write the event as soon into the repository as possible.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Sling Launchpad: How to get access to the current JCR session from .esp

2008-01-20 Thread David Nuescheler
Hi guys,

I have been trying to access the JCR session from my .esp script
to create content for an import script that needs to create many
nodes in the repository.

I think my initial thought was to get access to the session from
the node on the resource via the .getSession() method on Node, but
since the actual node was hidden by ScriptableNode I didn't find a quick
way to do that.

Then I thought that we might even want to expose the session in a more
direct way. With my JCR framework-hat on I would obviously expect
something on a per request basis that let's me access the jcr session
that is associated with a specific request, given the authentication
information etc. on the http requests.

Maybe we should also get the JCR session from the resource though,
which I think would fit the current (more abstract) design of Sling better.

Is there a current solution that I missed?
What would be a possible future way of doing that?

regards,
david