Deployment with the Jetty plugin in 10.5

Hello,

i'm currently trying to configure Jetty 7.4.1 to run the web application i'm developing in IntelliJ 10.5.

To do so, i downloaded Jetty from eclipse, and created a run configuration using the new Jetty plugin.

I then activated

  • jetty.xml
  • jetty-deploy.xml
  • jetty-contexts.xml
  • jetty-jmx.xml

and configured the exploded artifact to be deployed at root. I also deleted the test webapp and its context xml file.

Now when i start the server the first time, a context xml file gets created and the application starts up fine, although the plugin is shown as "being deployed" in the deployment panel.

When i start the application at a later point, the application gets deployed, then stopped, then deployed again. The deployment panel still says being deployed, when the application is up and running.

Is this misconfiguration or does it sound like a bug?


Thanks, David

12 comments
Comment actions Permalink

Hello,

Jetty 7.4.1 have introduced a change into the JMX protocol, and IDEA 10.5 hasn't the support for it yet.
So IDEA 10.5 is unable to queue actual artifact status from the server and shows it as being deployed.

I will submit YouTrack shortly and post the number to track here, but fix for this issue is ready and to be included into the 10.5.1+

Regarding deploy-undeploy-deploy behavior - it's rather expected:
since you haven't undeployed the artifact on the previous run of the server, it's context file is kept in the server and the artifact is deployed on server startup;
than, artifact is redeployed (undeployed-deployed) by the IDEA when connection with the server established.

Regards,
Michael

0
Comment actions Permalink

Hello,

I've submitted http://youtrack.jetbrains.net/issue/IDEA-69975 for trackinh the status of this issue.

Regards,
Michael

0
Comment actions Permalink

Regarding deploy-undeploy-deploy behavior - it's rather expected:
since you haven't undeployed the artifact on the previous run of the server, it's context file is kept in the server and the artifact is deployed on server startup;
than, artifact is redeployed (undeployed-deployed) by the IDEA when connection with the server established.



This behavior is very undesirable. Intellij should not be putting anything in my JETTY_HOME directory. I work on several web apps at a time and since upgrading to 10.5 I've had to clean out the context in my jetty install every time I switch between projects. Am I supposed to keep an install of Jetty per project now?


Josh
0
Comment actions Permalink

Hello,

Well, putting smth to the JETTY_HOME is the only way to deploy an artifact to Jetty.

Actually, there are 2 ways available to Intellij according to http://wiki.eclipse.org/Jetty/Howto/Deploy_Web_Applications:("Deploying Webapps" and "Deploying Contexts" sections).
But both of them require to put smth under JETTY_HOME.

I had a hope there is an undocumented way to deploy to Jetty with JMX, but can't see any.
So, there were no change in the way Intellij deploys in the 10.5 - Intellij deploys using "contexts" since the Jetty integration plugin
was introduced.

Anyway, you are able to clean the contexts folder by undeploying all the artifacts before stopping the Jetty instance.
Probably, you'd like to see a checkbox in the Jetty runtime configuration like "undeploy all before shutdown". If so, please submit a youtrack on that.

Regards,
Michael

0
Comment actions Permalink

I've just submitted http://youtrack.jetbrains.net/issue/IDEA-70197, please vote there.

Regards,
Michael

0
Comment actions Permalink
So, there were no change in the way Intellij deploys in the 10.5 - Intellij deploys using "contexts" since the Jetty integration plugin was introduced.


Did you look into idea-jetty integration plugin hosted at github?
https://github.com/codebrewer/intellij-idea-jetty-integration-plugin

0
Comment actions Permalink

Well, putting smth to the JETTY_HOME is the only way to deploy an artifact to Jetty.

This is a fallacy. When you start jetty locally you don't need to "deploy" anything. Jetty is an embeddable app server, the fact that you start it from an installation directory and then "deploy" the app is an implementation detail at best.

I had a hope there is an undocumented way to deploy to Jetty with JMX, but can't see any.
So, there were no change in the way Intellij deploys in the 10.5 - Intellij deploys using "contexts" since the Jetty integration plugin
was introduced.

The 3rd party plugin didn't modify the jetty folder so it's definitely possible.

Anyway, you are able to clean the contexts folder by undeploying all the artifacts before stopping the Jetty instance.
Probably, you'd like to see a checkbox in the Jetty runtime configuration like "undeploy all before shutdown". If so, please submit a youtrack on that.


I'm not in favor of the deploy/undeploy stuff that's in the new plugin. A checkbox is better than what's there now but requiring jmx support is not ideal. I've updated the youtrack with my preferences.

Josh

0
Comment actions Permalink

BTW, when you run jetty in debug your webapps are always deployed automatically. In run (not debug) mode you have to press 'Deploy' button.

0
Comment actions Permalink

Hello,

I have implemented the ability to use temporary contexts folder for each run session, so no files are put under server home and deployments aren't inherited between sessions.
There is dedicated checkbox in local run configuration to use those temp folders.

However, all this new code is most probably for Idea XI, not sure we are in time to add this into 10.5.

Regards,
Michael

0
Comment actions Permalink

Ok,

After more consideration we decided to ALWAYS use the temporary folder to deploy context files to. So artifacts deployed from IDEA will NEVER be kept between Jetty startups.
Even more, we have decide to backport this fix (actually committed to master) into the 10.5.x stream.

Thanks for a catch,
Regards,
Michael

0
Comment actions Permalink

Awesome! Thanks!

0

Please sign in to leave a comment.