Eshwara Chaluvaiah

Greenhorn
+ Follow
since Jul 10, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Eshwara Chaluvaiah

Tim Moores wrote:Start by using a BC provider that matches your JRE. You seem to have one for Java 6 but you seem to be using Java 8. You should also upgrade to the latest version of BC - 1.46 is quite old.



Thanks Tim for the suggestion. i will try that and check.

Eshwara Chaluvaiah wrote:

Tim Moores wrote:Which value does "plaintext" have?



admin



and also ArrayIndexOutOfBoundsException is for different position sometimes its 4 sometimes its 5 and sometimes its random say 146 , like that.

Tim Moores wrote:Which value does "plaintext" have?



admin
Error while encrypting using SHA256. Getting ArrayIndexOutOfBoundsException , this is not every time. what is the issue with below part of my code.




Error is :

Caused by: java.lang.ArrayIndexOutOfBoundsException: 4
   at org.bouncycastle.crypto.digests.GeneralDigest.update(Unknown Source) ~[bcprov-jdk16-1.46.jar!/:1.46.0]
   at org.bouncycastle.crypto.digests.GeneralDigest.finish(Unknown Source) ~[bcprov-jdk16-1.46.jar!/:1.46.0]
   at org.bouncycastle.crypto.digests.SHA256Digest.doFinal(Unknown Source) ~[bcprov-jdk16-1.46.jar!/:1.46.0]
   at org.bouncycastle.jce.provider.JDKMessageDigest.engineDigest(Unknown Source) ~[bcprov-jdk16-1.46.jar!/:1.46.0]
   at java.security.MessageDigest.digest(MessageDigest.java:365) ~[na:1.8.0_181]
   at java.security.MessageDigest.digest(MessageDigest.java:411) ~[na:1.8.0_181]
   at com.eshwar.home.practice.util.PasswordUtil.encrypt(PasswordUtil.java:39)


Stephan van Hulst wrote:Why not just create a shortcut or batch script that supplies the JVM arguments?



can't we configure in some config file or embedded server config file.?
3 years ago
Hi , i just wanted to know how to set JVM(Heap configuration) parameters in spring boot application in order to improve my spring boot application performance.? i don't want to set while running spring boot jar in command line, i need to configure in some properties file or config file so that while starting spring boot app it should pick up those parameters. how to do that?
3 years ago

Eshwara Chaluvaiah wrote:

Stephan van Hulst wrote:The only way to kill a task (not a thread, you can't guarantee a thread will be killed if you use a thread pool, unless you use the incredibly dangerous Thread.stop()) is to communicate with it using signals. A signal can be as simple as a shared volatile flag, or you can check for the interrupted status of a thread if you don't use a blocking method:



This works .Thanks Stephan.

3 years ago

Piet Souris wrote:Oops... while testing my code, I made some silly mistake, making me believe what I wrote in my previous post. I apologize, there is nothing wrong with that code snippet. Leaves only question 3: if you leave out the Thread.sleep method, can you still make it work?



Without Thread.sleep(1000), you cannot kill the thread if its running without anything which throws InterruptedException.
3 years ago

Stephan van Hulst wrote:That's not a valid solution, as the goal is to terminate the thread from outside of the task.

As to the original code, the problem that it's not valid in the first place because you have an uncaught InterruptedException. Seeing as this is a homework assignment I won't give you the exact solution, but the answer is in dealing with that InterruptedException somehow.



sorry , forgot to surround with try catch block. This works fine. my question is , say you have some long running code a run method, if it does not exit for after sometime say 5 seconds i want to kill the thread, how to achieve that?

3 years ago
I need to stop(kill) the thread after 5 seconds. below is the code i have written for the same, but thread is not getting killed even after shutdownNow() call. Any idea what is wrong in this code.?


3 years ago
Hello everyone
after struggling to understand about the javac command finally it got worked using the following commands

/media/Movies/eshwar$ javac -d . myjava/ClassUser.java
/media/Movies/eshwar$ java myjava.ClassUser

7 years ago
Hi am still confuse about classes and packages while executing in command line. Below is my two simple classes which are in the same directory. namely Myclass.java and ClassUser.java.
Both the classes are in the directory /media/Movies/eshwar/myjava . and i have defined classes as follows(both are in separate file)
1)Myclass.java

2. ClassUser.java



i am compiling ClassUser.java in the directory myjava as follows
:/media/Movies/eshwar/myjava$ javac ClassUser.java

when i execute above command am getting symbol not found : myclass
according to me both are in same file, so it should compile but why its giving errror like this. even i used below command but got the same error

:/media/Movies/eshwar/myjava$ javac -cp . ClassUser.java

please help me to undestand packages and classes while executing in the command line
Advance thanks

7 years ago
Hello evryone
i am running a class from commandline in linux environment but i am getting java.lang.NoClassDefFoundError when i run the class. I am very confused about packages when running in command line. please can you tell me how to declare correct packages when developing a program without using any IDE. when i use IDE it wont be a problem but if i use some editor then i am very confused about that. Below is my program. please help me how to run the program?

package is start from the root. that is current directory is /media/Movies/eshwar/myjava
And Am using below command to run the program.Even though UseCaseTracker.class file in the currect direcotory i can't execute that.
java UseCaseTracker
7 years ago
sorry for late reply, i was bit busy.. ya i checked all, i have included same jars for some other project its working fine but its not working to this particular project.. i don't understand what the problem is?...
8 years ago