Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] jetty-maven-plugin hot deploy questions

Bryan,

For an object to escape the lifecycle of the webapp, it would have to be either a)  from the container's classpath (and thus tied to the lifecycle of the whole server)  or b) persisted or otherwise supplied by some external service not tied to the lifecycle of the webapp.

cheers
Jan

On 31 July 2015 at 11:10, Bryan Fok <bryanevil@xxxxxxxxxxx> wrote:
HI Jan


Thanks for your reply. I was trying to keep the StatefulResource instance (it has a AutoInteger counter) alive during the redeployment.
Is the hot deployment behavior difference between the jetty-maven-plugin, and normal jetty(embedded or tranditional deployment)?
Is my goal achievable?

B.R
Bryan


Date: Fri, 31 Jul 2015 10:13:45 +1000
From: janb@xxxxxxxxxxx
To: jetty-users@xxxxxxxxxxx
Subject: Re: [jetty-users] jetty-maven-plugin hot deploy questions


Bryan,

When you're running jetty:run  with a non-zero scan time, then when any of the monitored files is changed (eg a class or web.xml etc), the webapp is stopped, configuration re-applied and then then restarted.

Can you describe exactly what is happening that you feel is a problem, providing log traces, exception etc to demonstrate the issue?

regards
Jan

On 30 July 2015 at 23:48, bryan <bryanevil@xxxxxxxxxxx> wrote:

Hi Jetty users and experts

 

I thought that jetty only redeploy the class that got update but it isn't the case. See the below class:

 

@Component

@Path("/")

public class Example1Service {

 

    private final StatefulResource resource;    //referencing to a spring autowired class with an AtomicInteger counter

    private final static Logger logger = LoggerFactory

            .getLogger(Example1Service.class);

 

    @Autowired

    public Example1Service(StatefulResource resource) {

        logger.debug("Example1Service constructed\n");

        this.resource = resource;

    }

 

    @GET

    @Path("counter")

    @Produces(MediaType.TEXT_PLAIN)

    public String getCounter() {

        return "Example1Service(3)" + resource.getCounter(); //change this to Example1Service(1)

    }

}

 

The Example1Service REST class reference to a class auto-wired by Spring autowired. I expecting when i updated the service class, jetty will redeploy this service and auto-wired the same instance again because spring DI by default has a singleton initialization setting, isn't it?

 

Cheers

Bryan

 


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


_______________________________________________ jetty-users mailing list jetty-users@xxxxxxxxxxx To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/jetty-users

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top