You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Agustín Gañán <ag...@gmail.com> on 2009/01/15 19:22:59 UTC
Error in bundle installation using maven-sling-plugin
Hi all,
I'm working with the revision 734769 and I've detected an error when I try
to install a bunlde from maven using the maven-sling-plugin.
This is my plug-in config in the pom.xml [1]
The bundle initializes content in the repository and this is the bundle's
config [2].
And this is the error [3]:
Thank you all
Agus
[1]: <profile>
<id>autoInstallBundle</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>maven-sling-plugin</artifactId>
<executions>
<execution>
<id>install-bundle</id>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
<configuration>
<slingUrl>
http://localhost:8888/system/console/install
</slingUrl>
<user>admin</user>
<password>admin</password>
</configuration>
</plugin>
</plugins>
</build>
</profile>
[2]: <plugins>
<!-- Buidls the OSGi bundle to install in SLING -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Sling-Initial-Content>
SLING-INF/content
</Sling-Initial-Content>
</instructions>
</configuration>
</plugin>
</plugins>
[3]:
[INFO] [sling:install {execution: install-bundle}]
[INFO] Installing Bundle my-project-ui(my-project-ui-1.1.1-SNAPSHOT.jar) to
http://localhost:8888/system/con
sole/bundles
[INFO] Bundle installed
[INFO] Trying to configure file system provider...
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Reading configuration from
http://localhost:8888/system/console/bundles/c
onfigMgr/(service.factoryPid=org.apache.sling.fsprovider.FsResourceProvider).jso
n failed, cause: A JSONArray text must start with '[' at character 0 of
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 9 seconds
[INFO] Finished at: Thu Jan 15 19:13:43 CET 2009
[INFO] Final Memory: 17M/34M
[INFO]
------------------------------------------------------------------------
Re: Error in bundle installation using maven-sling-plugin
Posted by Carsten Ziegeler <cz...@apache.org>.
Bertrand Delacretaz wrote:
> On Mon, Jan 19, 2009 at 1:56 PM, Carsten Ziegeler <cz...@apache.org> wrote:
>> Bertrand Delacretaz wrote:
>>> ...I'm thinking of something like
>>> http://localhost:8888/system/console/info.properties
>>> which returns
>>> console-version: 1.2.2
>>> installed-plugins: foo, bar...
>
>> The web console already supports getting information about a bundle as
>> json, so a
>> http://localhost:8888/system/console/bundles/{symbolicName}.json gives
>> you information about the bundle. By using the symbolic name for the
>> webconsole, you get the version. That's sufficient for now, I think....
>
> Agree, that's good enough - I was missing some info here ;-)
>
:) No problem..in the meantime, I've thought about the problem once more
and I think I'll follow Felix suggestion and don't do a version check
upfront. If I get a wrong answer when requesting something, I know that
the webconsole is old. The only problem is to distinguish between wrong
answer and error, but that should be doable.
That should be sufficient for now.
Carsten
--
Carsten Ziegeler
cziegeler@apache.org
Re: Error in bundle installation using maven-sling-plugin
Posted by Bertrand Delacretaz <bd...@apache.org>.
On Mon, Jan 19, 2009 at 1:56 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> Bertrand Delacretaz wrote:
>> ...I'm thinking of something like
>> http://localhost:8888/system/console/info.properties
>> which returns
>> console-version: 1.2.2
>> installed-plugins: foo, bar...
> The web console already supports getting information about a bundle as
> json, so a
> http://localhost:8888/system/console/bundles/{symbolicName}.json gives
> you information about the bundle. By using the symbolic name for the
> webconsole, you get the version. That's sufficient for now, I think....
Agree, that's good enough - I was missing some info here ;-)
-Bertrand
Re: Error in bundle installation using maven-sling-plugin
Posted by Carsten Ziegeler <cz...@apache.org>.
Bertrand Delacretaz wrote:
> On Mon, Jan 19, 2009 at 12:13 PM, Carsten Ziegeler <cz...@apache.org> wrote:
>
>> Felix Meschberger wrote:
>>> ...Hmm, couldn't the console just set the response content type and the
>>> maven-sling-plugin verify that this content type actually indicates JSON...
>
>> Yes, this would make the json handling more robust, good idea. But
>> overall we need to check the version of the console anyway I think. The
>> maven sling plugin requires new features (in the sense that the web
>> console allows new json get requests)....
>
> And that might be the case in the future as well, so why not add an
> info resource URL to the console, that provides information about the
> console version, supported features etc?
>
> I'm thinking of something like
>
> http://localhost:8888/system/console/info.properties
>
> which returns
>
> console-version: 1.2.2
> installed-plugins: foo, bar
>
> (or JSON format, whatever's most convenient)
>
> We probably don't need installed-plugins right now, that's just an example.
>
For the moment I don't think we have to go this far :)
The web console already supports getting information about a bundle as
json, so a
http://localhost:8888/system/console/bundles/{symbolicName}.json gives
you information about the bundle. By using the symbolic name for the
webconsole, you get the version. That's sufficient for now, I think.
Carsten
--
Carsten Ziegeler
cziegeler@apache.org
Re: Error in bundle installation using maven-sling-plugin
Posted by Bertrand Delacretaz <bd...@apache.org>.
On Mon, Jan 19, 2009 at 12:13 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> Felix Meschberger wrote:
>> ...Hmm, couldn't the console just set the response content type and the
>> maven-sling-plugin verify that this content type actually indicates JSON...
> Yes, this would make the json handling more robust, good idea. But
> overall we need to check the version of the console anyway I think. The
> maven sling plugin requires new features (in the sense that the web
> console allows new json get requests)....
And that might be the case in the future as well, so why not add an
info resource URL to the console, that provides information about the
console version, supported features etc?
I'm thinking of something like
http://localhost:8888/system/console/info.properties
which returns
console-version: 1.2.2
installed-plugins: foo, bar
(or JSON format, whatever's most convenient)
We probably don't need installed-plugins right now, that's just an example.
-Bertrand
Re: Error in bundle installation using maven-sling-plugin
Posted by Carsten Ziegeler <cz...@apache.org>.
Felix Meschberger wrote:
>> So summarizing: We should
>> - set the default to false for adding configs
>
> Would probably make sense, yes.
>
>> - add a version check of the web console
>
> Hmm, couldn't the console just set the response content type and the
> maven-sling-plugin verify that this content type actually indicates JSON
> ? This would probably save a request round-trip and would be more
> failsafe, I assume.
>
Yes, this would make the json handling more robust, good idea. But
overall we need to check the version of the console anyway I think. The
maven sling plugin requires new features (in the sense that the web
console allows new json get requests). I could may be work around
checking the version by assuming that if the content type of the
response is not json, we have an old web console plugin. But I'm not
sure if this is a good thing?
Carsten
--
Carsten Ziegeler
cziegeler@apache.org
Re: Error in bundle installation using maven-sling-plugin
Posted by Felix Meschberger <fm...@gmail.com>.
Hi,
Carsten Ziegeler schrieb:
> Felix Meschberger wrote:
>> Hi Agus,
>>
>> Agustín Gañán schrieb:
>>> Hi all,
>>> I'm working with the revision 734769 and I've detected an error when I try
>>> to install a bunlde from maven using the maven-sling-plugin.
>>> This is my plug-in config in the pom.xml [1]
>>> The bundle initializes content in the repository and this is the bundle's
>>> config [2].
>>> And this is the error [3]:
>> IIRC you might need to update the Felix Web Console to the latest
>> SNAPSHOT for this to work.
>>
>> If you don't need the latest feature of the sling plugin, you might want
>> to use version 2.0.2-incubator. This should work flawlessly.
>>
>> On the other hand, I think the plugin should better cope with the
>> situation, that the web console might not provide, what is required.
>> Carsten, WDYT ?
>>
> Hmm, ok, first, the release 2.0.2-incubator version and current trunk
> only differ in one functionality: automatically creating configurations
> for the file resource provider for initial content in an own project [1].
> So unless you need this, use the released version :)
>
> Then you can turn off the new feature, by "-Dsling.mountByFS=false" when
> invoking maven.
>
> Ok, now for handling this, I'm not sure - the current trunk requires a
> the latest trunk from the webconsole to work properly. I think, if the
> sling plugin is configured to add the configs it should fail if this
> isn't possible. So we could change the default if adding the configs to
> false, this should help in most cases and if someone explicitly turns on
> this feature, he knows what he does.
> We could also add a version check of the webconsole - so the sling
> plugin first sends a request to the webconsole requesting for the
> installed version and if the version is too low, it can give a better
> error message.
>
> So summarizing: We should
> - set the default to false for adding configs
Would probably make sense, yes.
> - add a version check of the web console
Hmm, couldn't the console just set the response content type and the
maven-sling-plugin verify that this content type actually indicates JSON
? This would probably save a request round-trip and would be more
failsafe, I assume.
Regards
Felix
>
> WDYT?
>
> Carsten
>
> [1] https://issues.apache.org/jira/browse/SLING-798
Re: Error in bundle installation using maven-sling-plugin
Posted by Bertrand Delacretaz <bd...@apache.org>.
On Fri, Jan 16, 2009 at 8:52 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> ...So summarizing: We should
> - set the default to false for adding configs
> - add a version check of the web console...
+1 to both.
-Bertrand
Re: Error in bundle installation using maven-sling-plugin
Posted by Carsten Ziegeler <cz...@apache.org>.
Felix Meschberger wrote:
> Hi Agus,
>
> Agustín Gañán schrieb:
>> Hi all,
>> I'm working with the revision 734769 and I've detected an error when I try
>> to install a bunlde from maven using the maven-sling-plugin.
>> This is my plug-in config in the pom.xml [1]
>> The bundle initializes content in the repository and this is the bundle's
>> config [2].
>> And this is the error [3]:
>
> IIRC you might need to update the Felix Web Console to the latest
> SNAPSHOT for this to work.
>
> If you don't need the latest feature of the sling plugin, you might want
> to use version 2.0.2-incubator. This should work flawlessly.
>
> On the other hand, I think the plugin should better cope with the
> situation, that the web console might not provide, what is required.
> Carsten, WDYT ?
>
Hmm, ok, first, the release 2.0.2-incubator version and current trunk
only differ in one functionality: automatically creating configurations
for the file resource provider for initial content in an own project [1].
So unless you need this, use the released version :)
Then you can turn off the new feature, by "-Dsling.mountByFS=false" when
invoking maven.
Ok, now for handling this, I'm not sure - the current trunk requires a
the latest trunk from the webconsole to work properly. I think, if the
sling plugin is configured to add the configs it should fail if this
isn't possible. So we could change the default if adding the configs to
false, this should help in most cases and if someone explicitly turns on
this feature, he knows what he does.
We could also add a version check of the webconsole - so the sling
plugin first sends a request to the webconsole requesting for the
installed version and if the version is too low, it can give a better
error message.
So summarizing: We should
- set the default to false for adding configs
- add a version check of the web console
WDYT?
Carsten
[1] https://issues.apache.org/jira/browse/SLING-798
--
Carsten Ziegeler
cziegeler@apache.org
Re: Error in bundle installation using maven-sling-plugin
Posted by Felix Meschberger <fm...@gmail.com>.
Hi Agus,
Agustín Gañán schrieb:
> Hi all,
> I'm working with the revision 734769 and I've detected an error when I try
> to install a bunlde from maven using the maven-sling-plugin.
> This is my plug-in config in the pom.xml [1]
> The bundle initializes content in the repository and this is the bundle's
> config [2].
> And this is the error [3]:
IIRC you might need to update the Felix Web Console to the latest
SNAPSHOT for this to work.
If you don't need the latest feature of the sling plugin, you might want
to use version 2.0.2-incubator. This should work flawlessly.
On the other hand, I think the plugin should better cope with the
situation, that the web console might not provide, what is required.
Carsten, WDYT ?
Regards
Felix
>
>
> Thank you all
>
> Agus
>
> [1]: <profile>
> <id>autoInstallBundle</id>
> <activation>
> <activeByDefault>false</activeByDefault>
> </activation>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.sling</groupId>
> <artifactId>maven-sling-plugin</artifactId>
> <executions>
> <execution>
> <id>install-bundle</id>
> <goals>
> <goal>install</goal>
> </goals>
> </execution>
> </executions>
> <configuration>
> <slingUrl>
> http://localhost:8888/system/console/install
> </slingUrl>
> <user>admin</user>
> <password>admin</password>
> </configuration>
> </plugin>
> </plugins>
> </build>
> </profile>
>
> [2]: <plugins>
> <!-- Buidls the OSGi bundle to install in SLING -->
> <plugin>
> <groupId>org.apache.felix</groupId>
> <artifactId>maven-bundle-plugin</artifactId>
> <extensions>true</extensions>
> <configuration>
> <instructions>
> <Sling-Initial-Content>
> SLING-INF/content
> </Sling-Initial-Content>
> </instructions>
> </configuration>
> </plugin>
> </plugins>
>
> [3]:
>
> [INFO] [sling:install {execution: install-bundle}]
> [INFO] Installing Bundle my-project-ui(my-project-ui-1.1.1-SNAPSHOT.jar) to
> http://localhost:8888/system/con
> sole/bundles
> [INFO] Bundle installed
> [INFO] Trying to configure file system provider...
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reading configuration from
> http://localhost:8888/system/console/bundles/c
> onfigMgr/(service.factoryPid=org.apache.sling.fsprovider.FsResourceProvider).jso
> n failed, cause: A JSONArray text must start with '[' at character 0 of
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 9 seconds
> [INFO] Finished at: Thu Jan 15 19:13:43 CET 2009
> [INFO] Final Memory: 17M/34M
> [INFO]
> ------------------------------------------------------------------------
>