Skip to main content

cli remote deploy

4 replies [Last post]
Joined: 2007-04-02

I try to use mobicents-cli ant tasks to deploy a deployable unit to a remote mobicents server. I have property jnpHost set to here the client side :

Installing DUs
26-giu-2007 14.04.23 org.mobicents.ant.tasks.InstallTask run
AVVERTENZA: Bad result: slee:name=DeploymentMBean.install Error retrieving file from URL=[file:
/D:/workspace.jslee3/sipra/stage/sip-ra-type.jar] to local storage
26-giu-2007 14.04.23 org.mobicents.ant.tasks.InstallTask run
AVVERTENZA: Bad result: slee:name=DeploymentMBean.install Error retrieving file from URL=[file:
/D:/workspace.jslee3/sipra/stage/sip-local-ra.jar] to local storage

Here the server side

12:53:21,069 INFO [DeploymentMBeanImpl] Deploying file:/D:/workspace.jslee3/sipra/stage/sip-local-ra.jar

What happen here is clear, the file is search locally. Mobicents cli should have some mechanism to upload/copy the deployable-unit to jboss deploy directory like management-console do. The difference is that the DeployableUnitsInstallService from management-console is a servlet using commons-fileupload with easy access to jboss context,properties and so on.

Is there any suggestions to solve this problem ?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-07-13

can you elaborate a bit further. Both the management console servlet and the CLI should defer to a deployment MBean. Where does the actual difference in file location occur?

Joined: 2007-04-02

management-console class
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
try {
DiskFileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);

List items = upload.parseRequest(request);
Iterator iter = items.iterator();

while (iter.hasNext()) {
FileItem item = (FileItem);

if (! item.isFormField()) {
String fileName = new File(item.getName()).getName();

File uploadedFile = new File(System.getProperty("jboss.server.temp.dir") + File.separator + fileName);

} catch (Exception e) {

mobicents class
static File retrieveFile(URL url, File localDstDir)
throws NullPointerException, IOException {
if (url == null)
throw new NullPointerException("NULL url");
if (localDstDir == null)
throw new NullPointerException("NULL file");

File destFile = new File(localDstDir, (new File(url.getFile()))
InputStream is = url.openStream();
OutputStream os = new FileOutputStream(destFile);

//copy the file locally
pipeStream(is, os);

return destFile;

The difference is that DeployableUnitsInstallService use ServletFileUpload to process file uploads and copy them to jboss.server.temp.dir while DeploymentManager try to resolve the file url locally (retrieveFile url /D:/workspace.jslee3/sipra/stage/sip-ra-type.jar) so using a remote mobicents provokes an
[i]"Error retrieving file from URL=[/D:/workspace.jslee3/sipra/stage/sip-ra-type.jar] to local storage[/i] because file hasn't been uploaded but lookup in the local file system.

I hope it's enough clean now.


Joined: 2006-01-09

yup, that because "file://" is propably passed or it is default protocol. Thus url class resolves it localy:

DeploymentManager.deployAllUnitsAtLocation(String sourceUrlStr,
String destinationPath, String classpathDirectoryStr,
ComponentContainer componentContainer) throws NullPointerException,
DeploymentException { ...}

and <-- parseURI

Joined: 2007-04-02

For me is clear.Do you have any suggestions of what kind of improvements can be develop to solve this?
Maybe gett DeploymentMBean from client via jmx and set a byte array of the file to upload?