7 Replies Latest reply: Sep 19, 2009 3:36 AM by jaikiran pai RSS

Creating a queue results in an error on the Admin Console in

Robert Robert Newbie

So, whenever I try to add a queue resource in the web gui here's what I see

Caused by: java.io.FileNotFoundException: /var/folders/Cg/CgqAwGkrHI8tQBX90kZhFE TI/-Tmp-/JmsDestinationTemplate3140042646243533386-service.xml

  • 1. Re: Creating a queue results in an error on the Admin Consol
    jaikiran pai Master

    Which exact version of JBoss AS? And please post the entire exception stacktrace (you might find it on the console or the server.log). Which JDK version and which operating system?

    While posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted.

  • 2. Re: Creating a queue results in an error on the Admin Consol
    Robert Robert Newbie

     

    "jaikiran" wrote:
    Which exact version of JBoss AS? And please post the entire exception stacktrace (you might find it on the console or the server.log). Which JDK version and which operating system?

    While posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted.

    Here's the log

    It looks to me as though there is a space or tab where their shouldn't be.

    The directory is actually

    ls -al /var/folders/Cg/CgqAwGkrHI8tQBX90kZhFE+++TI/

    note the +'s aren't being retained.

    2009-09-18 20:32:14,736 ERROR [org.rhq.plugins.jbossas5.ApplicationServerComponent] (ResourceContainer.invoker.nonDaemon-3) Unable to apply template [QueueTemplate] to create ManagedComponent of type ComponentType{type=JMSDestination, subtype=Queue}.
    java.lang.RuntimeException: Failed to process template.
     at org.jboss.profileservice.management.AbstractTemplateCreator.checkComplete(AbstractTemplateCreator.java:197)
     at org.jboss.profileservice.management.AbstractTemplateCreator.distribute(AbstractTemplateCreator.java:164)
     at org.jboss.profileservice.management.AbstractTemplateCreator.applyTemplate(AbstractTemplateCreator.java:102)
     at org.jboss.profileservice.management.ManagementViewImpl.applyTemplate(ManagementViewImpl.java:1361)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
     at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
     at org.jboss.profileservice.remoting.ProfileServiceInvocationHandler.invoke(ProfileServiceInvocationHandler.java:97)
     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
     at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)
     at org.jboss.remoting.Client.invoke(Client.java:1724)
     at org.jboss.remoting.Client.invoke(Client.java:629)
     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
     at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
     at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
     at org.jboss.aop.generatedproxies.AOPProxy$3.applyTemplate(AOPProxy$3.java)
     at org.rhq.plugins.jbossas5.ApplicationServerComponent.createConfigurationBasedResource(ApplicationServerComponent.java:349)
     at org.rhq.plugins.jbossas5.ApplicationServerComponent.createResource(ApplicationServerComponent.java:213)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:482)
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
     at java.lang.Thread.run(Thread.java:637)
    Caused by: java.io.FileNotFoundException: /var/folders/Cg/CgqAwGkrHI8tQBX90kZhFE TI/-Tmp-/JmsDestinationTemplate911349795594686495-service.xml
     at org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnection.java:105)
     at org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:112)
     at org.jboss.virtual.plugins.context.AbstractURLHandler.openStream(AbstractURLHandler.java:203)
     at org.jboss.virtual.VirtualFile.openStream(VirtualFile.java:230)
     at org.jboss.virtual.plugins.vfs.VirtualFileURLConnection.getInputStream(VirtualFileURLConnection.java:93)
     at java.net.URL.openStream(URL.java:1010)
     at org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget.distribute(StreamingDeploymentTarget.java:105)
     at org.jboss.profileservice.management.upload.DeploymentProgressImpl.distribute(DeploymentProgressImpl.java:177)
     at org.jboss.profileservice.management.upload.DeploymentProgressImpl.run(DeploymentProgressImpl.java:82)
     at org.jboss.profileservice.management.AbstractTemplateCreator.distribute(AbstractTemplateCreator.java:161)
     at org.jboss.profileservice.management.AbstractTemplateCreator.applyTemplate(AbstractTemplateCreator.java:102)
     at org.jboss.profileservice.management.ManagementViewImpl.applyTemplate(ManagementViewImpl.java:1361)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
     at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
     at org.jboss.profileservice.remoting.ProfileServiceInvocationHandler.invoke(ProfileServiceInvocationHandler.java:97)
     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
     at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)
     at org.jboss.remoting.Client.invoke(Client.java:1724)
     at org.jboss.remoting.Client.invoke(Client.java:629)
     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
     at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
     at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
     at org.jboss.aop.generatedproxies.AOPProxy$3.applyTemplate(AOPProxy$3.java)
     at org.rhq.plugins.jbossas5.ApplicationServerComponent.createConfigurationBasedResource(ApplicationServerComponent.java:349)
     at org.rhq.plugins.jbossas5.ApplicationServerComponent.createResource(ApplicationServerComponent.java:213)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:482)
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
     at java.lang.Thread.run(Thread.java:637)
     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
     ... 18 more
    


  • 3. Re: Creating a queue results in an error on the Admin Consol
    Robert Robert Newbie

    So it's my guess that this code that assumes you can map a File do a URL without consequence is wrong

    public URL createTempFile(String filename, String data) throws IOException
    {
    log.debug("Passed filename="+filename);
    File file = File.createTempFile(filename,".xml");
    FileWriter fw = new FileWriter(file);
    fw.write(data);
    fw.close();
    file.deleteOnExit();
    URL url = file.toURL();
    log.debug("Temp file created="+url.toExternalForm());
    return url;
    }

  • 4. Re: Creating a queue results in an error on the Admin Consol
    Robert Robert Newbie

    After getting thru that problem by defining -Djava.io.tmpdir=/tmp I now have the following error


    Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /Users/robert/Downloads/jboss-5.1.0.GA/server/default/deploy/queue/TTHOMEFIXQT-service.xml (No such file or directory)


    There is no queue directory in deploy

  • 5. Re: Creating a queue results in an error on the Admin Consol
    jaikiran pai Master

     

    "steffi2" wrote:
    After getting thru that problem by defining -Djava.io.tmpdir=/tmp I now have the following error

    <code>
    Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /Users/robert/Downloads/jboss-5.1.0.GA/server/default/deploy/queue/TTHOMEFIXQT-service.xml (No such file or directory)
    </code>

    There is no queue directory in deploy


    I could reproduce this. It's a bug. Looks like the admin console through the profile service, uses the "JNDIName" of the queue to create a file in the deploy folder. So if the JNDIName is "queue/somequeuename" then it tries to create a file named queue/somequeuename-service.xml in JBOSS_HOME/server/< servername>/deploy folder. Obviously this will lead to errors since "queue" will be considered a folder. Using the JNDI name as the filename is probably not the right thing to do.

    As a workaround, you can provide a JNDI name without any hierarchies. Example, just specify "TTHOMEFIXQT" as the JNDIName instead of "queue/TTHOMEFIXQT"

    As for the first error, you haven't told us which operating system it is. But going by the path names, i guess you are using Mac OS?


  • 6. Re: Creating a queue results in an error on the Admin Consol
    jaikiran pai Master

     

    "jaikiran" wrote:

    I could reproduce this. It's a bug.



    I couldn't find any existing JIRA for this. So created one https://jira.jboss.org/jira/browse/EMBJOPR-252

  • 7. Re: Creating a queue results in an error on the Admin Consol
    jaikiran pai Master

     

    "steffi2" wrote:

    The directory is actually

    ls -al /var/folders/Cg/CgqAwGkrHI8tQBX90kZhFE+++TI/

    note the +'s aren't being retained.



    This one too is a (separate) bug. The URL is not being encoded. However i am not sure whether this should be handled centrally in VFS or should it be handled by profile service. Please create a JIRA for this in https://jira.jboss.org/jira/browse/JBAS. It can then be moved appropriately if needed.