Alfresco / alfresco-sdk

The Alfresco In-Process SDK is based on Apache Maven, includes support for rapid and standard development, testing, packaging, versioning and release of your Alfresco integration and extension projects
Apache License 2.0
186 stars 113 forks source link

Hotswap not working with spring bean java class #456

Closed kodermax closed 7 years ago

kodermax commented 7 years ago

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request

I have bean

<bean id="policyLogger" class="local.pharm.platform.PolicyLogger" init-method="init">
        <property name="policyComponent">
            <ref bean="policyComponent" />
        </property>
        <property name="nodeService">
            <ref bean="nodeService" />
        </property>
        <property name="versionService">
            <ref bean="VersionService" />
        </property>
    </bean>

Expected Behavior

When I change class local.pharm.platform.PolicyLogger, then I run command mvn compile.

Current Behavior

HotSwap doesn't work

Your Environment

Additional information

gravitonian commented 7 years ago

Hi, I had to put the hotswap-agent.properties file inside the JAR projects src/main/resources directory for the class reloading to work. Might help.

kodermax commented 7 years ago

I have there this file.

autoHotswap=true
#autoHotswap.port=8000
extraClasspath=${project.build.outputDirectory}
#extraClasspath=/real/path/to/project/output/dir/classes
disabledPlugins=Hibernate,Spring
extraWebappContext=${project.build.outputDirectory}/META-INF/resources
webappDir=${project.build.outputDirectory}/META-INF/resources
watchResources=${project.basedir}/src/main/resources
LOGGER.org.hotswap.agent=INFO
kodermax commented 7 years ago

Sorry, It turns out it was necessary to use

platform-hotswap-agent.properties
share-hotswap-agent.properties

And there to register all modules

kodermax commented 7 years ago

Now it's work.