Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Correct way to deploy configuration artifacts from tooling
Correct way to deploy configuration artifacts from tooling [message #722583] Tue, 06 September 2011 09:10 Go to next message
Alexey Romanov is currently offline Alexey RomanovFriend
Messages: 263
Registered: May 2010
Senior Member
Is it possible to deploy configuration artifacts to servers from tooling? If yes, how?
Re: Correct way to deploy configuration artifacts from tooling [message #722653 is a reply to message #722583] Tue, 06 September 2011 12:37 Go to previous messageGo to next message
Chris Frost is currently offline Chris FrostFriend
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

Hi,

I'm afraid not, we would like to in the future but it is not support right now.

Chris.


------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Re: Correct way to deploy configuration artifacts from tooling [message #723426 is a reply to message #722583] Thu, 08 September 2011 14:22 Go to previous messageGo to next message
Jack Lynch is currently offline Jack LynchFriend
Messages: 9
Registered: August 2011
Junior Member
Just mentioning this in case you're not aware of it; there is a Deployer interface accessible via JMX. For example, the code below allows you to deploy for example a WAR file, without needing access to the ApplicationDeployer interface.


	private void deployViaJMX(File file) {
		final String objectNameStr = "org.eclipse.virgo.kernel:category=Control,type=Deployer";
		final String operationName = "deploy";
		final String pathToFile = "file://" + file.getAbsolutePath();

		try {
			final ObjectName objectName = new ObjectName(objectNameStr);
			final boolean recoverOnStartup = false;  // would need to guarantee the File would exist on restart..
			Object result = mbeanConnection.invoke(objectName,
					operationName, 
					new Object[] { pathToFile, recoverOnStartup },
					new String[] { String.class.getName(), boolean.class.getName() } );
			
			// (CompositeData)result; // gives symbolicName, type, version of app deployed
		} catch (InstanceNotFoundException noMBeanInstanceFound) {
			System.err.println("ERROR: Could not find MBean with name "
					+ objectNameStr + " in MBeanServer:\n"
					+ noMBeanInstanceFound.getMessage());
		} catch (MBeanException mbeanEx) {
			System.err.println("ERROR: Exception encountered on invoked MBean:\n" + mbeanEx.getMessage());
		} catch (ReflectionException reflectionEx) {
			System.err.println("ERROR trying to reflectively invoke remote MBean:\n" + reflectionEx.getMessage());
		} catch (Exception ex)  {
			System.err.println("ERROR trying to communicate with remote MBeanServer:\n" + ex.getMessage());
		}
		
	}

[Updated on: Thu, 08 September 2011 14:25]

Report message to a moderator

Re: Correct way to deploy configuration artifacts from tooling [message #725181 is a reply to message #723426] Wed, 14 September 2011 07:23 Go to previous message
Alexey Romanov is currently offline Alexey RomanovFriend
Messages: 263
Registered: May 2010
Senior Member
I've filed an enhancement request: https://bugs.eclipse.org/bugs/show_bug.cgi?id=357595
Previous Topic:VTS 3.0 can't resolve constraint satisfied by a package in /repository/usr
Next Topic:ClassNotFoundException for an exported class
Goto Forum:
  


Current Time: Fri Nov 28 18:24:54 GMT 2014

Powered by FUDForum. Page generated in 0.11750 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software