java - JSP does not create class of servlet on linux -


this jsp code called html file...

<% system.out.println("debug1"); int id = (request.getrequestedsessionid()+request.getremoteaddr()).hashcode(); system.out.println("debug2"); servletclass d = new servletclass(id); // stuck here system.out.println("debug3"); string sen = request.getparameter("data"); string name = request.getparameter("name"); system.out.println("sen: "+sen); string rtn = d.runjob(name, sen); system.out.println("rtn: "+rtn); %> 

i developed project on windows eclipse , tried war deployment test on windows. worked wanted.

but when copy war file linux , tried deploy on it, new servletclass(id) not working. terminal shows debug1 , debug2.

of course, changed server.xml in linux

is there difference between windows , linux? on centos 7.

p.s. used apache tomcat 8.0.24



edit

i'm sorry can't upload class code because of part of work company. invokes several methods in javase. ported javase project javaee.

but rc., think found why happened log shows

logs (from catalina.-today-.log) / click see large image

enter image description here

i manually installed apr, apr-util, pcre , tomcat. why happens?

and 1 more error not existed in windows,

03-aug-2015 15:20:15.546 warning [main] org.apache.tomcat.util.digester.setpropertiesrule.begin [setpropertiesrule]{server/service/engine/host/context} setting property 'source' 'org.eclipse.jst.jee.server:chatbot' did not find matching property. 

well, think not problem, installed eclipse in linux too.

the code looks strange - seems heavily abbreviated? there 2 options - either servletclass (is name of class?) contains endless loop (and request never ending) or throws exception or error gets swallowed somewhere else.

you can try debugging wrapping call in try/catch clause:

system.out.println("debug2"); try {     servletclass d = new servletclass(id); } catch (throwable t) {     t.printstacktrace(); } system.out.println("debug3"); 

this way you'll see if there's exception or error that's swallowed. if find something, continue there.

also, hope servletclass not servlet, typically don't create servlets leave task application server. future maintainers favour , have logic in non-servlet class if instantiate way you're doing here.


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -