You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Imtiyaz <im...@yahoo.co.in> on 2004/07/07 14:01:35 UTC

ExceptionInInitializerError

public void setDocumentConn(String s)

{

try

{

System.out.println("In the setDocumentConn method .....");

System.out.println("col In the setDocumentConn method ....." + col);

document = (XMLResource)col.getResource(s);

System.out.println("After the resource creation .....");

String s1 = (String)document.getContent();

System.out.println("After creating the document .....");

doc = DocumentHelper.parseText(s1);

System.out.println("After creating the final document .....");

}

catch(ExceptionInInitializerError exceptionininitializererror)

{

System.out.println("ExceptionInInitializerError error : " + exceptionininitializererror);

}

catch(XMLDBException xmldbexception)

{

System.err.println("XML:DB Exception occured " + xmldbexception.errorCode + " " + xmldbexception.getMessage());

}

catch(Exception exception)

{

System.out.println("Error : " + exception);

}

}

 

i am trying to run the above code and getting runtime error

i am trying to accessing xindice remotely

 


col : org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl@15b2f17
in the constructor of class modify device ....
XM DB selected ....
In the setDocumentConn method .....
col In the setDocumentConn method .....org.apache.xindice.client.xmldb.xmlrpc.Co
llectionImpl@15b2f17


ExceptionInInitializerError error : java.lang.ExceptionInInitializerError

 

 

what is the meaning of this error ExceptionInInitializerError


Yahoo! India Careers: Over 50,000 jobsonline.

Re: ExceptionInInitializerError

Posted by Imtiyaz <im...@yahoo.co.in>.
 

hello sir 
i am getting above error during the runtime. 
i am using xindice(xml db) and it is deployed on tomcat 
i am written prgm which is used to access the xindice from tomcat it is 
working fine 
very well when i run that prgm. 

but when that running prgm i make in one package and throgh one button i am 
calling 
that running prgm but it is giving above excption (this i am trying on sun 
one studio) 

so i am not able to understand why the running prgm is not working when i 
make the package and 
call that prgm through other prgm. 

the code that i used is 

in this fuction it shows the error on this bolded line 




public void setDocumentConn(java.lang.String docName) { 
try { 
System.out.println("In the setDocumentConn method ....."); 

document = (XMLResource) col.getResource(docName); 
System.out.println("After the resource creation ....."); 
String docstr = (String) document.getContent(); 
System.out.println("After creating the document ....."); 
doc = DocumentHelper.parseText(docstr); 
System.out.println("After creating the final document ....."); 
} 
catch(ExceptionInInitializerError e) 
{ 
System.out.println("ExceptionInInitializerError error : "+e); 
} 
catch (XMLDBException e) { 
System.err.println("XML:DB Exception occured " + e.errorCode 
+ " " + 
e.getMessage()); 
} 
catch(Exception e) { 
System.out.println("Error : "+e); 
} 
} 


 
 
 
 
 
Vadim Gritsenko <va...@reverycodes.com> wrote:
Imtiyaz wrote:

> what is the meaning of this error ExceptionInInitializerError
>

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ExceptionInInitializerError.html

See stacktrace to learn what paticular initializer failed.

Vadim

Yahoo! India Careers: Over 50,000 jobsonline.

Re: ExceptionInInitializerError

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Imtiyaz wrote:

> what is the meaning of this error ExceptionInInitializerError
>

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ExceptionInInitializerError.html

See stacktrace to learn what paticular initializer failed.

Vadim


Re: Problems with start of my web app and xindice within tomcat

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Andre Cavalcante wrote:

>Help me, please!
>
>When initiating a Servlet I try to make access to the Xindice, in the
>init() method of Servlet
>
>In log it appears:
>
>2004-07-07 14:55:30,343: nuteli.esquilo.dao.XMLDBServices        
>[DEBUG]: getCollection
>2004-07-07 14:55:30,515: xindice.client.xmldb.xmlrpc.DatabaseImpl
>[DEBUG]: Using SAX Driver: 'xerces'
>2004-07-07 14:55:30,515: xindice.client.xmldb.xmlrpc.DatabaseImpl
>[DEBUG]: Using Service Location: '/xindice/'
>2004-07-07 14:55:30,515: xindice.client.xmldb.xmlrpc.DatabaseImpl
>[DEBUG]: Using URI: 'http://localhost:8080/xindice/'
>
>In stdout.log it appears:
>
>trying to register database
>
>XMLDBService is the class that makes access to the Xindice.
>
>The problem:  The Tomcat wait starting of the Servlet, but it not
>start...
>and Tomcat service stay hold
>
>If I use XMLDBService not in the init() of Servlet it´s works
>perfectly.
>
>Somebody knows what it can be occurring?
>  
>

Do you have xindice and your application in the same Tomcat? IIRC, 
Tomcat won't start responding on port 8080 till the server is completely 
started - meaning, it first start all web applications, and then will 
start accepting requests on port 8080.

Now, if you try to access port 8080 during server startup, you got a 
deadlock.

You can do one of the following:
(a) Deploy xindice (XindiceServlet) together with your web app, do not 
deploy Xindice separately. This will allow you to use embed protocol - 
it will be faster and won't need communication over socket.
(b) Don't access xindice from init of your servlet
(c) Don't load your servlet on startup, then init will be called later 
on, on first request.

Vadim


Re: Problems with start of my web app and xindice within tomcat

Posted by Andre Cavalcante <al...@yahoo.com.br>.
Thanks for your aid!

I want to use xindice embedded, but in dev time is better use 
standalone sever...

I resolved this problem make access to xindice after load...

André



