by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    mkamalov
    @mkamalov
    @alain57 When you says both are identical, how do you check it?
    Alain Tavan
    @alain57
    well there was no difference in the name of the class and package within the error.
    Next time I have one, i'll try to do a screenshot and store the stacktrace
    mkamalov
    @mkamalov
    No difference in the name doesn't garantee than both classes are the same. For example the same class that has been loaded by two different classloaders. You see the same name for the class but system throws ClassCastException.
    Please, check that both classes belong to the same Classloader. It could be your application issue.
    Alain Tavan
    @alain57
    sorry for the dumb question, but how can i check that the classloader is different ? I mean this happens after a hotswap and the classloader is defined in the IDE. I did not changed something there . I just modified a file and noticed this error a few time. Like said I'll see if I can reproduce this and try to give as much details as possible :)
    mkamalov
    @mkamalov
    Do you use debug mode?
    For example: MyClass s = new MyClass(); System.out.println(s.getClass().getClassLoader().toString());
    Output: sun.misc.Launcher$AppClassLoader@73d16e93. Check the number in the end of string.
    Vladimir Dvorak
    @skybber
    @mkalov: as far as classloaders and class cast you're absolutely right. As far as enum values, it could return null only for not enum classes according doc. But if there is prblem, we could add null check with error log. Would you like create PR?
    mkamalov
    @mkamalov
    @skybber I'm trying to undestand a problem. I can't reproduce an issue in clean small projects. I suspect switch block + enum class with non default constructor.
    Vladimir Dvorak
    @skybber
    As I see the name "reinitializeStatics" is confusing, should be initializeStatics
    mkamalov
    @mkamalov
    I looks like: first time i have an error message with Enums in logs with init method and then I get NPE and Hotswap fails. But i'm not sure.
    Vladimir Dvorak
    @skybber
    Is it only in case of inner enum class?
    mkamalov
    @mkamalov
    also I have strange line in console like MyEnum(MyEnum.java:1)
    No all enums
    I don't undestand why it reffers to first line in code
    mkamalov
    @mkamalov
    @skybber Do you have some guideline how to debug hotswapagent?
    Vladimir Dvorak
    @skybber
    debug you example project + add breakpoints to ha plugins sources. It should work
    You should import HA core+plugin(s) to eclipse workspace
    even you can modify HA classes on the fly
    mkamalov
    @mkamalov
    Ok Thanks
    Sorry, I don't work with java agents I thought it is something special :)
    Vladimir Dvorak
    @skybber
    have you java11?
    mkamalov
    @mkamalov
    No 8
    Vladimir Dvorak
    @skybber
    ok
    ha should be compiled with j11, probably you will have problem to build it on j8
    but n problem with debug on j8
    mkamalov
    @mkamalov
    Ok thanks I'm going to set breakpoint on failed lines in HA and if find something interesting will write here.
    Vladimir Dvorak
    @skybber
    I'm not sure if the breakpoints will work for you since this method is called from instrumentation, I had problem with it in eclipse, it didn't stop there. But no problem in executeCommand() callbackack, that is called in separated thread. If you have Idea then it will work.
    mkamalov
    @mkamalov
    Hi Vladimir
    I can't build Git HA repo
    should I use some special command to build?
    I used mvn clean install
    mkamalov
    @mkamalov
    Vladimit HA uses methods introduced in Java 9. How you compile HA on Java 8?
    mkamalov
    @mkamalov
    I've got it I have to compile it with java 11 and HA code checks Java version and uses different methods in implementation
    Vladimir Dvorak
    @skybber
    yep, j8 uses different way
    mkamalov
    @mkamalov
    I think my problem in 150ms hack
    Class<?> clazz = classLoader.loadClass(className);
    Method m = clazz.getDeclaredMethod(HOTSWAP_AGENT_CLINIT_METHOD, new Class[] {}); My log says that no method found in class.
    It it not clean where the code that updates this class in the classloader between ctClass.addConstructor(haClinit) line and Class<?> clazz = classLoader.loadClass(className);
    mkamalov
    @mkamalov
    Please, could you explain?
    Vladimir Dvorak
    @skybber
    method public static void patch(final CtClass ctClass is called from HotswapTransformer.transform, it adds $$ha$clinit method to class. Then the class is reloaded by dcevm, so the actual class reinitialization must be called in callback using scheduler.scheduleCommand. Class is now redefined after 150ms since the class can have be proxied by dynamic proxies (com.sun.proxy, etc...).
    davidezucc
    @davidezucc
    Rajkumar
    @rajsennimalai
    How to use hotswapper plugin withouy using IDE. I'm starting wildfly server with hotswapagent and altjvm options. I have a exploded war file with hotswap-agent.properties file with watchresources and extraclasspath pointing to the class folder. Whenever the classes files are getting changes ,the changes are not hotreloaded. Am i missing any configurations?
    Vladimir Dvorak
    @skybber
    @rajkumar: loot at autoHostawaphttp://hotswapagent.org/mydoc_configuration.html
    Rajkumar
    @rajsennimalai
    HI Vlaadimir,
    I have checked the documentation..But still classes are not getting reloaded. Look at https://stackoverflow.com/questions/55687372/hotswapper-plugin-is-not-reloading-classes-in-web-project for description
    Vladimir Dvorak
    @skybber
    even with autoHostawap=true in hotswap-agent.properties?
    Rajkumar
    @rajsennimalai
    Yes Vladimir
    Vladimir Dvorak
    @skybber
    and extraClasspath=your_build_path ?