You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Mike Müller <mi...@mysign.ch> on 2009/09/16 22:26:01 UTC

Easiest way to use newest org.apache.sling.launchpad.base.jar in standalone Sling app

Hi

I'm a little bit stuck: I tried to use the newest
org.apache.sling.launchpad.base.jar to test SLING-922.
I took the org.apache.sling.launchpad.app-6-SNAPSHOT.jar and
replaced the org.apache.sling.launchpad.base.jar there with
the org.apache.sling.launchpad.base-2.0.5-SNAPSHOT.jar and
renamed it also to org.apache.sling.launchpad.base.jar because
Main depends on exactly this name of the jar (through
SharedConstants.DEFAULT_SLING_LAUNCHER_JAR). I created the
2.0.5-SNAPSHOT.jar with mvn clean install and copied it from
sling/launchpad/base/target into the jar.
First thing I noticed is that the new jar is 100k less big than
the older one.
Nevertheless I tried to start Sling, but had no luck.
So maybe my question is a little bit silly: What is the right
and eaysiest way to that?

best regards
mike

Re: Easiest way to use newest org.apache.sling.launchpad.base.jar in standalone Sling app

Posted by Ian Boston <ie...@tfd.co.uk>.

On 17 Sep 2009, at 06:26, Mike Müller wrote:

> Hi
>
> I'm a little bit stuck: I tried to use the newest
> org.apache.sling.launchpad.base.jar to test SLING-922.
> I took the org.apache.sling.launchpad.app-6-SNAPSHOT.jar and
> replaced the org.apache.sling.launchpad.base.jar there with
> the org.apache.sling.launchpad.base-2.0.5-SNAPSHOT.jar and
> renamed it also to org.apache.sling.launchpad.base.jar because
> Main depends on exactly this name of the jar (through
> SharedConstants.DEFAULT_SLING_LAUNCHER_JAR). I created the
> 2.0.5-SNAPSHOT.jar with mvn clean install and copied it from
> sling/launchpad/base/target into the jar.
> First thing I noticed is that the new jar is 100k less big than
> the older one.
> Nevertheless I tried to start Sling, but had no luck.
> So maybe my question is a little bit silly: What is the right
> and eaysiest way to that?
>



I dont know if this will help but we are merging the launchpad base  
with a set of custom bundles to form a standalone app. (however at the  
moment I am binding to 2.0.4)
Pom at [1]

Ian


1 http://github.com/ieb/open-experiments/tree/master/slingtests/osgikernel/app/

> best regards
> mike


Re: Easiest way to use newest org.apache.sling.launchpad.base.jar in standalone Sling app

Posted by Felix Meschberger <fm...@gmail.com>.
Hi Mike,

Mike Müller schrieb:
> Hi Felix
> 
>>> I'm a little bit stuck: I tried to use the newest
>>> org.apache.sling.launchpad.base.jar to test SLING-922.
>>> I took the org.apache.sling.launchpad.app-6-SNAPSHOT.jar and
>>> replaced the org.apache.sling.launchpad.base.jar there with
>>> the org.apache.sling.launchpad.base-2.0.5-SNAPSHOT.jar and
>>> renamed it also to org.apache.sling.launchpad.base.jar because
>>> Main depends on exactly this name of the jar (through
>>> SharedConstants.DEFAULT_SLING_LAUNCHER_JAR). I created the
>>> 2.0.5-SNAPSHOT.jar with mvn clean install and copied it from
>>> sling/launchpad/base/target into the jar.
>>> First thing I noticed is that the new jar is 100k less big than
>>> the older one.
>> The reason for this is, that we do not include the OSGi compendium
>> library in the base jar any more (SLING-1094)
>>
>>> Nevertheless I tried to start Sling, but had no luck.
>>> So maybe my question is a little bit silly: What is the right
>>> and eaysiest way to that?
>> That is not expected. What exactly is the problem ? What happens ? Any
>> log messages to share ?
> 
> The problem I found is related to the problem described in SLING-1113 [1].
> The method extractFileName uses File.separatorChar to extract the file name
> without the path. But if the file comes from a jar on windows systems
> File.separatorChar is "\" but the file name from a char is separated with
> a "/". So the jars could not be extracted and Sling could not be started.
> Maybe BootstrapInstaller.extractFileName has to check for "/" and the
> File.separatorChar if it is not equal to "/" to make sure the code is
> running on every platform (even if it's questionable if windows should
> be supported ;-)).
> 
> [1] https://issues.apache.org/jira/browse/SLING-1113

I see. Did you see my proposed modified patch ? (Well, I just attached
it ;-) )

Regards
Felix

> 
> best regards
> mike


RE: Easiest way to use newest org.apache.sling.launchpad.base.jar in standalone Sling app

Posted by Mike Müller <mi...@mysign.ch>.
Hi Felix

