jasonsmith nath

Greenhorn
+ Follow
since Dec 31, 2018
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by jasonsmith nath

Hello,

New to Java.

I have written a class named School with few attributes and 2 simple methods. This java file compiled successfully.

I want to instantiate object of this School in another class called SchoolApp which has Main method. I am using sublime as text editor.

How to import or refer the School class file in my SchoolApp file?

Here is the code of SchoolApp file:



When I compile SchoolApp (javac SchoolApp.java), I am getting the following error:

SchoolApp.java: error: cannot find symbol
School aschool = new School();

I am sure I don't know how to reference School class in my SchoolApp.java file. Any suggestions how to fix this.

Thank you very much
4 years ago
Hello Good Folks of CodeRanch,

I read about servlets. They are run by Servlet container on Web server. Does each servlet hosted on a web server has a separate container to run it or there is only one Container that runs all Servlets installed on that server?

thank you very much
5 years ago
Hello Good folks

Today I wrote a simple servelet and ran it and I am able to see it working.

But no catalina log files are being created today. Yesterday I have catalina log files at C:\Program Files\Apache Software Foundation\Tomcat 7.0\logs.

Does catalina log files are genearated only when there are issues?

Thank You folks
5 years ago
I restarted my computer and it works now.
5 years ago
Catalina log has the follwoing information:

I made sure that Apache Tom cat service is not running in Services.msc

Dec 31, 2018 1:19:23 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\ROOT has finished in 59 ms
Dec 31, 2018 1:19:23 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1452 ms
Dec 31, 2018 1:19:23 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]:
java.net.BindException: Address already in use: NET_Bind
at java.base/java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.base/java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
at java.base/java.net.AbstractPlainSocketImpl.bind(Unknown Source)
at java.base/java.net.PlainSocketImpl.bind(Unknown Source)
at java.base/java.net.ServerSocket.bind(Unknown Source)
at java.base/java.net.ServerSocket.<init>(Unknown Source)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:444)
at org.apache.catalina.startup.Catalina.await(Catalina.java:798)
at org.apache.catalina.startup.Catalina.start(Catalina.java:744)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428)

Dec 31, 2018 1:19:23 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Dec 31, 2018 1:19:23 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2018 1:19:23 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Dec 31, 2018 1:19:23 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
5 years ago
Thank You. Adding that package fixed the PrintWriter problem.

When I run the servlet, it gives 404 error. Tomcat is up and running.

should I start a new topic for this ?

Thank you for supporting me. I will be in a better shape soon.

5 years ago
Hello folks,

I just started learning Java Web development. I tried doing HelloWorld servlet.

I am getting 'PrintWriter can't be resolved to a type' error. I didn't use Maven to build this project.
Any suggestions for this beginner is greatly appreciated.

Thank you


5 years ago