You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Nicholas Stuart (JIRA)" <ji...@apache.org> on 2008/06/27 18:04:45 UTC
[jira] Created: (JCR-1664) JNDI Referencable Issues
JNDI Referencable Issues
------------------------
Key: JCR-1664
URL: https://issues.apache.org/jira/browse/JCR-1664
Project: Jackrabbit
Issue Type: Bug
Components: jackrabbit-core
Affects Versions: 1.5
Environment: linux glassfish jndi spring
Reporter: Nicholas Stuart
I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1664) JNDI Referencable Issues
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12663721#action_12663721 ]
Jukka Zitting commented on JCR-1664:
------------------------------------
See JCR-1935 for the followup issue.
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Assignee: Jukka Zitting
> Fix For: core 1.4.6
>
> Attachments: JCR-1664.patch, JCR-1664.patch, out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1664) JNDI Referencable Issues
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting updated JCR-1664:
-------------------------------
Attachment: JCR-1664.patch
Updated version of the patch. Need to keep explicitly synchronizing the static BindableRepositoryFactory.cache map.
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5, 1.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Fix For: 1.5
>
> Attachments: JCR-1664.patch, JCR-1664.patch, out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1664) JNDI Referencable Issues
Posted by "Nicholas Stuart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicholas Stuart updated JCR-1664:
---------------------------------
Attachment: out.patch
path to swap StringRefAddr to match glassfish Reference object.
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: 1.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Attachments: out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (JCR-1664) JNDI Referencable Issues
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting resolved JCR-1664.
--------------------------------
Resolution: Fixed
Assignee: Jukka Zitting
Patch applied in revision 681031. Resolving as Fixed.
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5, 1.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Assignee: Jukka Zitting
> Fix For: 1.5
>
> Attachments: JCR-1664.patch, JCR-1664.patch, out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1664) JNDI Referencable Issues
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662986#action_12662986 ]
Jukka Zitting commented on JCR-1664:
------------------------------------
I just noticed that revision 683268 that contained changes relevant to this issue was incorrectly labelled with JCR-1644 instead of JCR-1664, and that I therefore missed merging it to the 1.4 branch for the 1.4.6 release.
1.4.6 still works with the previous 681031 changes merged, but it's a bit more difficult to subclass BindableRepository. We can include the missing 683268 changes in a jackrabbit-core 1.4.7 release if there's enough demand.
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Assignee: Jukka Zitting
> Fix For: core 1.4.6
>
> Attachments: JCR-1664.patch, JCR-1664.patch, out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1664) JNDI Referencable Issues
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting updated JCR-1664:
-------------------------------
Attachment: JCR-1664.patch
How about the attached patch (JCR-1664.patch)? Instead of explicitly storing the configuration options, this patch makes BindableRepository contain the full Reference instance. This should avoid all ordering issues.
I also streamlined these JNDI classes a bit by using the AbstractRepository base class and the JackrabbitRepository interface, and by inlining many of the static methods that weren't being used outside the jndi package.
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5, 1.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Fix For: 1.5
>
> Attachments: JCR-1664.patch, out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1664) JNDI Referencable Issues
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting updated JCR-1664:
-------------------------------
Fix Version/s: (was: 1.5)
core 1.4.6
Merged to the 1.4 branch in revision 695960.
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Assignee: Jukka Zitting
> Fix For: core 1.4.6
>
> Attachments: JCR-1664.patch, JCR-1664.patch, out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1664) JNDI Referencable Issues
Posted by "Nicholas Stuart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicholas Stuart updated JCR-1664:
---------------------------------
Fix Version/s: 1.5
Affects Version/s: core 1.4.5
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5, 1.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Fix For: 1.5
>
> Attachments: out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1664) JNDI Referencable Issues
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting updated JCR-1664:
-------------------------------
Affects Version/s: (was: 1.5)
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Assignee: Jukka Zitting
> Fix For: core 1.4.6
>
> Attachments: JCR-1664.patch, JCR-1664.patch, out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1664) JNDI Referencable Issues
Posted by "Nicholas Stuart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614083#action_12614083 ]
Nicholas Stuart commented on JCR-1664:
--------------------------------------
Yes I understand Reference contains an ordered pair, and if I reverse the current order it works fine in GF as shown with the above patch. I have no idea how one would specifiy the order when creating a JNDI reference in the server though so I don't know who's fault it is. It seems that this order is preserved no matter how you add the values in GF
Also, I am refering to http://wiki.apache.org/jackrabbit/JackRabbitOnSunWebServer
And its not that BindableRepository implementing javax.jcr.Repository is a problem, its the fact that the full impl class is being returned for the lookup, and I'm guess Reference is doing an equals() compare, and not an "instanceof" test so it fails.
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5, 1.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Fix For: 1.5
>
> Attachments: out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1664) JNDI Referencable Issues
Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12616922#action_12616922 ]
Stefan Guggisberg commented on JCR-1664:
----------------------------------------
> Updated version of the patch. Need to keep explicitly synchronizing the static BindableRepositoryFactory.cache map.
+1 for the patch
thanks, jukka!
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5, 1.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Fix For: 1.5
>
> Attachments: JCR-1664.patch, JCR-1664.patch, out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1664) JNDI Referencable Issues
Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613997#action_12613997 ]
Stefan Guggisberg commented on JCR-1664:
----------------------------------------
the contract of javax.naming.Reference is pretty clear, i.e. it maintains an ordered list of RefAddr objects.
jackrabbit always adds the RefAddr objects in the same order.
it seems like this is a glassfish issue not handling Reference's correctly. i'm therefore tempted to resolve this issue as 'Invalid'.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type.
BindableRepository does implement javax.jcr.Repository. what WIKI page are you refering to?
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5, 1.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Fix For: 1.5
>
> Attachments: out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1664) JNDI Referencable Issues
Posted by "Nicholas Stuart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12609282#action_12609282 ]
Nicholas Stuart commented on JCR-1664:
--------------------------------------
I also just tested this behaviour out in 1.4.5 and is the same there. I haven't looked at the code difference between 1.4.5 and 1.5 so they very well could be the same thing, so it may not be all that surprising.
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5, 1.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Fix For: 1.5
>
> Attachments: out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (JCR-1664) JNDI Referencable Issues
Posted by "Nicholas Stuart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12609282#action_12609282 ]
ender_01 edited comment on JCR-1664 at 6/30/08 9:22 AM:
---------------------------------------------------------------
I also just tested this behaviour out in 1.4.5 and it is the same there. I haven't looked at the code difference between 1.4.5 and 1.5 so they very well could be the same thing, so it may not be all that surprising.
was (Author: ender_01):
I also just tested this behaviour out in 1.4.5 and is the same there. I haven't looked at the code difference between 1.4.5 and 1.5 so they very well could be the same thing, so it may not be all that surprising.
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5, 1.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Fix For: 1.5
>
> Attachments: out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1664) JNDI Referencable Issues
Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614725#action_12614725 ]
Stefan Guggisberg commented on JCR-1664:
----------------------------------------
> Also, I am refering to http://wiki.apache.org/jackrabbit/JackRabbitOnSunWebServer
did you try the following?
[...]
6. Create a new "Custom Resource" with the following paramter:
Enabled: true Resource Type: org.apache.jackrabbit.core.jndi.BindableRepository Factory class: org.apache.jackrabbit.core.jndi.BindableRepositoryFactory
Add to paramteters: 1st configFile and then repHomeDir
[...]
if that works for you please let me know and update the said WIKI page.
thanks!
> JNDI Referencable Issues
> ------------------------
>
> Key: JCR-1664
> URL: https://issues.apache.org/jira/browse/JCR-1664
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: core 1.4.5, 1.5
> Environment: linux glassfish jndi spring
> Reporter: Nicholas Stuart
> Fix For: 1.5
>
> Attachments: out.patch
>
>
> I'm questioning the use of Referencable in the BindableResource and BindableResourceFactory classes for the JNDI lookup process. Reason for this is because Referencable needs the Addrs to be in the EXACT order in order for it to be considered the same. (see http://java.sun.com/j2se/1.4.2/docs/api/javax/naming/Reference.html#equals(java.lang.Object) )
> In order for me to get the JNDI reference to be found correctly I had to change the BindableResource.getReference method to swap the order the StringReferences were added to match up what was being passed in by glassfish. This seems EXTREMELY fragile to me as I don't know what order, say JBoss, would pass the StringRefences in in the Reference object for the Factory method.
> Also, another problem is that getReference is binding the class name to BindableRepository class implementation and not javax.jcr.Repository. This again causes them not to match if you follow the example on the wiki on setting up the JNDI reference and use javax.jcr.Repository as the type. This can either be fixed by changing the JNDI reference to use the BindableRepository class or the change the BindableRepository class to set that to the Repository interface. Not sure which would be considered 'better'
> I have a patch that fixes the first issue (at least for glassfish), but not the second. Again, this seems like a really 'breakable' setup right now and not sure what would be better to make sure this is avoided.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.