- This topic has 10 replies, 4 voices, and was last updated 19 years, 8 months ago by
David Orriss Jr.
-
AuthorPosts
-
harryajhMemberUsing Eclipse 3.1, ME 4 GA, Weblogic 8.1 (sp3) on win 2000 (sp4)
I have a Struts app (not that I think that make any difference?) – if I modify (Hot Swap) the “execute” method in any of the Action classes, activating any action after produces –
java.lang.ClassCastException at org.apache.struts.action.ActionServlet.getRequestProcessor(ActionServlet.java:855)
…………I HAVE to redeploy the app EVERY single time to want to see the effects of ANY changes!
I’m sure (pretty sure!) this used to work before I tried several of the ME 4 milestone builds & have no idea why it is doing it?
Can you help at all?
cheers
P.S read a previous similar post “NoClassDefFoundError after hot swap” from “schuer” but this was to do with sp2 – I’m 99.9% sure this to work fine under sp3!
harry
Scott AndersonParticipantHarry,
We haven’t changed any of this tooling for the deployment, and the actual injection of the new class into the remote JVM is handled by the JVM’s themselves. Given what you’re seeing, I’d guess that you’re using different JDK’s for running WebLogic than you’re using to compile the code within Eclipse or that you’re somehow using different libraries in deployment than in development (which would really be odd).
harryajhMemberThanks for your reply scott but checked everything & all up to date & correct versions – even tried WL 8.1 (sp1) & WL 8.1 (sp4) and then fresh install on different PC but always the same – ANY change to an action class gives this error!
If anyone’s out there with the same versions as me perhaps they can confirm whether this should work or not? – is it me or just more broken Java stuff?
For now I’ll just have to put this down to a typical “3 steps forward 2 steps back” java thing & redeploy every single time!
harryajhMemberJust noticed also & even more worrying is even with the server launched in “Run Mode” it still throws the error!
Scott AndersonParticipantHarry,
Just noticed also & even more worrying is even with the server launched in “Run Mode” it still throws the error!
Actually, that’s not so troubling. Launching in Run mode only turns of breakpoints, not sycing of classes when modified.
One thing to try would be to create a new, basic Struts project (something very simple) and see if changing an action class in there has the same effect. If different, then it’s a project configuration issue. Also, what JDK are you using? For WebLogic, we recommend running it with the 1.4.2 release that comes with it.
harryajhMemberI start Eclipse with j2sdk1.4.2_08 & Weblogic uses jdk142_04 (although I have tried it with j2sdk1.4.2_08)
This is very odd! – created a new web project with struts etc… & created a new action class (with the same class name as one from my main project so I could pinch the struts-config.xml stuff!). Setup a dummy jsp page & placed a breakpoint in the “execute” method – when the debugger stops it load the original class not my test one!
So started eclipse with -clean option & renamed the test class – this time it stopped 1st time (in the correct class) but when I made a change & clicked my test button guess what? “ClassCastException”
Something else odd, the 1st time I made a change eclipse reported the “hot swap” failed but does not show it again even though I did not check the “ignore” button on the dialog box!
It looks like it just doesn’t work!, unless you can think of anything else to try? its back to “redeploy city” – it I ever find out whats wrong I’ll post back here!
many thanks for you help Scott anyway!
harry
harryajhMemberah ha! – found this thread http://forums.bea.com/bea/message.jspa?messageID=202247822&tstart=0 – added
<container-descriptor>
<servlet-reload-check-secs>-1</servlet-reload-check-secs>
</container-descriptor>to weblogic.xml & works perfectly – probably makes more sense to you but all I care about is it works!
many thanks for your help!
harry
David Orriss JrParticipantHarry,
BEA explains it here (later in the same thread, actually). Basically, there’s a bug in WLS.
http://forums.bea.com/bea/message.jspa?messageID=202429027&tstart=0
David Orriss JrParticipantY’know I’m running into this exact problem. And the workaround works… *except* that now my class changes don’t hot-deploy. Am I missing something???
Riyad KallaMemberDaveO,
You mean ME is not syncing out the class to the server, or WL is no longer reloading the changes?
David Orriss JrParticipantWL is no longer reloading the changes…
[EDIT] Scratch that… maybe I just needed to do a complete undeploy-and-redeploy. It’s working just fine now. Just have to remember to remove that when I make my final package.. 😉
-
AuthorPosts