Thank you for your suggestion. However, it didn't work. Any other suggestions?
After some debugging, this line of code in the RepositoryServiceImpl.class file
MultiStatusResponse[] responses =
method.getResponseBodyAsMultiStatus().getResponses();
Has this as its value.
{404=org.apache.jackrabbit.webdav.property.DavPropertySet@50a638b5}
This line of code
DavPropertySet props = responses[0].getProperties(DavServletResponse.SC_OK);
Has as its value an empty HashMap.
Those lines of code come from the
RepositoryServiceImpl.obtain(CredentialsWrapper credentials, String
workspaceName) method.
> Leave off the "default" parameter and just call the login method that has
> only the credential object as the parameter.
>
> Best regards,
> Clay Ferguson
> [email protected]
On Wed, Mar 30, 2016 at 2:00 PM, Brent Vaughn <[email protected]> wrote:
> I am new to Jackrabbit. I downloaded the Standalone Server jar. It is
> currently up and running. From an browser I enter this URL
> http://ieca124.lsb-okc.com:8080/repository/default and login with the
> admin user name and default password. It seems to work fine. It shows an
> empty default repository.
>
> However, when I try to login programmatically using this code
>
> Repository repository = JcrUtils.getRepository("
> http://ieca124.lsb-okc.com:8080/repository");
> Session session = repository.login(new SimpleCredentials("admin",
> "admin".toCharArray()), "default");
>
>
> I get an error trying to run the login method. Could someone show me what
> I am doing wrong? I haven't change the repository.xml or any other file.
> I am just using the defaults from when you run "java -jar
> jackrabbit-standalone-2.12.1.jar". Here is the stacktrace I get
>
> log4j:WARN No appenders could be found for logger
> (org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
> more info.
> Exception in thread "main" javax.jcr.LoginException: Login failed: Unknown
> workspace 'default'.
> at
> org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.obtain(RepositoryServiceImpl.java:804)
> at
> org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.obtain(RepositoryServiceImpl.java:753)
> at
> org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.obtain(RepositoryServiceImpl.java:307)
> at
> org.apache.jackrabbit.jcr2spi.RepositoryImpl.login(RepositoryImpl.java:151)
> at com.iecokc.sandbox.SecondHop.main(SecondHop.java:19)
>
>
>