Win a copy of Securing DevOps this week in the Security forum!

naveen shrimal

Greenhorn
+ Follow
since Dec 18, 2010
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
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by naveen shrimal

Hello Every one ,,, I am having a doubt on the exam code.What is the difference between the 1Z0 -860 and 1Z0-895.
What I am concerned about is that I am looking for EJB exam but it seems both talk about the same thing.
Can any one clarify it?

Thanks


Long tail=2000L;
Long distance=1000L;
Long story=1000L;
Integer d=900;
System.out.println((story*2)==tail); // here why it prints true is it because the anonymous object is pointing to
same tail object as in case of String immutaable class


Long h=story*2;
System.out.println(h==tail); // it prints false



can some 1 throw light on it
5 years ago
Suppose I do have code of 10 lines among then on second line I transfer the control on new resource (html,servlet,jsp any) than lines from 3 to 10 wont never get their canse to execute so why I am not getting Exception of Unreachable code here.
6 years ago

Jesper de Jong wrote:If you look at the API documentation of class BufferedOutputStream, you'll see that it inherits its close() method from FilteredOutputStream. And the documentation of the close() method for FilteredOutputStream says:


Closes this output stream and releases any system resources associated with the stream.

The close method of FilterOutputStream calls its flush method, and then calls the close method of its underlying output stream.


So you do not need to flush the stream explicitly or call close on on the underlying FileOutputStream.

You get a problem because you close the FileOutputStream in line 29, before your close the BufferedOutputStream in line 30. If you close the FileOutputStream first, then BufferedOutputStream can't flush the data anymore that it still might have in its buffer. So, the solution is to not close the FileOutputStream yourself; just let the BufferedOutputStream do that.

Make the finally-block look like this:





Thank you very much....this foroum is really good and encouragimg me to read a lot because for any trouble I feel like there is some one who will help me like you people.
6 years ago
HI to al,
I am facing problem while wrapping the FileInputStream into BufferedInputStream. I am not getting the desired putput on b.txt though the console shows the whole text of a.txt.
When I look arounf I finad two ways out:-
1. either i add a line that will forcefully flush the contents of BufferedInputStream
2. I should not close the FileUotputStream in finally clause.

I did not understand the second way....Why so happening? Because Finally executes in last.

one more question is that should I close both FileInputStream oblect and its Wrapper BufferedInputStream object or just the BufferedInputStream object's closing is enough.

6 years ago
I was too thinking about this but I want to make it sure. thanks for making it clear to me.
It is very good site.
6 years ago
When I am creating file using DataInputStream and entering primitive data types in the file named "a.txt" it shows some encoded text but when i read the same file through it displays output as expected ....
Here is the code...
6 years ago
@ above thanks to both of you ....

solved my problem and it was associated with web.xml of Apache...
7 years ago
i did not make any mapping.....no any web.xml...


n now when i try to run the examples provided by Apache Tomcat...even they are not running.....but I am getting apache running window in my browser...


Is it necessory to set catalina path......
i just set three environment variables
for java
JAVA_home for tomct
classpath for servlets ....


help me out
7 years ago
404 error posting here



Sir,,
i am new to servlet and Tomcat...
I am getting 404 error...
I have done these ..
Setted all the 3 paths...
1. path for java
2. classpath for servlet-api.jar
3. JAVA_HOME for tomcat...
...
..
After these My Tomcat is being shown on Browser....after typing "http://localhost:8080" and hence Tomcat is working...


Now i created the directory structure as below for my Demo servlet program,,,,

C:\Users\RAKESH\Desktop\naveen\code\apache-tomcat-7.0.6\webapps\my\WEB-INF\classes\Demo.class



now when i run the servlet by typing

http://localhost:8080/my/servlet/Demo

I am getting status 404 error...so please help me out.....

thanks in advance........
7 years ago
[quote=Lucas Mireles]You'll need to look that up but its basically when you use Apache server or something else as a proxy to the tomcat server.

How are you trying to access the tomcat server ... what URL are you using?[/quote]


i write in browser...
http://localhost:8080
after writing as i press enter the error log comes as i shown above
7 years ago
[quote=Lucas Mireles]if you are using an apache proxy make sure you are using the correct mod_jk.so[/quote]

No i am not using proxy even than thanks for your time...

And can you tell me what is this proxy like thing???

thanks in advance
7 years ago
getting error while starting Apache Tomcat 6 help me

the log file is as foollows

INFO: Server startup in 228 ms
19 Dec, 2010 8:40:01 AM org.apache.jk.common.MsgAjp processHeader
SEVERE: BAD packet signature 18245
19 Dec, 2010 8:40:01 AM org.apache.jk.common.ChannelSocket processConnection
SEVERE: Error, processing connection
java.lang.IndexOutOfBoundsException
at java.io.BufferedInputStream.read(BufferedInputStream.java:310)
at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:620)
at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:577)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:685)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:686)
at java.lang.Thread.run(Thread.java:619)


help me soon thanks in advance....
7 years ago
Getting Error while starting tomcat

the erroe log is showing this...


INFO: Server startup in 228 ms
19 Dec, 2010 8:40:01 AM org.apache.jk.common.MsgAjp processHeader
SEVERE: BAD packet signature 18245
19 Dec, 2010 8:40:01 AM org.apache.jk.common.ChannelSocket processConnection
SEVERE: Error, processing connection
java.lang.IndexOutOfBoundsException
at java.io.BufferedInputStream.read(BufferedInputStream.java:310)
at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:620)
at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:577)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:685)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:686)
at java.lang.Thread.run(Thread.java:619)




help me what to do



7 years ago