You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Sudhan <s....@gmail.com> on 2007/05/11 19:27:45 UTC
Custom node types with RMI
Hi,
I am really stucked at a point where i need to make custom node type so as
to set some custom features. Now my problem is that i am using Jackrabbit
repository through RMI, but i cannot get resources to the remote repository
from my application. Now is there a work around, either by modifying the
standard nodetypes given in jackrabbit source code or can I add my own
custom node type definition somehow at startup of the repository on the
server itself.
The application is such that i cannot leave RMI interface as the repository
is being accessed by different clients including my application.
Please suggest me any suitable approach to tackle this situation.
thanks,
Sudhan
--
View this message in context: http://www.nabble.com/Custom-node-types-with-RMI-tf3728625.html#a10436219
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Custom node types with RMI
Posted by Sudhan <s....@gmail.com>.
Hi,
I found out the problem with web.xml and bootstrap.properties, which where
not able to point correctly first to the bootstrap.properties file and
second the repository.xml file in templates directory.
this config works, thanks once again.
Sudhan
Sudhan wrote:
>
> Hi,
>
> I am really stucked at a point where i need to make custom node type so as
> to set some custom features. Now my problem is that i am using Jackrabbit
> repository through RMI, but i cannot get resources to the remote
> repository from my application. Now is there a work around, either by
> modifying the standard nodetypes given in jackrabbit source code or can I
> add my own custom node type definition somehow at startup of the
> repository on the server itself.
>
> The application is such that i cannot leave RMI interface as the
> repository is being accessed by different clients including my
> application.
>
> Please suggest me any suitable approach to tackle this situation.
>
> thanks,
>
> Sudhan
>
--
View this message in context: http://www.nabble.com/Custom-node-types-with-RMI-tf3728625.html#a10612495
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Custom node types with RMI
Posted by Sudhan <s....@gmail.com>.
Hi,
I was using jackrabbit 1.2.1 version with JBoss 4.0.4 and everything was
fine after configuring RMI port and uri, but after downloading jackrabbit
1.3 version when i am trying to deploy the jackrabbit-webapp-1.3.war in
JBoss, i am getting following errors.
14:01:12,236 INFO [STDOUT] 14.05.2007 14:01:12 *INFO * root: Logging
initialized. (LoggingServlet.java, line 87)
14:01:12,252 INFO [STDOUT] 14.05.2007 14:01:12 *INFO *
RepositoryStartupServlet: RepositoryStartupServlet initializing... (
tartupServlet.java, line 233)
14:01:12,299 INFO [STDOUT] 14.05.2007 14:01:12 *ERROR*
RepositoryStartupServlet: Repository startup configuration is not va
ootstrap config is specified. (RepositoryStartupServlet.java, line 345)
14:01:12,314 INFO [STDOUT] 14.05.2007 14:01:12 *ERROR*
RepositoryStartupServlet: Either create the jackrabbit/bootstrap.pro
e or (RepositoryStartupServlet.java, line 346)
14:01:12,314 INFO [STDOUT] 14.05.2007 14:01:12 *ERROR*
RepositoryStartupServlet: use the '/config/index.jsp' for easy confi
RepositoryStartupServlet.java, line 347)
14:01:12,330 INFO [STDOUT] 14.05.2007 14:01:12 *ERROR*
RepositoryStartupServlet: RepositoryStartupServlet initializing fail
ervlet.ServletException: Repository startup configuration is not valid.
(RepositoryStartupServlet.java, line 243)
javax.servlet.ServletException: Repository startup configuration is not
valid.
at
org.apache.jackrabbit.j2ee.RepositoryStartupServlet.configure(RepositoryStartupServlet.java:348)
at
org.apache.jackrabbit.j2ee.RepositoryStartupServlet.startup(RepositoryStartupServlet.java:235)
at
org.apache.jackrabbit.j2ee.RepositoryStartupServlet.init(RepositoryStartupServlet.java:209)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
Now i tried modifying the bootstrap.properties file by changing the rmi
port, still getting same error.
Kindly let me know if i am missing here.
thanks,
Sudhan
Jukka Zitting wrote:
>
> Hi,
>
> On 5/11/07, Sudhan <s....@gmail.com> wrote:
>> I am really stucked at a point where i need to make custom node type so
>> as
>> to set some custom features. Now my problem is that i am using Jackrabbit
>> repository through RMI, but i cannot get resources to the remote
>> repository
>> from my application. Now is there a work around, either by modifying the
>> standard nodetypes given in jackrabbit source code or can I add my own
>> custom node type definition somehow at startup of the repository on the
>> server itself.
>
> Starting with the 1.3 release, the jackrabbit-jcr-rmi component
> supports the jackrabbit-api extension interfaces when accessing a
> Jackrabbit repository. So you can use the following code in your
> client application:
>
> Session session = ...;
> JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
> session.getWorkspace().getNodeTypeManager();
> if (!manager.hasNodeType("my:customType")) {
> manager.registerNodeTypes(...);
> }
>
> See
> http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/api/JackrabbitNodeTypeManager.html
>
> BR;
>
> Jukka Zitting
>
>
--
View this message in context: http://www.nabble.com/Custom-node-types-with-RMI-tf3728625.html#a10612252
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Custom node types with RMI
Posted by Jukka Zitting <ju...@gmail.com>.
Hi,
On 5/15/07, Sudhan <s....@gmail.com> wrote:
> OK so I will have to use these two optional classes.
>
> At present i was just using the binary source for jackrabbit-webapp-1.3.war
> and deploying it on JBoss Server. So now i will have to modify the source
> and use JackrabbitServerAdaptorFactory instead of ServerAdapterFactory and
> similarly will have to change same stuff on client application and rebuild
> the respective jars.
Ah, good point... We should have changed jackrabbit-webapp to use the
Jackrabbit extensions by default.
> If you have any snippet of these changes will be greatly appreciated.
>
> Once again thanks for all your support.
No problem. Could you file an improvement request in Jira for using
the Jackrabbit RMI extensions by default in jackrabbit-webapp. I can
make the required changes in code.
BR,
Jukka Zitting
Re: Custom node types with RMI
Posted by Sudhan <s....@gmail.com>.
Hi Jukka,
OK so I will have to use these two optional classes.
At present i was just using the binary source for jackrabbit-webapp-1.3.war
and deploying it on JBoss Server. So now i will have to modify the source
and use JackrabbitServerAdaptorFactory instead of ServerAdapterFactory and
similarly will have to change same stuff on client application and rebuild
the respective jars.
If you have any snippet of these changes will be greatly appreciated.
Once again thanks for all your support.
Sudhan
Jukka Zitting wrote:
>
> Hi,
>
> On 5/15/07, Sudhan <s....@gmail.com> wrote:
>> Earlier i was using jackrabbit 1.2.1, but now after your suggestion -
>> downloaded 1.3 version and tried implementing the custom node type
>> registration code. But it is failing because the NodeTypeManager which it
>> is
>> returing is ClientNodeTypeManager and when i cast it to
>> JackrabbitNodeTypeManager it is giving ClassCast Exception.
>>
>> Is there any thing which i am missing.
>
> Ah, sorry, my mistake. To be able to use the Jackrabbit-specific
> features you need to use the JackrabbitClientAdapterFactory [1] and
> JackrabbitServerAdapterFactory [2] classes in your client and server
> code instead of the standard ClientAdapterFactory and
> ServerAdapterFactory classes. The reason for this is to keep the
> jackrabbit-api dependency optional for clients and servers that don't
> need or implement this functionality.
>
> [1]
> http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitClientAdapterFactory.html
> [2]
> http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitServerAdapterFactory.html
>
> BR,
>
> Jukka Zitting
>
>
--
View this message in context: http://www.nabble.com/Custom-node-types-with-RMI-tf3728625.html#a10627715
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Custom node types with RMI
Posted by Corentin Follenfant <co...@univ-lr.fr>.
Jukka Zitting <jukka.zitting <at> gmail.com> writes:
>
> Hi,
> [...] To be able to use the Jackrabbit-specific
> features you need to use the JackrabbitClientAdapterFactory [1] and
> JackrabbitServerAdapterFactory [2] classes in your client and server
> code instead of the standard ClientAdapterFactory and
> ServerAdapterFactory classes. The reason for this is to keep the
> jackrabbit-api dependency optional for clients and servers that don't
> need or implement this functionality.
>
> [1]
http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitClientAdapterFactory.html
> [2]
http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitServerAdapterFactory.html
>
> BR,
>
> Jukka Zitting
>
Hi,
I also have to register custom nodetypes over RMI, but as their behaviour is
dynamically generated into the java code, they are built like NodeTypeDef and
then registered with NodeTypeRegistry#registerNodeType(NodeTypeDef). However the
NodeTypeRegistry doesn't seem to be accessible with the
JackrabbitNodeTypeManager. Would it be possible to "RMI-ze" the
NodeTypeRegistry, or must I convert the NodeTypeDefs to an XML stream which I
will be able to register with JackrabbitNodeTypeManager.html#registerNodeTypes()
- although the second way seems counter-productive ?
I have a second question: in order to get the JackrabbitNodeTypeManager, I'm
using the Jackrabbit adaptaters factories, but the repository is deployed as a
Tomcat webapp so I don't know where to change the server code to make it use the
JackrabbitServerAdaptaterFactory ?
Thanks,
Corentin
Re: Custom node types with RMI
Posted by Jukka Zitting <ju...@gmail.com>.
Hi,
On 5/15/07, Sudhan <s....@gmail.com> wrote:
> Earlier i was using jackrabbit 1.2.1, but now after your suggestion -
> downloaded 1.3 version and tried implementing the custom node type
> registration code. But it is failing because the NodeTypeManager which it is
> returing is ClientNodeTypeManager and when i cast it to
> JackrabbitNodeTypeManager it is giving ClassCast Exception.
>
> Is there any thing which i am missing.
Ah, sorry, my mistake. To be able to use the Jackrabbit-specific
features you need to use the JackrabbitClientAdapterFactory [1] and
JackrabbitServerAdapterFactory [2] classes in your client and server
code instead of the standard ClientAdapterFactory and
ServerAdapterFactory classes. The reason for this is to keep the
jackrabbit-api dependency optional for clients and servers that don't
need or implement this functionality.
[1] http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitClientAdapterFactory.html
[2] http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitServerAdapterFactory.html
BR,
Jukka Zitting
Re: Custom node types with RMI
Posted by Sudhan <s....@gmail.com>.
Hi,
Earlier i was using jackrabbit 1.2.1, but now after your suggestion -
downloaded 1.3 version and tried implementing the custom node type
registration code. But it is failing because the NodeTypeManager which it is
returing is ClientNodeTypeManager and when i cast it to
JackrabbitNodeTypeManager it is giving ClassCast Exception.
Is there any thing which i am missing.
thanks,
Sudhan
Jukka Zitting wrote:
>
> Hi,
>
> On 5/11/07, Sudhan <s....@gmail.com> wrote:
>> I am really stucked at a point where i need to make custom node type so
>> as
>> to set some custom features. Now my problem is that i am using Jackrabbit
>> repository through RMI, but i cannot get resources to the remote
>> repository
>> from my application. Now is there a work around, either by modifying the
>> standard nodetypes given in jackrabbit source code or can I add my own
>> custom node type definition somehow at startup of the repository on the
>> server itself.
>
> Starting with the 1.3 release, the jackrabbit-jcr-rmi component
> supports the jackrabbit-api extension interfaces when accessing a
> Jackrabbit repository. So you can use the following code in your
> client application:
>
> Session session = ...;
> JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
> session.getWorkspace().getNodeTypeManager();
> if (!manager.hasNodeType("my:customType")) {
> manager.registerNodeTypes(...);
> }
>
> See
> http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/api/JackrabbitNodeTypeManager.html
>
> BR;
>
> Jukka Zitting
>
>
--
View this message in context: http://www.nabble.com/Custom-node-types-with-RMI-tf3728625.html#a10614088
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Custom node types with RMI
Posted by Jukka Zitting <ju...@gmail.com>.
Hi,
On 5/11/07, Sudhan <s....@gmail.com> wrote:
> I am really stucked at a point where i need to make custom node type so as
> to set some custom features. Now my problem is that i am using Jackrabbit
> repository through RMI, but i cannot get resources to the remote repository
> from my application. Now is there a work around, either by modifying the
> standard nodetypes given in jackrabbit source code or can I add my own
> custom node type definition somehow at startup of the repository on the
> server itself.
Starting with the 1.3 release, the jackrabbit-jcr-rmi component
supports the jackrabbit-api extension interfaces when accessing a
Jackrabbit repository. So you can use the following code in your
client application:
Session session = ...;
JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
session.getWorkspace().getNodeTypeManager();
if (!manager.hasNodeType("my:customType")) {
manager.registerNodeTypes(...);
}
See http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/api/JackrabbitNodeTypeManager.html
BR;
Jukka Zitting