xmldb: nullpointer exception

View: New views
6 Messages — Rating Filter:   Alert me  

xmldb: nullpointer exception

by gonzberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi all,
I installed exist 1.2.4 on a new server and imported my data from exist 1.2.3. I can access the admin website via http://myserver:8181/exist, run the webstart client and browse my data.

However when my application (which runs on another server) tries to access eXist via xmldb, a nullpointer exception is thrown. I have no idea what the problem is. The data in the database are identical in both databases. The application is the same, only the path to the new exist instance was changed.

Do you have any hints where I could start searching?
Does my data server need more ports opened except the default Jetty port (which ist 8181 in my case)?

The exception is thrown when getting the Collection:

Collection col = DatabaseManager.getCollection(path,exist_username, exist_password);

- I did not modify my application code (except of the new path to exist).
- There are no exceptions in exist.log, wrapper.log and xmldb.log.

According to xmldb.log, queries seem to be executed correctly:

2008-08-12 12:16:19,391 [P1-7] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 158 ms.


Thanks for help! gonzberg




--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: xmldb: nullpointer exception

by Dannes Wessels-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

gonzberg@... wrote:
> However when my application (which runs on another server) tries to access eXist via xmldb, a nullpointer exception is thrown. I have no idea what the problem is.
Please provide us the fill stacktrace of the NPE. With this information
we can probably help you.

regards

Dannes


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: xmldb: nullpointer exception

by gonzberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
below is the tomcat stacktrace. Doesn't say much about eXist. I just installed eXist 1.2.3 on another server an got the same problem. So I assume my application is the problem. Or could this problem occur due to corrupt data or corrupt index?

java.lang.NullPointerException
        at dbMisc.DBUtilities.getCollection(DBUtilities.java:104)
        at dbAccess.ShowBrowseAction.execute(ShowBrowseAction.java:94)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at appMisc.CharsetFilter.doFilter(CharsetFilter.java:55)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at appMisc.CharsetFilter.doFilter(CharsetFilter.java:55)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Unknown Source)

-------- Original-Nachricht --------
> Datum: Tue, 12 Aug 2008 14:36:51 +0200
> Von: Dannes Wessels <dizzzz@...>
> An: gonzberg@...
> CC: exist-open@...
> Betreff: Re: [Exist-open] xmldb: nullpointer exception

> Hi,
>
> gonzberg@... wrote:
> > However when my application (which runs on another server) tries to
> access eXist via xmldb, a nullpointer exception is thrown. I have no idea what
> the problem is.
> Please provide us the fill stacktrace of the NPE. With this information
> we can probably help you.
>
> regards
>
> Dannes

--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: xmldb: nullpointer exception

by Dannes Wessels-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On Wed, Aug 13, 2008 at 9:41 AM, <gonzberg@...> wrote:
below is the tomcat stacktrace. Doesn't say much about eXist.

Indeed. based on this trace i'd see.. there is no eXist involved at all. Please check "dbMisc.DBUtilities.getCollection(DBUtilities.java:104)".....
 
I just installed eXist 1.2.3 on another server an got the same problem. So I assume my application is the problem. Or could this problem occur due to corrupt data or corrupt index?

The question is... why do you get a NPE there? probably because you can't get access to the database (or the db could not be initialized). Maybe it is not started at all, but that is difficult to say without additional information.

regards

Dannes

--
eXist-db Native XML Database
http://exist-db.org

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: xmldb: nullpointer exception

by Dannes Wessels-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Aug 13, 2008, at 9:58 , Dannes Wessels wrote:

The question is... why do you get a NPE there? probably because you can't get access to the database (or the db could not be initialized). Maybe it is not started at all, but that is difficult to say without additional information.


answering myself: from the javadocs:

getCollection

public static Collection getCollection(String uri,
                                       String username,
                                       String password)
                                throws XMLDBException
Retrieves a Collection instance from the database for the given URI. The format of the majority of the URI is database implementation specific however the uri must begin with characters xmldb: and be followed by the name of the database instance as returned by Database.getName() and a colon character. An example would be for the database named "vendordb" the URI handed to getCollection would look something like the following. xmldb:vendordb://host:port/path/to/collection. The xmldb: prefix will be removed from the URI prior to handing the URI to the Database instance for handling.

Parameters:
uri - The database specific URI to use to locate the collection.
username - The username to use for authentication to the database or null if the database does not support authentication.
password - The password to use for authentication to the database or null if the database does not support authentication.
Returns:
Collection instance for the requested collection or null if the collection could not be found.
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.
ErrroCodes.INVALID_URI If the URI is not in a valid format. 
ErrroCodes.NO_SUCH_DATABASE If a Database instance could not be found to handle the provided URI. ErrroCodes.PERMISSION_DENIED If the usernameand password were not accepted by the database.

accoring to this, a NULL is returned when the collection could not be found....... otherwise we would have an exception here.

cheers

Dannes


eXist-db Open Source Native XML Database







-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: xmldb: nullpointer exception

by gonzberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, my fault...

I have two URIs in my app:

xmldb:exist://localhost:8181/exist/xmlrpc
and
xmldb:exist://localhost:8181/exist/xmlrpc/db/

I appended /db/ to the first one by accident, which lead to the error. Sorry for that.

Btw: How can I run the manual consistency check on a headless system? Locally I run it with /bin/check.sh.


-------- Original-Nachricht --------
> Datum: Wed, 13 Aug 2008 09:58:39 +0200
> Von: "Dannes Wessels" <dizzzz@...>
> An: gonzberg@...
> CC: exist-open@...
> Betreff: Re: [Exist-open] xmldb: nullpointer exception

> Hi,
>
> On Wed, Aug 13, 2008 at 9:41 AM, <gonzberg@...> wrote:
>
> > below is the tomcat stacktrace. Doesn't say much about eXist.
>
>
> Indeed. based on this trace i'd see.. there is no eXist involved at all.
> Please check "dbMisc.DBUtilities.getCollection(DBUtilities.java:104)".....
>
>
> > I just installed eXist 1.2.3 on another server an got the same problem.
> So
> > I assume my application is the problem. Or could this problem occur due
> to
> > corrupt data or corrupt index?
>
>
> The question is... why do you get a NPE there? probably because you can't
> get access to the database (or the db could not be initialized). Maybe it
> is
> not started at all, but that is difficult to say without additional
> information.
>
> regards
>
> Dannes
>
> --
> eXist-db Native XML Database
> http://exist-db.org

--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open
LightInTheBox - Buy quality products at wholesale price!