Help coderanch get a
new server
by contributing to the fundraiser

Rajat Bhatnagar

Greenhorn
+ Follow
since Mar 11, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rajat Bhatnagar

I am trying to deploy my first JSF application in tomcat 5.5 . The directory structure is fine and so are the tag entries in faces-config.xml and web.xml.

But when i try to deploy it in Tomcat it throws an exception.
I tried 3 alternatives as seen in forums but they don't work:

These Alternatives are

1. PLace jstl.jsr in lib folder of tomcat

2. add this entry to the web.xml of application
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>

3. add this entry to the web.xml of application
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>


The StackTrace is


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet.init() for servlet Faces Servlet threw exception
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:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
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.NullPointerException
javax.faces.webapp.FacesServlet.init(FacesServlet.java:144)
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:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
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)
[ September 23, 2008: Message edited by: Rajat Bhatnagar ]
15 years ago
JSF
Here is an amazing article that helped me in jumpstarting with webservices deployment.

http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html
16 years ago
IWAB0380E Errors were encountered while validating XML schemas.
XSD: The location '' has not been resolved
XSD: Type reference 'http://dto.inservci.infosys.com#LoginInput' is unresolved
XSD: Type reference 'http://dto.inservci.infosys.com#LoginOutput' is unresolved
XSD: Type reference 'http://dto.inservci.infosys.com#LoginInput' is unresolved


error has been resolved.

I just moved the LoginInput and LoginOutput java files from the dto package to the package where i had the the java file having a method which was being exposed as a webservice and it worked fine
16 years ago
I am trying to publish my login module as a webService and am facing some errors during deployment time.

In the WebExplorer it says something like

IWAB0380E Errors were encountered while validating XML schemas.
XSD: The location '' has not been resolved
XSD: Type reference 'http://dto.inservci.infosys.com#LoginInput' is unresolved
XSD: Type reference 'http://dto.inservci.infosys.com#LoginOutput' is unresolved
XSD: Type reference 'http://dto.inservci.infosys.com#LoginInput' is unresolved

IWAB0381I file:/D:/workspace/TMS/WebContent/wsdl/LoginUserProcessor.wsdl was successfully opened.

i have made sure that everything is in place but still i see a blank
screen by the URL http://localhost:8080/TMS/services/LoginUserProcessor



and when i append ?wsdl to the above URL

http://localhost:8080/TMS/services/LoginUserProcessor?wsdl

i see an error message like

AXIS error

Sorry, something seems to have gone wrong... here are the details:

Exception - java.lang.NoClassDefFoundError



I am not able to understand that where am i going wrong.

I am using Axis,Eclipse Europa 3.3 for development and deployment and Tomcat as the Container

Thanks in advance
[ July 31, 2008: Message edited by: Rajat Bhatnagar ]
16 years ago
It still doesn't work..

Even when i set the value by saying (new Gertude()).setNumber(200);
before the SOP it still prints the value as 0

16 years ago
i have a simple class Gertude in which i have a private variable number of type int.

I access this variable by getter and setter methods.

initially i set the value of this number to 100 by saying gerry.setNumber(100);and print it back by System.out.println(gerry.getNumber()) where gerry is a Gerude object.

Everything runs fine till here

But When I try printing the value of this gertude variable
by saying (new Gertude()).getNumber() it always comes to 0

I cant understand as to why this mismatch is happening

My code is

16 years ago
I just need to get the visibility of connection type outside of the try block.

How to do it is not what i am able to find out>>

Sorry for the incomplete post.

then in the other five operation specific methods i just say

Connection connection = DBObject();

However this approach is not working and i am getting a null pointer exception as the DBObject() method is not able to return a connection object.

i cannot understand as to why this is happening.
Also is this the right approach from the design perspective.
If not please let me know what's the right approach.

Thanks in advance
I have a particular scenario where i have five methods in a class.
All of the methods require to connect to database to perform some operation

So what i ideally want to do is have five operation specific methods
and one DBMethod where i establish the connection and return back the connection object . i.e the signature would be like

public Connection DBObject(){
//Establishing connection with a type 4 driver

}
Hi

Just try the following steps:

1. Check the Container Logs..They will tell you where you are going wrong.Tomcat logs directory is present in <TOMCAT-INSTALL-DIRECTORY>/logs

2. ARE you using a script to start your container or is does it start as a service.If Your OS is Windows you can use the standalone installation of Tomcat that runs as a windows service.

Anyways that doesn't have any relationship with the problem and its up to you tco choose.

3.It might be possible that you might be have conflicts with the Port 8080.
Long time back i faced the same problem.In case nothing works just open the server.xml file located in <TOMCAT-INSTALL-DIRECTORY>/\conf path.Change the Port to some other value say 8111. and try restarting Tomcat..

I hope this works for you.
You can use the commmand netstat -ao on the command line to check the ports you are listening to .
16 years ago
JSP
hi BEN

i have a slight confusion here.

Whatever you are saying is right but according to me we can play around with relative paths only to a certain degree.

If we have to deploy a servlet then offcourse we can hide the path from the end user by changing its <url-pattern> tag in deployment descriptor.

But the base of the URL ie http://localhost:8080/<WEB-APPLICATION-NAME> has to be fixed..

I don't think this can be changed as this this is the root path of our Servlet Container (Tomcat) + web application..

Also i wanted to know that if i have a Jsp say x.jsp in webapps/Test-Application-Directory and i want to access via a html page..

Then if have to explicitly mention http://localhost:8080/Test-Application/x.jsp..

Is there any by which we can hide this from the end User. i.e HARDCoded path in HTML page FORM ACTION...

Thanks in Advance
16 years ago
I think i pasted the wrong version of code here.

just ignore the

Part
16 years ago
A lot of things to tell here

1. Use a type4 java driver.
2. Instead of blatantly pasting your code mention where do you think you might be going wrong.

3. Dont't just code..Think and code.

I am sending you the Code for oracle connectivity.
Just make sure that you have the oracle jars in your classpath while trying to run it.
Also change the UserName,Password and Other details in the Connection string.

[edit]Disable smilies. CR[/edit]
[ June 04, 2008: Message edited by: Campbell Ritchie ]
16 years ago
The requested resource (/Servets/a.html) is not available.

You Might be going wrong because in the form action of your html you have entered some wrong URL.

Ideally the URL should be like
<form method="POST" action="http://localhost:8080/<WEB_APPLICATION_NAME>/SERVLET_NAME>

</form>

Here 8080 is the port on which tomcat is deployed.

Also make sure that you have made the correct entries in your web.xml file for the corresponding SERVLET_NAME. There are some tags like <servlet-name>,<servlet-class> and <url-pattern> for which you need to enter some data corrresponding to your servlet.

Good Luck
16 years ago