JSON descriptor provided, XML descriptor expected

109 views
Skip to first unread message

Alexander Küken

unread,
Apr 22, 2014, 8:27:46 AM4/22/14
to atlassian-...@googlegroups.com
Hello everyone,

I have some problems deploying a connect plugin in a local confluence instance for developing and testing. As stated in the Connect 1.0.1 release note, I start confluence with the following command:

atlas-run-standalone --product confluence --version 5.4-OD-20-007 --bundled-plugins com.atlassian.plugins:atlassian-connect-plugin:1.0.1,com.atlassian.jwt:jwt-plugin:1.0.0,com.atlassian.bundles:json-schema-validator-atlassian-bundle:1.0-m0 --jvmargs -Datlassian.upm.on.demand=true

After Confluence started normally, I activated private listing in the UPM configuration. If I enter the path to the JSON descriptor in the "Upload Add-On" dialog, the installation results in an error. According to the confluence log, there is a XML parsing exception. Looks like confluence is not recognizing I try to use a JSON descriptor and still expects the XML descriptor.

I am using the actual version of the SDK, it's a fresh development machine and a new plugin project. So there should be nothing left from previouse versions.

Any ideas?

With best regards,

Alexander

Tim Pettersen

unread,
Apr 22, 2014, 1:33:42 PM4/22/14
to atlassian-...@googlegroups.com
Hi Alexander,

I'm having a little trouble reproducing your issue. Would you mind sending through the Confluence logs with the XML parsing exception?

Also, could you clarify:

enter the path to the JSON descriptor in the "Upload Add-On" dialog