> > I'm a little bit stuck: I tried to use the newest
> > org.apache.sling.launchpad.base.jar to test SLING-922.
> > I took the org.apache.sling.launchpad.app-6-SNAPSHOT.jar and
> > replaced the org.apache.sling.launchpad.base.jar there with
> > the org.apache.sling.launchpad.base-2.0.5-SNAPSHOT.jar and
> > renamed it also to org.apache.sling.launchpad.base.jar because
> > Main depends on exactly this name of the jar (through
> > SharedConstants.DEFAULT_SLING_LAUNCHER_JAR). I created the
> > 2.0.5-SNAPSHOT.jar with mvn clean install and copied it from
> > sling/launchpad/base/target into the jar.
> > First thing I noticed is that the new jar is 100k less big than
> > the older one.
>
> The reason for this is, that we do not include the OSGi compendium
> library in the base jar any more (SLING-1094)
>
> > Nevertheless I tried to start Sling, but had no luck.
> > So maybe my question is a little bit silly: What is the right
> > and eaysiest way to that?
>
> That is not expected. What exactly is the problem ? What happens ? Any
> log messages to share ?

The problem I found is related to the problem described in SLING-1113 [1].
The method extractFileName uses File.separatorChar to extract the file name
without the path. But if the file comes from a jar on windows systems
File.separatorChar is "\" but the file name from a char is separated with
a "/". So the jars could not be extracted and Sling could not be started.
Maybe BootstrapInstaller.extractFileName has to check for "/" and the
File.separatorChar if it is not equal to "/" to make sure the code is
running on every platform (even if it's questionable if windows should
be supported ;-)).

[1] https://issues.apache.org/jira/browse/SLING-1113

best regards
mike

Re: Easiest way to use newest org.apache.sling.launchpad.base.jar in standalone Sling app

Posted by Felix Meschberger <fm...@gmail.com>.
Hi Mike,

Mike Müller schrieb:
> Hi
> 
> I'm a little bit stuck: I tried to use the newest
> org.apache.sling.launchpad.base.jar to test SLING-922.
> I took the org.apache.sling.launchpad.app-6-SNAPSHOT.jar and
> replaced the org.apache.sling.launchpad.base.jar there with
> the org.apache.sling.launchpad.base-2.0.5-SNAPSHOT.jar and
> renamed it also to org.apache.sling.launchpad.base.jar because
> Main depends on exactly this name of the jar (through
> SharedConstants.DEFAULT_SLING_LAUNCHER_JAR). I created the
> 2.0.5-SNAPSHOT.jar with mvn clean install and copied it from
> sling/launchpad/base/target into the jar.
> First thing I noticed is that the new jar is 100k less big than
> the older one.

The reason for this is, that we do not include the OSGi compendium
library in the base jar any more (SLING-1094)

> Nevertheless I tried to start Sling, but had no luck.
> So maybe my question is a little bit silly: What is the right
> and eaysiest way to that?

That is not expected. What exactly is the problem ? What happens ? Any
log messages to share ?

Regards
Felix



Re: Easiest way to use newest org.apache.sling.launchpad.base.jar in standalone Sling app

Posted by Bertrand Delacretaz <bd...@gmail.com>.
Hi Mike,

On Thu, Sep 17, 2009 at 1:58 PM, Mike Müller <mi...@mysign.ch> wrote:
> ...If you build launchpad/app it's using
> launchpad.base 2.0.4-INCUBATOR for the launcher-jar because of the
> launchpad/app/pom.xml...

Ok, got it now, the launchpad.base version is declared twice (argh) in
that pom, and both instances were out of sync.

Should be fixed in revision 816170 - I also added warnings to the pom
to make sure we keep both versions in sync (and there must be a better
way).

-Bertrand

RE: Easiest way to use newest org.apache.sling.launchpad.base.jar in standalone Sling app

Posted by Mike Müller <mi...@mysign.ch>.
> > ...I tried to use the newest
> > org.apache.sling.launchpad.base.jar to test SLING-922....
>
> > ...So maybe my question is a little bit silly: What is the right
> > and eaysiest way to that?...
>
> Checking with mvn dependency:resolve, launchpad/app correctly depends
> on launchpad.base:jar:app:2.0.5-SNAPSHOT, so building as follows
> should work:
>
> cd launchpad/base
> mvn clean install
> cd ../app
> mvn clean install
> java -jar target/org...
>
> And a full build at the top of the source code tree should
> work as well.
> -Bertrand

Unfortunately that's not the case. If you build launchpad/app it's using
launchpad.base 2.0.4-INCUBATOR for the launcher-jar because of the
launchpad/app/pom.xml:

<id>copy-launcher-jar</id>
<goals>
    <goal>copy</goal>
</goals>
<configuration>
    <artifactItems>
        <artifactItem>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.launchpad.base</artifactId>
            <version>2.0.4-incubator</version>
        </artifactItem>
    </artifactItems>
    <stripVersion>true</stripVersion>
    <excludeTransitive>true</excludeTransitive>
    <outputDirectory>
        ${project.build.outputDirectory}/resources
    </outputDirectory>
</configuration>

Maybe this version should be changed to 2.0.5-INCUBATOR?

best regards
mike

Re: Easiest way to use newest org.apache.sling.launchpad.base.jar in standalone Sling app

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Wed, Sep 16, 2009 at 10:26 PM, Mike Müller <mi...@mysign.ch> wrote:
> ...I tried to use the newest
> org.apache.sling.launchpad.base.jar to test SLING-922....

> ...So maybe my question is a little bit silly: What is the right
> and eaysiest way to that?...

Checking with mvn dependency:resolve, launchpad/app correctly depends
on launchpad.base:jar:app:2.0.5-SNAPSHOT, so building as follows
should work:

cd launchpad/base
mvn clean install
cd ../app
mvn clean install
java -jar target/org...

And a full build at the top of the source code tree should work as well.
-Bertrand