You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by anand <si...@gmail.com> on 2009/12/08 07:17:23 UTC
Derby
Hello Users,
I have jackrabbit1.5.6. repository running i can view
it at http://localhost:8080/jackrabbit-webapp-1.5.6./repository/default/ .
And when i want to run repository through my code then it's showing the bug
that connection could not be created.
Stack Trace:
44877 [AWT-EventQueue-0] INFO org.apache.jackrabbit.core.RepositoryImpl -
Starting repository...
45082 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.fs.local.LocalFileSystem - LocalFileSystem
initialized at path
/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/repository
46376 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.nodetype.NodeTypeRegistry - no custom node type
definitions found
46420 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.fs.local.LocalFileSystem - LocalFileSystem
initialized at path
/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/version
50588 [AWT-EventQueue-0] WARN
org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager
- Could not connect; driver: org.apache.derby.jdbc.EmbeddedDriver url:
jdbc:derby:/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/version/db;create=true
user: null error: java.sql.SQLException: Failed to start database
'/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/version/db',
see the next exception for details.
java.sql.SQLException: Failed to start database
'/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/version/db',
see the next exception for details.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
and my code is
try {
RepositoryImpl rp = new
RepositoryImpl(RepositoryConfig.create("repository.xml",
"/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit"));
Subject sbj = new Subject();
Subject sb = sbj.getSubject(AccessController.getContext());
SessionImpl impl = rp.createSession(sb, "default");
rp.onSessionCreated(impl);
FirstHop usermanagerimpl = new FirstHop(impl, "simer");
// usermanagerimpl.show();
} catch ( RepositoryException ex) {
Logger.getLogger(FirstHop.class.getName()).log(Level.SEVERE,
null, ex);
}
I have derby10.2.jar in my classpath as well as in NetBeans lib. I' m not
getting it.
Any help will be appreciated.
Thanks,
simer
--
View this message in context: http://n4.nabble.com/Derby-tp955014p955014.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Derby
Posted by anand <si...@gmail.com>.
Thanks Ben
On Thu, Dec 17, 2009 at 1:35 PM, Ben Short [via Jackrabbit] <
ml-node+965820-438124116@n4.nabble.com<ml...@n4.nabble.com>
> wrote:
> Simer,
>
> Configure the repository to use the previously stated classes and then
> just call the method.
>
> Ben
>
> 2009/12/17 anand <[hidden email]<http://n4.nabble.com/user/SendEmail.jtp?type=node&node=965820&i=0>>:
>
>
> >
> > Hello Ben,
> >
> >
> > Ben Short wrote:
> >>
> >> Jackrabbit 2 has all this done for you already.
> >>
> >> configure your repository to use the following classes
> >>
> >> org.apache.jackrabbit.core.security.DefaultAccessManager
> >> org.apache.jackrabbit.core.security.authentication.DefaultLoginModule
> >> org.apache.jackrabbit.core.DefaultSecurityManager
> >>
> >> Then
> >>
> >> UserManager um = ((JackrabbitSession)session).getUserManager();
> >>
> >> User user = um.createUser("user", "password");
> >>
> >
> >
> > In order to create user using above method createUser("user","password");
> in
> > jackrabbit 2.0
> > we need to provide inner logic to this method or just call it
> > providing parameters.
> >
> > Thanks
> > simer
> >
> >
> > --
> > View this message in context:
> http://n4.nabble.com/Derby-tp955014p965767.html
> > Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
> >
>
>
> ------------------------------
> View message @ http://n4.nabble.com/Derby-tp955014p965820.html
> To unsubscribe from Re: Derby, click here< (link removed) =>.
>
>
>
--
View this message in context: http://n4.nabble.com/Derby-tp955014p965834.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Derby
Posted by Ben Short <be...@benshort.co.uk>.
Simer,
Configure the repository to use the previously stated classes and then
just call the method.
Ben
2009/12/17 anand <si...@gmail.com>:
>
> Hello Ben,
>
>
> Ben Short wrote:
>>
>> Jackrabbit 2 has all this done for you already.
>>
>> configure your repository to use the following classes
>>
>> org.apache.jackrabbit.core.security.DefaultAccessManager
>> org.apache.jackrabbit.core.security.authentication.DefaultLoginModule
>> org.apache.jackrabbit.core.DefaultSecurityManager
>>
>> Then
>>
>> UserManager um = ((JackrabbitSession)session).getUserManager();
>>
>> User user = um.createUser("user", "password");
>>
>
>
> In order to create user using above method createUser("user","password"); in
> jackrabbit 2.0
> we need to provide inner logic to this method or just call it
> providing parameters.
>
> Thanks
> simer
>
>
> --
> View this message in context: http://n4.nabble.com/Derby-tp955014p965767.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
Re: Derby
Posted by anand <si...@gmail.com>.
Hello Ben,
Ben Short wrote:
>
> Jackrabbit 2 has all this done for you already.
>
> configure your repository to use the following classes
>
> org.apache.jackrabbit.core.security.DefaultAccessManager
> org.apache.jackrabbit.core.security.authentication.DefaultLoginModule
> org.apache.jackrabbit.core.DefaultSecurityManager
>
> Then
>
> UserManager um = ((JackrabbitSession)session).getUserManager();
>
> User user = um.createUser("user", "password");
>
In order to create user using above method createUser("user","password"); in
jackrabbit 2.0
we need to provide inner logic to this method or just call it
providing parameters.
Thanks
simer
--
View this message in context: http://n4.nabble.com/Derby-tp955014p965767.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Derby
Posted by Ben Short <be...@benshort.co.uk>.
Jackrabbit 2 has all this done for you already.
configure your repository to use the following classes
org.apache.jackrabbit.core.security.DefaultAccessManager
org.apache.jackrabbit.core.security.authentication.DefaultLoginModule
org.apache.jackrabbit.core.DefaultSecurityManager
Then
UserManager um = ((JackrabbitSession)session).getUserManager();
User user = um.createUser("user", "password");
I hope this helps
Ben
2009/12/10 anand <si...@gmail.com>:
>
>
> Hi,
>>
>> On Tue, Dec 8, 2009 at 10:55 AM, anand <[hidden
>> email]<http://n4.nabble.com/user/SendEmail.jtp?type=node&node=955128&i=0>>
>> wrote:
>> > RepositoryImpl rp = ...;
>> > ...;
>> > SessionImpl impl = rp.createSession(sb, "default");
>>
>> Is there a reason why you are using internal Jackrabbit method
>> signatures instead of the standard JCR interfaces?
>>
>
>>
> Yeah i was taking help out of 'UserManagerImpl' class to use its
> "createUser" method in order to add new users.
>
>
> Thanks,
> simer
>
>
>
> --
> View this message in context: http://n4.nabble.com/Derby-tp955014p956684.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
Re: Derby
Posted by anand <si...@gmail.com>.
Hi,
>
> On Tue, Dec 8, 2009 at 10:55 AM, anand <[hidden
> email]<http://n4.nabble.com/user/SendEmail.jtp?type=node&node=955128&i=0>>
> wrote:
> > RepositoryImpl rp = ...;
> > ...;
> > SessionImpl impl = rp.createSession(sb, "default");
>
> Is there a reason why you are using internal Jackrabbit method
> signatures instead of the standard JCR interfaces?
>
>
Yeah i was taking help out of 'UserManagerImpl' class to use its
"createUser" method in order to add new users.
Thanks,
simer
--
View this message in context: http://n4.nabble.com/Derby-tp955014p956684.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Derby
Posted by anand <si...@gmail.com>.
Hi,
>
> On Tue, Dec 8, 2009 at 10:55 AM, anand <[hidden email]<http://n4.nabble.com/user/SendEmail.jtp?type=node&node=955128&i=0>>
> wrote:
> > RepositoryImpl rp = ...;
> > ...;
> > SessionImpl impl = rp.createSession(sb, "default");
>
> Is there a reason why you are using internal Jackrabbit method
> signatures instead of the standard JCR interfaces?
>
>
Yeah i was taking help out of 'UserManagerImpl' class to use its
"createUser" method in order to add new users.
Thanks,
simer
--
View this message in context: http://n4.nabble.com/Derby-tp955014p955135.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Derby
Posted by Jukka Zitting <ju...@gmail.com>.
Hi,
On Tue, Dec 8, 2009 at 10:55 AM, anand <si...@gmail.com> wrote:
> RepositoryImpl rp = ...;
> ...;
> SessionImpl impl = rp.createSession(sb, "default");
Is there a reason why you are using internal Jackrabbit method
signatures instead of the standard JCR interfaces?
BR,
Jukka Zitting
Re: Derby
Posted by anand <si...@gmail.com>.
Hello Users,
The derby problem was resolved. Now before stating another issue i want you
to have a look on my code below.
code:
RepositoryImpl rp = new
RepositoryImpl(RepositoryConfig.create("repository.xml",
"/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit"));
System.out.println("reached to repsitory 1");
//Subject sbj = new Subject();
//@SuppressWarnings("static-access")
Subject sb = Subject.getSubject(AccessController.getContext());
System.out.println("2");
SessionImpl impl = rp.createSession(sb, "default");
System.out.println("3");
rp.onSessionCreated(impl);
System.out.println("4");
new FirstHop(impl, "simer");
// usermanagerimpl.show();
} catch ( RepositoryException ex) {
Logger.getLogger(FirstHop.class.getName()).log(Level.SEVERE,
null, ex);
}
here you can see i was trying to create new session
when i executed my code then stack trace followed. Repository was started .
but as soon as it reaches the createSession(sb, "default"); it starts
complaining.
Here 'sb' is the authenticated subject and 'default' is the default
workspace.
here follows the stack trace.
compile-single:
run-single:
122023 [AWT-EventQueue-0] WARN
org.apache.jackrabbit.core.util.RepositoryLock - Existing lock file
/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/.lock
detected. Repository was not shut down properly.
122075 [AWT-EventQueue-0] INFO org.apache.jackrabbit.core.RepositoryImpl -
Starting repository...
122271 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.fs.local.LocalFileSystem - LocalFileSystem
initialized at path
/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/repository
123585 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.nodetype.NodeTypeRegistry - no custom node type
definitions found
123673 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.fs.local.LocalFileSystem - LocalFileSystem
initialized at path
/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/version
129521 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager
- Database: Apache Derby / 10.2.1.6 - (452058)
129533 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager
- Driver: Apache Derby Embedded JDBC Driver / 10.2.1.6 - (452058)
134578 [AWT-EventQueue-0] INFO org.apache.jackrabbit.core.RepositoryImpl -
initializing workspace 'default'...
134588 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.fs.local.LocalFileSystem - LocalFileSystem
initialized at path
/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/workspaces/default
135405 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager
- Database: Apache Derby / 10.2.1.6 - (452058)
135413 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager
- Driver: Apache Derby Embedded JDBC Driver / 10.2.1.6 - (452058)
138919 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.fs.local.LocalFileSystem - LocalFileSystem
initialized at path
/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/repository/index
140710 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.query.lucene.SearchIndex - Index initialized:
/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/repository/index
Version: 3
140767 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.fs.local.LocalFileSystem - LocalFileSystem
initialized at path
/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/workspaces/default/index
143801 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.query.lucene.SearchIndex - Index initialized:
/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/workspaces/default/index
Version: 3
143809 [AWT-EventQueue-0] INFO org.apache.jackrabbit.core.RepositoryImpl -
workspace 'default' initialized
143815 [AWT-EventQueue-0] INFO org.apache.jackrabbit.core.RepositoryImpl -
Repository started
reached to repsitory 1
2
143846 [AWT-EventQueue-0] INFO org.apache.jackrabbit.core.RepositoryImpl -
initializing workspace 'security'...
143854 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.fs.local.LocalFileSystem - LocalFileSystem
initialized at path
/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/workspaces/security
144761 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager
- Database: Apache Derby / 10.2.1.6 - (452058)
144768 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager
- Driver: Apache Derby Embedded JDBC Driver / 10.2.1.6 - (452058)
145554 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.fs.local.LocalFileSystem - LocalFileSystem
initialized at path
/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/workspaces/security/index
145620 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.query.lucene.SearchIndex - Index initialized:
/home/sda_tr1/Desktop/simer/apache-tomcat-6.0.20/bin/jackrabbit/workspaces/security/index
Version: 3
145629 [AWT-EventQueue-0] INFO org.apache.jackrabbit.core.RepositoryImpl -
workspace 'security' initialized
145978 [AWT-EventQueue-0] INFO
org.apache.jackrabbit.core.security.simple.SimpleSecurityManager - init:
using Repository LoginModule configuration for Jackrabbit
146036 [AWT-EventQueue-0] INFO org.apache.jackrabbit.core.RepositoryImpl -
SecurityManager = class
org.apache.jackrabbit.core.security.simple.SimpleSecurityManager
reached sim()
Dec 8, 2009 2:41:38 PM org.apache.jackrabbit.core.JLogin actionPerformed
SEVERE: null
java.lang.NullPointerException
at
org.apache.jackrabbit.core.security.simple.SimpleSecurityManager.getUserID(SimpleSecurityManager.java:226)
at
org.apache.jackrabbit.core.SessionImpl.retrieveUserId(SessionImpl.java:296)
at
org.apache.jackrabbit.core.SessionImpl.<init>(SessionImpl.java:276)
at
org.apache.jackrabbit.core.XASessionImpl.<init>(XASessionImpl.java:117)
at
org.apache.jackrabbit.core.RepositoryImpl.createSessionInstance(RepositoryImpl.java:1474)
at
org.apache.jackrabbit.core.RepositoryImpl.createSession(RepositoryImpl.java:972)
at org.apache.jackrabbit.core.FirstHop.sim(FirstHop.java:69)
at org.apache.jackrabbit.core.JLogin.actionPerformed(JLogin.java:95)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
BUILD SUCCESSFUL (total time: 20 minutes 9 seconds)
Thanks,
simer
--
View this message in context: http://n4.nabble.com/Derby-tp955014p955118.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.