--- Vadim Gritsenko <va...@reverycodes.com> escreveu: > Andre
Cavalcante wrote:
> 
> >Help me, please!
> >
> >When initiating a Servlet I try to make access to the Xindice, in
> the
> >init() method of Servlet
> >
> >In log it appears:
> >
> >2004-07-07 14:55:30,343: nuteli.esquilo.dao.XMLDBServices        
> >[DEBUG]: getCollection
> >2004-07-07 14:55:30,515: xindice.client.xmldb.xmlrpc.DatabaseImpl
> >[DEBUG]: Using SAX Driver: 'xerces'
> >2004-07-07 14:55:30,515: xindice.client.xmldb.xmlrpc.DatabaseImpl
> >[DEBUG]: Using Service Location: '/xindice/'
> >2004-07-07 14:55:30,515: xindice.client.xmldb.xmlrpc.DatabaseImpl
> >[DEBUG]: Using URI: 'http://localhost:8080/xindice/'
> >
> >In stdout.log it appears:
> >
> >trying to register database
> >
> >XMLDBService is the class that makes access to the Xindice.
> >
> >The problem:  The Tomcat wait starting of the Servlet, but it not
> >start...
> >and Tomcat service stay hold
> >
> >If I use XMLDBService not in the init() of Servlet it´s works
> >perfectly.
> >
> >Somebody knows what it can be occurring?
> >  
> >
> 
> Do you have xindice and your application in the same Tomcat? IIRC, 
> Tomcat won't start responding on port 8080 till the server is
> completely 
> started - meaning, it first start all web applications, and then
> will 
> start accepting requests on port 8080.
> 
> Now, if you try to access port 8080 during server startup, you got
> a 
> deadlock.
> 
> You can do one of the following:
> (a) Deploy xindice (XindiceServlet) together with your web app, do
> not 
> deploy Xindice separately. This will allow you to use embed
> protocol - 
> it will be faster and won't need communication over socket.
> (b) Don't access xindice from init of your servlet
> (c) Don't load your servlet on startup, then init will be called
> later 
> on, on first request.
> 
> Vadim
> 
>  

=====
-----------------------------
André Luiz Duarte Cavalcante
Engenheiro
Manaus, AM, Brasil
aldc02@yahoo.com.br


	
	
		
_______________________________________________________
Yahoo! Mail agora com 100MB, anti-spam e antivírus grátis!
http://br.info.mail.yahoo.com/

Re: Problems with start of my web app and xindice within tomcat

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Andre Cavalcante wrote:

>Help me, please!
>
>When initiating a Servlet I try to make access to the Xindice, in the
>init() method of Servlet
>
>In log it appears:
>
>2004-07-07 14:55:30,343: nuteli.esquilo.dao.XMLDBServices        
>[DEBUG]: getCollection
>2004-07-07 14:55:30,515: xindice.client.xmldb.xmlrpc.DatabaseImpl
>[DEBUG]: Using SAX Driver: 'xerces'
>2004-07-07 14:55:30,515: xindice.client.xmldb.xmlrpc.DatabaseImpl
>[DEBUG]: Using Service Location: '/xindice/'
>2004-07-07 14:55:30,515: xindice.client.xmldb.xmlrpc.DatabaseImpl
>[DEBUG]: Using URI: 'http://localhost:8080/xindice/'
>
>In stdout.log it appears:
>
>trying to register database
>
>XMLDBService is the class that makes access to the Xindice.
>
>The problem:  The Tomcat wait starting of the Servlet, but it not
>start...
>and Tomcat service stay hold
>
>If I use XMLDBService not in the init() of Servlet it´s works
>perfectly.
>
>Somebody knows what it can be occurring?
>  
>

Do you have xindice and your application in the same Tomcat? IIRC, 
Tomcat won't start responding on port 8080 till the server is completely 
started - meaning, it first start all web applications, and then will 
start accepting requests on port 8080.

Now, if you try to access port 8080 during server startup, you got a 
deadlock.

You can do one of the following:
(a) Deploy xindice (XindiceServlet) together with your web app, do not 
deploy Xindice separately. This will allow you to use embed protocol - 
it will be faster and won't need communication over socket.
(b) Don't access xindice from init of your servlet
(c) Don't load your servlet on startup, then init will be called later 
on, on first request.

Vadim


Problems with start of my web app and xindice within tomcat

Posted by Andre Cavalcante <al...@yahoo.com.br>.
Help me, please!

When initiating a Servlet I try to make access to the Xindice, in the
init() method of Servlet

In log it appears:

2004-07-07 14:55:30,343: nuteli.esquilo.dao.XMLDBServices        
[DEBUG]: getCollection
2004-07-07 14:55:30,515: xindice.client.xmldb.xmlrpc.DatabaseImpl
[DEBUG]: Using SAX Driver: 'xerces'
2004-07-07 14:55:30,515: xindice.client.xmldb.xmlrpc.DatabaseImpl
[DEBUG]: Using Service Location: '/xindice/'
2004-07-07 14:55:30,515: xindice.client.xmldb.xmlrpc.DatabaseImpl
[DEBUG]: Using URI: 'http://localhost:8080/xindice/'

In stdout.log it appears:

trying to register database

XMLDBService is the class that makes access to the Xindice.

The problem:  The Tomcat wait starting of the Servlet, but it not
start...
and Tomcat service stay hold

If I use XMLDBService not in the init() of Servlet it´s works
perfectly.

Somebody knows what it can be occurring?

I'm using:
xindice v1.1b4 (load on startup = 1)
squirrel (my webapp: load on startup = 5)
Tomcat 4.1.30
Windows 2000 Pro


Andre Cavalcante
Manaus, Amazonas, Brasil



	
	
		
_______________________________________________________
Yahoo! Mail agora com 100MB, anti-spam e antivírus grátis!
http://br.info.mail.yahoo.com/