[jbosstools-issues] [JBoss JIRA] (JBIDE-19821) Hot code swap not happening for Web App Libraries before being loaded

Rob Stryker (JIRA) issues at jboss.org
Mon Aug 24 13:39:27 EDT 2015


    [ https://issues.jboss.org/browse/JBIDE-19821?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101158#comment-13101158 ] 

Rob Stryker commented on JBIDE-19821:
-------------------------------------

I'm sorry to say, but I'm not seeing what you're seeing at all.   I've copied your soap request and have performed the following:

1) Create a new wf8.2 server
2) Import your projects
3) Fix the small errors (java facet set to 1.7 but compiler compliance set to 1.8)
4) Modify server launch args to include -verbose:class as vm args
5) Deploy the webapp 
6) Change HelloWorld.java to return "hello prepend: " + result;
7) Change WebAppClass.doSomething() return value to something new (WebApp-doSomething-from-rob)
8) Change ModuleClass.doSomething() return value to (moduleClass doSomething-from-rob)
9) Run soap request for value 'a',   see  "hello prepend: WebApp-doSomething-from-rob"
10) Run soap request for value 'b',   see  "hello prepend: moduleClass-doSomething-from-rob"
11) Change HelloWorld to return "helloChanged: " + result
12) Change WebAppClass.doSomething() return value to something new "doSomething-a"
13) Change ModuleClass.doSomething() return value to something new "doSomething-b"
14) Run soap request for value 'a',   see  "helloChanged: doSomething-a"
15) Run soap request for value 'b',   see  "helloChanged: doSomething-b"



To further test, I performed the following:
  1) Set breakpoint in HellloWorld.sayHello
  2) run server in Debug mode with proper verbose flags
  3) Launch soap command
  4) Breakpoint hit at top of sayHello()
  5) Clear my console to isolate any new actions
  6) Change WebAppClass.java to modify the return value
  7) Note the following console output
{code}
[Loaded org.xnio.FileChangeEvent$Type from jar:file:/home/rob/apps/jboss/unzipped/wildfly-8.2.0.Final.zip.expanded/modules/system/layers/base/org/jboss/xnio/main/xnio-api-3.3.0.Final.jar!/]
[Loaded org.xnio.FileChangeEvent from jar:file:/home/rob/apps/jboss/unzipped/wildfly-8.2.0.Final.zip.expanded/modules/system/layers/base/org/jboss/xnio/main/xnio-api-3.3.0.Final.jar!/]
{code}
  8) Step forward to constructor of WebAppClass, see following output
{code}
[Loaded org.jboss.samples.webservices.WebAppClass from vfs:/home/rob/apps/jboss/unzipped/wildfly-8.2.0.Final.zip.expanded/standalone/deployments/TestIde.war/WEB-INF/classes]
{code}
  9) Continue stepping, verify return value contains changed value

[~mmalina] Are you able to replicate this?  I'm pushing this to maintenance for now based on the fact that I'm unable to replicate after 2 hours of effort. 

> Hot code swap not happening for Web App Libraries before being loaded
> ---------------------------------------------------------------------
>
>                 Key: JBIDE-19821
>                 URL: https://issues.jboss.org/browse/JBIDE-19821
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 4.2.3.Final
>         Environment: Windows 7, 64 bits, Eclipse Luna (4.4.2), JBoss Tools 4.2 Plug-ins installed: JBoss WebServices Tools (1.7.3.Final), JBossAS Tools (3.0.3.Final), Jboss JAX-RS Tools (1.7.3.Final)
>            Reporter: Stephane Sandron
>             Fix For: 4.3.x
>
>         Attachments: classloading_issue.zip
>
>
> I have created 2 projects in Eclipse:
> * TestIde: a web application with 2 classes
> ** HelloWorld: a web service endpoint with a single web service method
> ** WebAppClass: a simple Java class with a single method returning a string
> * TestIdeModule: a regular java module (with the "Utility Module" facet defined in Eclipse for the project) with a single class
> ** ModuleClass: similar to WebAppClass
>  
> TestIde has
> * TestIdeModule in its build path
> * TestIdeModule deployed in WEB-INF/lib/TestIdeModule.jar
>  
> The code of the web service method takes a string and depending on this it will instantiate WebAppClass or ModuleClass.
> I am running WildFly 8.1 (in debug mode) with -verbose:class to see the classes being loaded/redefined.
>  
> My issue is the following:
> - Starting WildFly in debug mode
> - Modifying the string returned by ModuleClass in my IDE (before it is loaded)
> - The resulting string is still the previous one (before my modification in my IDE)
> If I do the same test with the WebAppClass, everything is OK because it is deployed as a .class in WEB-INF/classes
> The change does not take effect right away over the debug wire when:
> - The modified class is part of a Java project deployed as a JAR in WEB-INF/lib
> - The modified class has not yet been loaded
>  
> When the class is loaded before being modified, everything is fine.
> When I check "Force module restart on following regex pattern" and using the pattern: "\.jar$", I see WildFly republishing a JAR with the modified file inside. The problem is still occurring though. It seems that it does not take into account the modification if the class has never been loaded.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jbosstools-issues mailing list