What is the path that you are entering? (i.e. is it a file system path, URL to a descriptor hosted on marketplace (via the private listings feature) or a URL to a descriptor hosted elsewhere? 

cheers,
Tim


--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Tim Pettersen
C: 415 503 8377

$10 Starter licenses... w00t! | http://www.atlassian.com

Alexander Küken

unread,
Apr 22, 2014, 5:39:13 PM4/22/14
to atlassian-...@googlegroups.com
Hi Tim,

thank you for your answer. The path I enter is the URL to the descriptor hosted on a local Rails instance. If I open the URL in the browser (http://127.0.0.1:3000/atlassian-connect.json) i receive the descriptor as expected:

{
     
"name": "Hello World",
     
"description": "Hello World Test Plugin",
     
"key": "net.kueken.connect.hello_world",
     
"baseUrl": "http://localhost:3000",
     
"vendor": {
         
"name": "Alexander Küken",
         
"url": "http://www.kueken.net"
     
},
     
"authentication": {
         
"type": "none"
     
},
     
"version": "1.0",
     
"modules": {
         
"generalPages": [
             
{
                 
"url": "/helloworld.html",
                 
"key": "hello-world",
                 
"name": {
                     
"value": "Greeting"
                 
}
             
}
         
]
     
}
 
}

Here are screenshots of the upload dialog and the error message



And the log entries:

2014-04-22 23:33:00,890 WARN [UpmAsynchronousTaskManager:thread-3] [connect.plugin.installer.DefaultConnectAddOnInstaller] installPlugin Unable to install remote plugin 'net.kueken.connect.hello_world' by user 'admin'
 -- referer: http://127.0.0.1:1990/confluence/plugins/servlet/upm | url: /confluence/rest/plugins/1.0/ | userName: admin
2014-04-22 23:33:00,891 ERROR [UpmAsynchronousTaskManager:thread-3] [connect.plugin.installer.ConnectUPMInstallHandler] installPlugin Failed to install plugin.8137752420954285752.atlassian-connect.json: com.atlassian.plugin.PluginParseException: Cannot parse XML plugin descriptor
 -- referer: http://127.0.0.1:1990/confluence/plugins/servlet/upm | url: /confluence/rest/plugins/1.0/ | userName: admin
com.atlassian.plugin.connect.spi.InstallationFailedException: com.atlassian.plugin.PluginParseException: Cannot parse XML plugin descriptor
at com.atlassian.plugin.connect.plugin.installer.DefaultConnectAddOnInstaller.install(DefaultConnectAddOnInstaller.java:170)
at com.atlassian.plugin.connect.plugin.installer.ConnectUPMInstallHandler.installPlugin(ConnectUPMInstallHandler.java:123)
at com.atlassian.upm.core.install.DefaultPluginInstallationService.execute(DefaultPluginInstallationService.java:108)
at com.atlassian.upm.core.install.DefaultPluginInstallationService.install(DefaultPluginInstallationService.java:84)
at com.atlassian.upm.install.UpmPluginInstallationService.install(UpmPluginInstallationService.java:93)
at com.atlassian.upm.core.rest.resources.install.InstallTask.installFromFile(InstallTask.java:119)
at com.atlassian.upm.core.rest.resources.install.InstallRemotePluginTask.executeTask(InstallRemotePluginTask.java:59)
at com.atlassian.upm.core.rest.resources.install.InstallTask.call(InstallTask.java:55)
at com.atlassian.upm.core.rest.resources.install.InstallTask.call(InstallTask.java:30)
at com.atlassian.upm.core.rest.async.AsynchronousTaskManager$1.call(AsynchronousTaskManager.java:77)
at com.atlassian.upm.core.rest.async.AsynchronousTaskManager$1.call(AsynchronousTaskManager.java:72)
at com.atlassian.sal.core.executor.ThreadLocalDelegateCallable.call(ThreadLocalDelegateCallable.java:42)
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:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
Caused by: com.atlassian.plugin.PluginParseException: Cannot parse XML plugin descriptor
at com.atlassian.plugin.parsers.XmlDescriptorParser.createDocument(XmlDescriptorParser.java:85)
at com.atlassian.plugin.parsers.XmlDescriptorParser.<init>(XmlDescriptorParser.java:72)
at com.atlassian.plugin.parsers.XmlDescriptorParserFactory.getInstance(XmlDescriptorParserFactory.java:28)
at com.atlassian.plugin.factories.AbstractPluginFactory.getPluginKeyFromDescriptor(AbstractPluginFactory.java:82)
at com.atlassian.plugin.factories.AbstractPluginFactory.canCreate(AbstractPluginFactory.java:47)
at com.atlassian.plugin.loaders.ScanningPluginLoader.canLoad(ScanningPluginLoader.java:310)
at com.atlassian.plugin.loaders.ForwardingPluginLoader.canLoad(ForwardingPluginLoader.java:74)
at com.atlassian.plugin.manager.DefaultPluginManager.validatePlugin(DefaultPluginManager.java:481)
at com.atlassian.plugin.manager.DefaultPluginManager.installPlugins(DefaultPluginManager.java:447)
at com.atlassian.confluence.plugin.EventDispatchingPluginController.installPlugins(EventDispatchingPluginController.java:89)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy51.installPlugins(Unknown Source)
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 com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129)
at com.sun.proxy.$Proxy297.installPlugins(Unknown Source)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy2159.installPlugins(Unknown Source)
at com.atlassian.plugin.connect.plugin.installer.DefaultConnectAddOnInstaller.installPlugin(DefaultConnectAddOnInstaller.java:214)
at com.atlassian.plugin.connect.plugin.installer.DefaultConnectAddOnInstaller.install(DefaultConnectAddOnInstaller.java:117)
... 16 more
Caused by: org.dom4j.DocumentException: Error on line 2 of document  : Invalid byte 1 of 1-byte UTF-8 sequence. Nested exception: Invalid byte 1 of 1-byte UTF-8 sequence.
at org.dom4j.io.SAXReader.read(SAXReader.java:355)
at org.dom4j.io.SAXReader.read(SAXReader.java:261)
at com.atlassian.plugin.parsers.XmlDescriptorParser.createDocument(XmlDescriptorParser.java:81)
... 65 more

Cheers,
Alexander
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connect-dev+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Tim Pettersen

unread,
Apr 22, 2014, 6:31:09 PM4/22/14
to atlassian-...@googlegroups.com
Hi Alexander,

Thanks for the quick response! I'm still investigating, but I have a hunch this may be an encoding bug. Could you try replacing the umlaut diacritic ü with an unaccented u and seeing if you can reproduce the issue? I'll continue trying to reproduce on my end.

cheers,
Tim


To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Seb Ruiz

unread,
Apr 22, 2014, 8:30:58 PM4/22/14
to atlassian-...@googlegroups.com
Hi Alexander,

Could you also please tell us which version of the Universal Plugin Manager is installed? It should be located at the bottom of the manage plugins screen.

Thanks


To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Seb Ruiz
Atlassian

Alexander Küken

unread,
Apr 23, 2014, 3:19:10 AM4/23/14
to atlassian-...@googlegroups.com
Hi Tim, Hi Seb,

Problem solved, it really was the umlaut. I removed it and now it is working as expected. UPM version is 2.15.0

Thank you for your help.

Cheers,
Alexander

Tim Pettersen

unread,
Apr 23, 2014, 12:33:08 PM4/23/14
to atlassian-...@googlegroups.com
Hi again Alexander,

Great to hear you're back up and running! That said, I'd like to ensure Connect is resilient to unexpected encodings and I couldn't reproduce this locally (despite trying a whole range of popular encodings). Would you mind sending me the entire raw response, including headers, that your rails app returns for atlassian-connect.json (with the umlaut), so I can debug further? 

Using cURL, you could do the following:


And send me both the console output and the generated response.txt. I'm also curious as to what operating system you're running on?

cheers,
Tim


--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexander Küken

unread,
Apr 23, 2014, 2:53:04 PM4/23/14
to atlassian-...@googlegroups.com
Hi Tim,

the machine is running with Mac OS X 10.9.2. The template for the plugin descriptor uses UTF-8 as encoding and Rails deliver it with the same encoding. Here the console output of the curl command:

* About to connect() to 127.0.0.1 port 3000 (#0)
*   Trying 127.0.0.1...
* Adding handle: conn: 0x7fc6cc821000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fc6cc821000) send_pipe: 1, recv_pipe: 0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 127.0.0.1 (127.0.0.1) port 3000 (#0)
> GET /atlassian-connect.json HTTP/1.1
> User-Agent: curl/7.30.0
> Accept: */*
< HTTP/1.1 200 OK 
< X-Frame-Options: SAMEORIGIN
< X-Xss-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< Content-Type: application/json; charset=utf-8
< Etag: "c297e6bf6433cf82a6b68e56a5dc499c"
< Cache-Control: max-age=0, private, must-revalidate
< X-Request-Id: 0fbdb94f-ec4d-4e54-b8cb-46ddbb6760cb
< X-Runtime: 0.005554
* Server WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24) is not blacklisted
< Server: WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)
< Date: Wed, 23 Apr 2014 18:45:30 GMT
< Content-Length: 611
< Connection: Keep-Alive
< Set-Cookie: request_method=GET; path=/
{ [data not shown]
100   611  100   611    0     0  74886      0 --:--:-- --:--:-- --:--:-- 87285
* Connection #0 to host 127.0.0.1 left intact


And I attached the response file. 

Cheers,
Alexander
response.txt

Tim Pettersen

unread,
Apr 23, 2014, 5:28:02 PM4/23/14
to atlassian-...@googlegroups.com
Hi Alexander,

Thanks for that - and especially for the detailed bug bug report, screenshots and logs. It makes debugging a much easier process!

I've raised https://ecosystem.atlassian.net/browse/AC-1072 to investigate the issue further. Please watch it if you'd like further updates.

cheers,
Tim


--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages