Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!

Sachin Joshi

Ranch Hand
+ Follow
since Aug 06, 2008
Sachin likes ...
Spring Tomcat Server Java
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sachin Joshi

Tried it, doesn't work either. I am now using googlechrome instead.
9 years ago
I am trying to run selenium test cases on my site from windows machine and getting a wierd firefox launching problem from past few days.

I have tried few options per selenium FAQ page, however the problem still persists.
I have tried following things

1. I have tried cleaning up the C:\DOCUME~1\fromdev\LOCALS~1\Temp directory. The directory mentioned in the java stacktrace does not really exist on my system.
2. I have also tried restarting my system, just avoid any existing processes causing this.
3. I have also tried checking the task manager on my windows machine and I dont see any firefox processes.
4. I have also tried removing existing firefox profiles and recreating them.
5. I have also tried firefox with no-addon mode, however no difference.

The exception stacktrace is as shown below.

12:06:54.218 INFO - creating new remote session
12:06:54.218 INFO - Allocated session 6461092698d344f0b9856f9152024b63 for http://www.fromdev.com, launching...
12:06:54.234 INFO - Preparing Firefox profile...
12:07:15.238 ERROR - Failed to start new browser session, shutdown browser and clear all session data
java.lang.RuntimeException: Firefox refused shutdown while preparing a profile
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.wai
tForFullProfileToBeCreated(FirefoxChromeLauncher.java:371)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.pop
ulateCustomProfileDirectory(FirefoxChromeLauncher.java:120)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.lau
nch(FirefoxChromeLauncher.java:90)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.lau
nchRemoteSession(FirefoxChromeLauncher.java:416)
at org.openqa.selenium.server.browserlaunchers.FirefoxLauncher.launchRem
oteSession(FirefoxLauncher.java:118)
at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSessi
on(BrowserSessionFactory.java:374)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession
(BrowserSessionFactory.java:125)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession
(BrowserSessionFactory.java:86)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowse
rSession(SeleniumDriverResourceHandler.java:809)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(Se
leniumDriverResourceHandler.java:435)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleComman
dRequest(SeleniumDriverResourceHandler.java:405)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(Selen
iumDriverResourceHandler.java:149)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)

at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:9
86)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.
java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Caused by: org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher$FileLockRemainedException: Lock file still present! C:\DOCUME~1\fromdev\LOCALS~1\Temp\customProfileDir6461092698d344f0b9856f9152024b63\parent.lock
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.wai
tForFileLockToGoAway(FirefoxChromeLauncher.java:322)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.wai
tForFullProfileToBeCreated(FirefoxChromeLauncher.java:369)
... 20 more
12:07:15.238 INFO - Got result: Failed to start new browser session: Error while
launching browser on session null




Any help or suggestions are welcome, I am running out of ideas to fix this problem.
9 years ago
what are you trying to do here? are you trying to get the username? why do you want to use HTTP ServletRequest ? Which portal are you using? I found something for liferay here
9 years ago
I guess you need to do following

1. Use a Library like POI from Apatche to read the excel file

2. Then use File IO Library like Apache Commons - IO to created the directory structure.


Hope this helps

9 years ago
Learning by questions can be short term solution for your job need but it may not really get you going on the java programming job. If you want to be successful in long run then try Some sites I really found useful in learning Java

1. Sun's Java Tutorial - On-line version of book from Addison-Wesley. Learning all about Java.

2. Good videos for learning eclipse with java.

3. Java Technology has become huge with lots of frameworks and libraries, so have a look at Some things you must know about Java

4. I would also recommend to refer some good books. "Thinking in Java" is my favorite one or pick any from 5 best Core Java Books

5. I would also recommend you to start doing some hands on coding. Its always better to try some code to understand the concepts well.
9 years ago
I dont think there any interceptor like that. But you can easily write your own.

Checkout this Struts2 Interceptor


_______________________________________________
Try Struts 2
11 years ago
Sorry, I guess I didnt read your question completely. You probably are using struts 1.3.8.

Can you please post your code?
11 years ago
1. You may need to use JavaScript reset() function for resetting all fields in HTML form. Here is one link I just picked from a quick google search JavaScript Reset

2. This is a example from Showcase application which should help you understand the Struts2 AJAX Autocomplete dropdown population on change event

I didnt understand what 1.3.8 is? Is this Struts version? or Java?
11 years ago
Also it will be good to keep the current directory in CLASSPATH. you can add it like

Windows:



Linux:

11 years ago
Here is a good book I would suggest you to refer for better understanding on threading "Thinking in Java" by Bruce Eckel
This is fundamental question about thread synchronization and lock.
You need to understand how locking works when we use synchronized keyword.

Just to answer this question, Other threads can enter other methods of "that object" if those methods are not synchronized.

Here are more similar scenarios you can look at and brainstorm about. Java Threading Questions

Best way to learn threading fundamentals is to start writing simple programs and observe the output.
What Java version you are using? If its JDK1.5 or later then you should look at the java.util.concurrent package. JDK API

I guess You must be looking for something like a BlockingQueue, there are many implementation of BlockingQueue available and if you want you can write your own by implementing BlockingQueue interface.

Here is a example how you can use the ArrayBlockingQueue in multi threaded environment.
JEP is a good Java library, and its 2.4.1 version was GPL.

The Boolean expressions are supported but it does not give direct boolean result.

The results of a boolean expression would be returned to you as a Double object where 1.0 = TRUE and 0.0 is FALSE.


The Boolean Expression Evaluation Example code can be used as a Utility in your application for Boolean expression evaluation.
[ September 22, 2008: Message edited by: Sachin Joshi ]
SoftReference are good way to implement memory efficient cache as the Java Specification says that Garbage collector will clear all soft references before throwing OutofMemoryError.

Code will definitely become more complex then a simple HashMap cache, so if you are going to build a really memory consuming cache then you can utilize a SoftReference based cache.

Here is an example of [ Cache Using SoftReference ]

There are more ways to implement reference queue clean up logic. May be other people on forum can also give input on the same.
12 years ago
Not sure on this issue but I hope you are using the proguard.pro file for making sure that your startup classes are not obfuscated. For example




This piece of configuration will make sure you MyStartupClass name and its method startMethod name is intact after obfuscation.

If this is not the problem, then I would suggest you to use a decompiler like jadclipse and try debugging where its breaking.
12 years ago