[ 
https://issues.apache.org/jira/browse/SLING-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13473316#comment-13473316
 ] 

Felix Meschberger commented on SLING-2617:
------------------------------------------

That's exactly the problem. I have a fix for the problem in the JCR Classloader 
bundle as follows:

(a) The ClassLoaderWriterImpl class binds the DynamicClassLoaderManager service 
reference instead of the service itself
(b) The ClassLoaderWriterImpl is a service reference component. Thus it has 
access to the calling bundle
(c) Using the calling bundle's bundle context the ClassLoaderWriterImpl can 
then get the DynamicClassLoaderManager service and create the 
RepositoryClassLoader.

This is easy to implement because the ClassLoaderWriterImpl instances will be 
created in parallel for the DynamicClassLoaderManager service instances thanks 
to how service factories work in OSGi. We just have to make sure to unget the 
DynamicClassLoaderManager service once we destroy the RepositoryClassLoader. 
(for proper resource management)
                
> jsp:setProperty causes "the type JasperException cannot be resolved" 
> compilation error
> --------------------------------------------------------------------------------------
>
>                 Key: SLING-2617
>                 URL: https://issues.apache.org/jira/browse/SLING-2617
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting JSP 2.0.24
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>
> The following script causes a compilation error, "The type 
> org.apache.sling.scripting.jsp.jasper.JasperException cannot be resolved" - 
> I'll attach the stack trace.
> Without the jsp:setProperty statement the script compiles without error.
> export PORT=8080
> cat <<EOL > /tmp/foo.jsp
> <jsp:useBean id="date" scope="page" class="java.util.Date" />
> <jsp:getProperty name="date" property="time"/>
> <jsp:setProperty name="date" property="time" value="1234"/>
> <jsp:getProperty name="date" property="time"/>
> All good!
> EOL
> curl -u admin:admin -X MKCOL http://localhost:$PORT/apps/foo
> curl -u admin:admin -T /tmp/foo.jsp http://localhost:$PORT/apps/foo/foo.jsp
> curl -u admin:admin -Fsling:resourceType=foo http://localhost:$PORT/apps/foo
> curl -u admin:admin http://localhost:$PORT/apps/foo.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to