terr lundamo

Greenhorn
+ Follow
since Dec 08, 2010
Merit badge: grant badges
For More
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 terr lundamo

It compiles, now to figure out how to run this project:)

Thank you!
11 years ago
findjar.com is bookmarked! never seen that site

I'll try using axis1.

11 years ago

Muhammad Saifuddin wrote:Try this short key Ctrl+Shift+O.
This will organize imports meaning only import packages used by class.



Thanks for the tip but no luck, "0 imports added"
11 years ago
Hello,

I've just taken over an eclipse project. It's a webservice. This is the first web service project i've looked at, also i've never worked with eclipse, so i might have missed something basic.

There's a lot of "cannot be resolved to a type" errors, org.apache.axis is one of them.

- I added all the jar files that came with the project to build path libraries. Including all the axis2 jar files.
- The jar files is now located under project -> Referenced Libraries.
- Under preferences -> Web Services -> Axis2 Preferences i've set the Axis2 runtime location. "Axis2 runtime loaded successfully".
- Added server Tomcat v7.0

I've searched the web for some time, but i'm stuck at the moment.

Am i missing anything?

11 years ago
Sorry for late reply, been sick all week.

anyway, i've tested with a 4 sec delay before closing the updater, and it works like a charm.

Thanks!
12 years ago
a little crazy day at work, so didn't get the chance to test with delay, will post results when i find the time
12 years ago

Martin Vajsar wrote:In Windows, there are some convoluted rules concerning application windows after launch, but I believe they govern focus, not visibility. However, if your updater application quits immediately after starting up the main app, it might influence things. Delaying the exit by a few seconds long sleep() after that just to see what happens cannot hurt.

When you run the application from command line, does it show up nicely? Does it behave the same on all computers?



I'll try delaying first thing tomorrow, i would think something like that is the problem/solution since it seems random when the problem occurs.
When i run the application from the command line it always shows up nicely on every computer, so there has to be some issue with the updater in combination with the bat file.

Thanks
12 years ago

Martin Vajsar wrote:Try to replace that code with this:

Let's see whether it changes anything.



When i try this it's the same result, except i see a process javaw.exe in task manager. Everything behaves the same.
Could it have anything to do with whether updater.jar manages to close itself before the main app starts up?
12 years ago

Martin Vajsar wrote:Maybe you could show us how do you run the bat file (I mean the code you use in updater.jar)? I'd say that you should be able to get rid of the bat file and run java (or javaw) directly from your updater application. It might help resolve the issue.

I also understand that the window of your application is not visible anywhere: taskbar, Alt-Tab list, Task Manager Applications tab (just in processes). Is this the case?

Also, I assume your main application is a Swing app. Do you initialize all Swing objects on an Even Dispatch Thread (using SwingUtilities.invokeLater and all that)? It kind of seems that the window of your application exists, but is hidden.



This is how i run the bat file from updater.jar

I don't remember why i had to use double "\\", but there has never been a problem launching the bat file


Sorry if i was unclear, i can see the application running in task manager applications as a process (java.exe or javaw.exe when i tried javaw insted of java).
Yes it's a swing application, nothing fancy about it really(event dispatch thread).
If i start the main application directly it always works

What makes it so strange is if i run the updater a second time (with the main app still just running in the background) it always works, also the main application "stuck" in the background also comes to the foreground, and then i have two visible windows of the main application. So the second run of the updater.jar makes the old and new main.app show.
12 years ago

Rob Spoor wrote:First of all, on Windows you have to use \ instead of / inside batch files and other commands. Java is lenient with java.io.File but Windows itself isn't.

If it's a windowed application you may want to use javaw.exe instead of java.exe. This will not show the command window.



Thanks

Ok, i changed to "\" and use javaw instead of java.
Actually I never got a command window from running java.exe, maybe it's because i run the bat file from updater.jar. If i run the bat file manually i get a command window.
Anyway, it's the same problem with javaw. The second time i ran the updater which launches the bat file, the main application didn't run in foreground.

Maybe i'm looking at this the wrong way.. The reason i use the bat file is because when i launch the main application from the updater, i can never close the updater since the main application is a child thread, and this would close both the updater and main application.
Is it a better way to do this perhaps?

12 years ago
btw, here is everything that's in the bat file:


Maybe there is better command than "java" that forces application to the foreground? can't find anything useful on google. Have tested it on several computers and same problem everywhere, seems to be random when it runs in background.
12 years ago
Hi all,

I've made an application that i distribute, when the application is launched i first launch a jar file that checks for updates.
When this is done it runs a batch file that launches the main application (sometimes newly updated by the updater).

All this is fine, but some times the main application does not show, it just runs in the background. I can see it's running in task manager (i'm on windows), and uses the same amount of memory as a normal run.
If i open a second instance of the application, the one stuck in the background will also show, so then i have to applications running and showing...

Any tips on how to fix this, so it never get "stuck" running in the background?
12 years ago
Hi,

I've run into a somewhat strange problem with printing. The printer is "ready", but there's still an error, so documents are queuing up.
So here's my code:



I've used the same code for at least 1 year without problems, so there's no doubt in my mind it's the printer causing this, is there any way to avoid getting this freeze?
I know a quick solution is to reconnect the printer and then all is good, but that doesn't cut it really..


Edit: notepad also freezes when trying to print to this printer.. so java is not the problem. anyway, feel free to add some knowledge


12 years ago
Ok, thanks for your help!

Stian
13 years ago
Thanks Rob Spoor!

I have never thought about why it needs to be double slashes, but that's just the way it is

I will try this out. I also found another solution involving running a bat file from the updater that starts the main application. Would you say one method is better than the other?

Stian
13 years ago