Giter Club home page Giter Club logo

Comments (11)

skybber avatar skybber commented on July 22, 2024

What happens if you modify JSP file or cleanup the work directory (directory with translated JSPs)?

from hotswapagent.

negora avatar negora commented on July 22, 2024

The .java and .class files are re-created, but the error persists.

from hotswapagent.

negora avatar negora commented on July 22, 2024

Oh my bad. Do you want the full stack trace of the exception?

from hotswapagent.

skybber avatar skybber commented on July 22, 2024

yes!

from hotswapagent.

negora avatar negora commented on July 22, 2024

I'm very sorry for the delay, but I've been really busy. Here it's the stack trace: http://negora.com/bugs/hotswap-agent/50/myweb.output . I've tried to upload it here, but it seems that it only accepts images. Weird.

By the way, if you want I can upload the project of NetBeans IDE. Although as I mentioned before, it's just a JSP and a class that instantiates itself (in order to force the use of two different class loaders in both "sides").

from hotswapagent.

edudant avatar edudant commented on July 22, 2024

Please upload the netbeans project, I will test it.

from hotswapagent.

negora avatar negora commented on July 22, 2024

Here it's the project: http://negora.com/bugs/hotswap-agent/50/myweb.zip . Thank you!

from hotswapagent.

edudant avatar edudant commented on July 22, 2024

Can you elaborate on your project setup? I had some issues to run the project with netbeans:

  • -XXaltjvm=dcevm was ignored, because Netbeans by default add another JAVA_OPTS option -server whitch override -XXaltjvm
  • netbeans feature "deploy on save" is on by default - if you leave this on, after each change the application is compleatly redeployed and hotswap agent is not needed at all. I have tested the application with "Deploy on save" and it worked correctly.

In debug mode wihtout "Deploy on save" I have used "Apply changes" after class modification and it worked as well. Change of JSP file was not triggered (it needs hotswap-agent.propertieswebappDir to set, but it is not supported for Wildfly yet).

from hotswapagent.

negora avatar negora commented on July 22, 2024

Hello Edudant:

I'm sorry, but I did several mistakes in my previous message:

  • I should have disabled the option "Compile on save" in the NetBeans IDE project. It has often given me several problems. In my opinion it's better to submit the changes manually to reproduce this type of problem.
  • I forgot to mention that I run the Wildfly instance apart from NetBeans IDE, running it in the command line and deploying the exploded WAR file by hand.

The last point is what makes a difference. I've discovered that NeBeans IDE (its Wildfly plug-in really) adds a line to the Wildfly execution in debug mode: -Djboss.modules.system.pkgs=org.jboss.byteman . I've just read that Byteman is a Java agent that allows complex hot-modifications to the bytecode ( http://byteman.jboss.org/ ). I guess that the Wildfly plug-in uses it to give the users the extra function of doing hot-changes that aren't allowed by the default JVM (such as adding a non-static method, for example), without requiring other external agents like HotSwap Agent.

I've run Wildfly from NetBeans IDE with and WITHOUT HotSwap Agent, and the result has been the same: I've been able to submit "forbidden" hot-changes to my classes. So I guess that Byteman overrides HotSwap Agent in some way.

So, to test Wildfly with HotSwap Agent, you need to run Wildfly apart, from the command line. In Linux:

export JAVA_OPTS='-server -Xms128m -Xmx512m'
export JAVA_OPTS="$JAVA_OPTS -Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787"
export JAVA_OPTS="$JAVA_OPTS -XXaltjvm=dcevm -javaagent:$HOTSWAP_AGENT/hotswap-agent.jar"

"$WILDFLY_HOME"/bin/standalone.sh

Once you've started the server, create a link to the building directory of your project in the deployments directory of Wildfly, and deploy the project:

cd "$WILDFLY_HOME/standalone/deployments/"
ln -s "$NETBEANS_PROJECTS/myweb/build/web" myweb.war
touch myweb.war.dodeploy

Run http://localhost:8080/myweb from your Web browser. Everything will be OK. Now, from NetBeans IDE, click on the menu "Debug → Attach debugger..." and connect to the port 8787, where the JVM that runs Wildfly is listening. Alter the class myweb.Test, adding a line into the constructor:

private Test () {
System.out.println ("Constructing Test ().");
}

Apply the changes choosing "Debug > Apply code changes". Reload the page in the Web browser and the exception will pop up.

from hotswapagent.

negora avatar negora commented on July 22, 2024

I just wanted to clarify that I may be mistaken about Byteman. Because sometimes it accepts "forbidden" changes whereas others it doesn't (in the same class, in the same line :S ) . I don't know the reason.

Anyway, that doesn't matters with regard to HotSwap Agent: If you run Wildfly from NetBeans IDE, it's ignored anyway. If you run Wildfly apart, it fails with the linkage error commented before. I'm interested in this last point. Thank you!

from hotswapagent.

edudant avatar edudant commented on July 22, 2024

Please reopen if still valid.

from hotswapagent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.