Recovering an eclipse web project

  • Thread starter Michael Preminger
  • Start date
M

Michael Preminger

Hello!

I have been developing a jsp project using eclipse for a while now.

I was very careful, saving the wokspace into a zipped folder from
time
to time.

Today I was trying to recover a recent version, as the development
went astray. I just ditched the current workspace directory, went to
the zip and recovered the "old" workspace into the same directory. I
had not change the state of my PC in any way that (to my
understanding) should affect such a recovery operation.

My disappointment was enormous when I found out that this was totally
failed.

Eclipse started as if I just downloaded it. I had to "import" the
project. The workspace did not seem to maintain a single references
to
any external jar I was using. Everything had to be re-collected.
More than that: It does not even recognize the project as a web
project (which is pure bullshit)
I do not even get to save it as a war.

1. What can be the reason for this non-understandable behavior? Whats
the point in having a workspace?
2. How can I make eclipse accept my project as a web project and let
me save a web archive of it?

Thanks

Michael
 
L

Lew

Michael said:
I have been developing a jsp project using eclipse for a while now.

I was very careful, saving the wokspace into a zipped folder from
time to time.

That's not careful, that's careless. Using a version-control system
like git or CVS is careful.
Today I was trying to recover a recent version, as the development
went astray. I just ditched the current workspace directory, went to
the zip and recovered the "old" workspace into the same directory. I
had not change the state of my PC in any way that (to my
understanding) should affect such a recovery operation.

My disappointment was enormous when I found out that this was totally
failed.

Eclipse started as if I just downloaded it. I had to "import" the
project. The workspace did not seem to maintain a single references
to any external jar I was using. Everything had to be re-collected.
More than that: It does not even recognize the project as a web
project (which is pure bullshit)

But not really Eclipse's fault.
I do not even get to save it as a war.

1. What can be the reason for this non-understandable behavior? Whats
the point in having a workspace?

That's two questions. As for understandability, that's cured by the
answer, which is that you likely did not restore the Eclipse metadata
(stored in a folder named ".metadata"), which can happen if you aren't
sure to notice the file and directory names that begin with
"." ("dot").

The answer to the second question is that a workspace allows Eclipse
to manage your development process.
2. How can I make eclipse accept my project as a web project and let
me save a web archive of it?

I'm not sure of the answer to this third question. It might work to
start a brand-new "web" project then copy your work into it.

In future, don't be so careless. Use version control.
 
A

Arved Sandstrom

Michael said:
Hello!

I have been developing a jsp project using eclipse for a while now.

I was very careful, saving the wokspace into a zipped folder from
time
to time.

Today I was trying to recover a recent version, as the development
went astray. I just ditched the current workspace directory, went to
the zip and recovered the "old" workspace into the same directory. I
had not change the state of my PC in any way that (to my
understanding) should affect such a recovery operation.

My disappointment was enormous when I found out that this was totally
failed.

Eclipse started as if I just downloaded it. I had to "import" the
project. The workspace did not seem to maintain a single references
to
any external jar I was using. Everything had to be re-collected.
More than that: It does not even recognize the project as a web
project (which is pure bullshit)
I do not even get to save it as a war.

1. What can be the reason for this non-understandable behavior? Whats
the point in having a workspace?
2. How can I make eclipse accept my project as a web project and let
me save a web archive of it?

Thanks

Michael

In principle this ought to have worked. Lew's advice is sound - if
you're talking "versions" then use real version control. Having said
that, I've occasionally zipped up Eclipse and NetBeans projects and
handed them over to someone else on a stick, and things work just fine.

What happened to you is likely what Lew surmised, that your .metadata
folder didn't get zipped up too. You want to be careful with hidden
files - on any OS - and various tools.

In future, if you're going to entrust important files to *any* kind of
backup - version control and/or archiving and/or pure backup, whatever -
run through the process at least once with a representative small set of
files.

AHS
 
L

Lew

Arved said:
In future, if you're going to entrust important files to *any* kind of
backup - version control and/or archiving and/or pure backup, whatever -
run through the process at least once with a representative small set of
files.

The problem is that people think of "backup" and stop there. Backing up isn't
important, restoring is.

Backup utilities used to advertise how quickly they could back up. Problem
was, those fast backups were unusable for restoration. Those utilities could
back up in a restorable way, but the speeds were less than 10% of what was
advertised. I feel quite sure that a lot of people were bitten by that; I
know I was the first time I tried to restore one of those fast "backups".
Luckily I had done what you suggested, a trial run first before losing data.

Remember, you aren't "doing a backup", you are "preparing a restore".
 
J

Jukka Lahtinen

Lew said:
Backup utilities used to advertise how quickly they could back up.
Problem was, those fast backups were unusable for restoration. Those
utilities could back up in a restorable way, but the speeds were less than
10% of what was advertised. I feel quite sure that a lot of people were

OTOH, you probably make those backup copies far more often than restore
from them.
I consider the speed of backing up more important than the speed of
restoring form backups.
 
L

Lew

Jukka said:
OTOH, you probably make those backup copies far more often than restore
from them.
I consider the speed of backing up more important than the speed of
restoring form backups.

So you prefer fast and unusable over slow and safe.

Backups are not that slow and usually unattended. Checkins to version control
are fast.

Backups are not something you should optimize for speed. Your priorities are
insane.
 
J

Jukka Lahtinen

So you prefer fast and unusable over slow and safe.

That's not what I wrote. I wasn't talking about speed over safety, only
about where processor time is probably more used.
Backups are not that slow and usually unattended. Checkins to version
control are fast.

Backups are not something you should optimize for speed. Your priorities
are insane.

And neither did I say anything about whether you "should" optimize for
speed or something else. Only an idea about WHERE speed could affect
more often. Your words could be understood to mean that you usually
need to restore many times from the same backups.
 
L

Lew

Jukka said:
And neither did I say anything about whether you "should" optimize for
speed or something else. Only an idea about WHERE speed could affect
more often. Your words could be understood to mean that you usually
need to restore many times from the same backups.

You mean misunderstood to mean that.

Don't put words in my mouth.
 
J

Jukka Lahtinen

You mean misunderstood to mean that.
Don't put words in my mouth.

You started with "So you prefer fast and unusable over slow and safe"
that you snipped this time.

I was just thinking about the general principle, that IF you start
optimizing, you should begin with the parts of the code that are most
frequently used and use the most total runtime.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top