Re: forwarding JDOM-Objects

2006-01-13 Thread Christian Stalp
So I wrote this servlet, it gets a JDOM-object from another servlet and 
returns with a another attribute.


Document mydoc = (Document) 
this.getServletContext().getAttribute(jdom_object);


   TXMLObject tobj = TXMLObject.newInstance ( mydoc);
   ServletContext sercon = this.getServletContext();
   String giveback = Tamino_returnvalue;
   try {
   TConnection connection = 
TConnectionFactory.getInstance().newConnection( 
http://localhost/tamino/chris; );
   TXMLObjectAccessor xmlObjectAccessor = 
connection.newXMLObjectAccessor(

   TAccessLocation.newInstance( test1 ),
   TJDOMObjectModel.getInstance() );
   TResponse myret = xmlObjectAccessor.insert( tobj );
   connection.close();
   sercon.setAttribute( giveback , myret );
   } catch ( TConnectionException te ) { te.getCause(); } 
 catch ( TInsertException ie ) { ie.toString(); };


But something doesn't fit. Because I got this dump:

javax.servlet.ServletException: Error instantiating servlet class 
DatenbankEingabe

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)

org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

java.lang.Thread.run(Unknown Source)


*root cause*

java.lang.NoClassDefFoundError: 
com/softwareag/tamino/db/api/accessor/TInsertException
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
java.lang.Class.getConstructor0(Unknown Source)
java.lang.Class.newInstance0(Unknown Source)
java.lang.Class.newInstance(Unknown Source)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)

org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

Is this caused by the single thread? I wortk with Eclipse, and this has no 
problem finding a class. Hmmm but maybe tomcat.
Anyway I send this mail away.

Gruss Christian



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: forwarding JDOM-Objects

2006-01-13 Thread Christian Stalp

David Delbecq schrieb:


Your class in not available for your servlet.
Check in you war that com/softwareag/tamino/db/api/accessor/TInsertException 
is either in WEB-INF/classes, either in a .jar in WEB-INF/lib 



 

Mercy, this was really the problem. After I copied all .jar-files I need 
into the lib-folder I only get this error:


java.lang.NullPointerException

com.softwareag.tamino.db.api.objectModel.TXMLObjectFactory.newXMLObject(Unknown 
Source)
com.softwareag.tamino.db.api.objectModel.TXMLObject.newInstance(Unknown 
Source)
DatenbankEingabe.doGet(DatenbankEingabe.java:29)
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)


But why, a NullPointerException ? The servlet gets now all it need and 
the XMLObject is part of TaminoAPI4J.jar! I have no clue, what is the 
cause of this exception.


Gruss Christian


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: forwarding JDOM-Objects

2006-01-09 Thread Christian Stalp

Hello again, sorry for my late answer to this thread.

I desided to forward the JDOM-Object via tge servelt-context.
This solution wrote me Frode Halvorsen of the jdom-interest mailling list.

He wrote:


Hello.

Why don't you put it as an attribute to the servletcontext. Since both
revlets runs in the same container, they both have access to the same
servlet-context, and can exchange objects there ?

the sending one :
Document o = new Document();
this.getServletContext().setAttribute(jdom_object,o);


the recieving one :

Document o = (Document) this.getServletContext().getAttribute(jdom_object);

Frode Halvorsen



My only question now is, after I wrote this object, somewhere any 
servelt on that container can access on to it, how I can call the other 
servlet to start and process? With an URL?


Gruss Christian


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Single Thread is deprecated?

2006-01-06 Thread Christian Stalp

Remy Maucherat wrote:


It's deprecated because it is confusing, but it is actually very
useful performance wise in some cases, since it does pooling. I will
make sure this feature remains available in the future.

 

That means, I still can use it?! Deprecated is not prohibited!?!! Is 
there any alternative for such purposes?


Gruss Christian


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



forwarding JDOM-Objects

2006-01-06 Thread Christian Stalp

Hello again,
now I have another question. I want to forward a JDOM-object from one 
servlet to another in the same servlet-container. I thought I write this 
JDOM to a string, transfer it and unpack it at the other side.


BUT I cannot find a way to extract a JDOM from a String delivered by a 
HttpServletRequest.

I tried it this way:
String mystring = req.getParameter(Objekt);
   Document mydoc = mystring.?  - no method found
I thought there was a method anyway. What can I do here?

Thank you and...

Gruss Christian



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: forwarding JDOM-Objects

2006-01-06 Thread Christian Stalp

Duan, Nick wrote:


You shouldn't use req.getParameter(..).  Instead, use the setAttribute
and getAttribute methods in HttpServletRequest.  No need to pack/unpack
JDOM.  You can pass an object via request.

 


So...
String mystring = req.getAttribute(Object)
   Document mydoc = mystring.?   --- and now?

Thank you...

Gruss Christian


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: forwarding JDOM-Objects

2006-01-06 Thread Christian Stalp

Duan, Nick schrieb:


Don't forget type casting the object.

 


String mystring = req.getAttribute(Object).toString();
   Document mydoc = mystring.?

Casting from String to JDOM doesn't work!!!
So which way you prefer?

Thank you...

Gruss Christian


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Single Thread is deprecated?

2006-01-06 Thread Christian Stalp

Remy Maucherat schrieb:


Nice, but completely wrong. STM in Tomcat uses an instance pool which
allows having a minimal impact (something like 5%), and it will
perform much better than syncing, unless the said sync is trivial.

The reason this is deprecated is because some people thought it would
solve all their syncing problems, while it doesn't address many things
(like session access).

 

In my case the session-management will be realized by a front-servlet. 
This servlet accept all the input of the user. Package this input into 
JDOM-Objects and send this object to this single threaded servlet. 
This servlets does nothing but to access the database.


Gruss Christian


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: forwarding JDOM-Objects

2006-01-06 Thread Christian Stalp

Len Popp schrieb:


What type of object is the Object attribute supposed to be? If you
have a Document, you can do
   req.setAttribute(Object, mydoc);
in one servlet and
   Document mydoc = req.getAttribute(Object);
in the other.

If the Object attribute is a string representation of a Document,
you will have to do whatever is necessary to create a Document from
that string. (I don't know how JDOM works.)
--
 


Hi Len, thank you for your answer,
I would like to abdicate to transform the JDOM-Object into a String and 
later retransfer it to JDOM again.
I just thought that's the way. So if there is a way to send JDOM-objects 
directly, I will choose it ;-)


Gruss Christian


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]