[jira] [Commented] (SLING-3737) Instance Sling Identifier may be randomly reset on restart

2014-07-07 Thread Stefan Egli (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053400#comment-14053400
 ] 

Stefan Egli commented on SLING-3737:


nice one!
+1 from my side

 Instance Sling Identifier may be randomly reset on restart
 --

 Key: SLING-3737
 URL: https://issues.apache.org/jira/browse/SLING-3737
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Settings 1.3.0
Reporter: Timothee Maret
 Attachments: SLING-3737.diff


 In our Setup, we experience instances which change their Sling identifier 
 upon restart.
 We experiences only a few occurrences of this issue, but the effect is really 
 bad, turing the services relying on the Sling Identifier into un expected 
 state (for instance Sling discovery service).
 We have checked that the sling.id.file was present before the issue occurred.
 We also checked that the value in this file was valid (36 byte long UUID).
 Despite this valid file, the instance reset the Sling ID.
 Looking at the latest code in 
 org.apache.sling.settings.impl.SlingSettingsServiceImpl#readSlingId
 it seems there is a bug in the way the sling.id.file file is read.
 {code}
 private String readSlingId(final File idFile) {
 if (idFile.exists()  idFile.length() = 36) {
 FileInputStream fin = null;
 try {
 fin = new FileInputStream(idFile);
 final byte[] rawBytes = new byte[36];
 if (fin.read(rawBytes) == 36) {
 final String rawString = new String(rawBytes, 
 ISO-8859-1);
 // roundtrip to ensure correct format of UUID value
 final String id = UUID.fromString(rawString).toString();
 logger.debug(Got Sling ID {} from file {}, id, idFile);
 return id;
 }
 } catch (final Throwable t) {
 logger.error(Failed reading UUID from id file  + idFile
 + , creating new id, t);
 } finally {
 if (fin != null) {
 try {
 fin.close();
 } catch (IOException ignore) {
 }
 }
 }
 }
 return null;
 }
 {code}
 In the line
 {code}
 if (fin.read(rawBytes) == 36) {
 {code}
 The code miss uses the java.io.FileInputStream#read API.
 {code}
 /**
  * Reads up to codeb.length/code bytes of data from this input
  * stream into an array of bytes. This method blocks until some input
  * is available.
  *
  * @param  b   the buffer into which the data is read.
  * @return the total number of bytes read into the buffer, or
  * code-1/code if there is no more data because the end of
  * the file has been reached.
  * @exception  IOException  if an I/O error occurs.
  */
 {code}
 The API stipulates that the method blocks until if finds *some* data.
 This is a common pattern with Java IO APIs, and indeed, the method may return 
 with only one byte read even though the end of the stream was not reached.
 If this is the case, the current logic will treat the slingId as invalid and 
 generate a new one.
 A way to fix that is to read the sling id file completely, for instance using 
 the org.apache.commons.io.FileUtils API
 We are running on CentOS 6.2, JDK 1.7.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (SLING-3737) Instance Sling Identifier may be randomly reset on restart

2014-07-07 Thread Timothee Maret (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-3737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Timothee Maret updated SLING-3737:
--

Description: 
In our Setup, we experience instances changing their Sling identifier upon 
restart.
We have experienced only a few occurrences of this issue, but the effect is 
really bad, turning the services relying on the Sling Identifier into 
unexpected state (for instance Sling discovery service).

We have checked that the sling.id.file was present before the issue occurred.
We also checked that the value in this file was valid (36 byte long UUID).

Despite having a valid sling.id.file file, the instance sometimes reset the 
Sling ID upon restart.

Looking at the latest code in 
org.apache.sling.settings.impl.SlingSettingsServiceImpl#readSlingId
it seems there is a bug in the way the sling id is read from the file 
sling.id.file.

{code}
private String readSlingId(final File idFile) {
if (idFile.exists()  idFile.length() = 36) {
FileInputStream fin = null;
try {
fin = new FileInputStream(idFile);
final byte[] rawBytes = new byte[36];
if (fin.read(rawBytes) == 36) {
final String rawString = new String(rawBytes, ISO-8859-1);

// roundtrip to ensure correct format of UUID value
final String id = UUID.fromString(rawString).toString();
logger.debug(Got Sling ID {} from file {}, id, idFile);

return id;
}
} catch (final Throwable t) {
logger.error(Failed reading UUID from id file  + idFile
+ , creating new id, t);
} finally {
if (fin != null) {
try {
fin.close();
} catch (IOException ignore) {
}
}
}
}
return null;
}
{code}

In the line
{code}
if (fin.read(rawBytes) == 36) {
{code}
The code miss uses the java.io.FileInputStream#read API.

{code}
/**
 * Reads up to codeb.length/code bytes of data from this input
 * stream into an array of bytes. This method blocks until some input
 * is available.
 *
 * @param  b   the buffer into which the data is read.
 * @return the total number of bytes read into the buffer, or
 * code-1/code if there is no more data because the end of
 * the file has been reached.
 * @exception  IOException  if an I/O error occurs.
 */
{code}

The API stipulates that the method blocks until if finds *some* data.
This is a common pattern with Java IO APIs, and indeed, the method may return 
with only one byte read even though the end of the stream was not reached.
If this is the case, the current logic will treat the slingId as invalid and 
generate a new one.

A way to fix that is to read the sling id file completely, for instance using 
the org.apache.commons.io.FileUtils API

We are running on CentOS 6.2, JDK 1.7.

  was:
In our Setup, we experience instances which change their Sling identifier upon 
restart.
We experiences only a few occurrences of this issue, but the effect is really 
bad, turing the services relying on the Sling Identifier into un expected state 
(for instance Sling discovery service).

We have checked that the sling.id.file was present before the issue occurred.
We also checked that the value in this file was valid (36 byte long UUID).

Despite this valid file, the instance reset the Sling ID.

Looking at the latest code in 
org.apache.sling.settings.impl.SlingSettingsServiceImpl#readSlingId
it seems there is a bug in the way the sling.id.file file is read.

{code}
private String readSlingId(final File idFile) {
if (idFile.exists()  idFile.length() = 36) {
FileInputStream fin = null;
try {
fin = new FileInputStream(idFile);
final byte[] rawBytes = new byte[36];
if (fin.read(rawBytes) == 36) {
final String rawString = new String(rawBytes, ISO-8859-1);

// roundtrip to ensure correct format of UUID value
final String id = UUID.fromString(rawString).toString();
logger.debug(Got Sling ID {} from file {}, id, idFile);

return id;
}
} catch (final Throwable t) {
logger.error(Failed reading UUID from id file  + idFile
+ , creating new id, t);
} finally {
if (fin != null) {
try {
fin.close();
} catch (IOException ignore) {
}
}
}
}
return null;
}
{code}

In the line
{code}
if (fin.read(rawBytes) == 36) 

[jira] [Issue Comment Deleted] (SLING-3290) Long startup time with many vanityPath

2014-07-07 Thread Antonio Sanso (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-3290?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Antonio Sanso updated SLING-3290:
-

Comment: was deleted

(was: I am out of office, back on June 22.

regards

antonio


)

 Long startup time with many vanityPath
 --

 Key: SLING-3290
 URL: https://issues.apache.org/jira/browse/SLING-3290
 Project: Sling
  Issue Type: Improvement
  Components: ResourceResolver
Reporter: Antonio Sanso
Assignee: Antonio Sanso
  Labels: vanity
 Attachments: StartupWithManyVanityPath.jpg


 When many vanityPath or alias are present the system take long time to 
 startup , Same when a vanityPath/alias is removed or updated .
 The reason behind is the usage of a query that updates the global mapentry.
 I have added a new Test to the performance test suite and this is the outcome
 {code}
 0 vanityPath  16ms
 1  vanityPath 19ms
 10 vanityPath 70ms
 100 vanityPath111ms
 1000 vanityPath   200ms
 1 vanityPath  1173ms
 3 vanityPath  3358ms
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (SLING-3685) Document and further automate the IDE tooling release process

2014-07-07 Thread Robert Munteanu (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-3685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Munteanu updated SLING-3685:
---

Attachment: sign.sh

 Document and further automate the IDE tooling release process
 -

 Key: SLING-3685
 URL: https://issues.apache.org/jira/browse/SLING-3685
 Project: Sling
  Issue Type: Task
  Components: IDE
Reporter: Robert Munteanu
 Fix For: Sling Eclipse IDE 1.0.2

 Attachments: sign.sh


 The current release process is very much manual, due to some of tycho's 
 peculiarities ( see also SLING-3620 ). This task tracks the documentation of 
 this release process and possible automation enhancements.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Comment Edited] (SLING-3685) Document and further automate the IDE tooling release process

2014-07-07 Thread Robert Munteanu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14040663#comment-14040663
 ] 

Robert Munteanu edited comment on SLING-3685 at 7/7/14 8:50 AM:


For reference, this is the current release process, assuming that the current 
version is 1.0.1-SNAPSHOT

* set the fix version as released: {{mvn tycho-versions:set-version 
-DnewVersion=1.0.2}}
* commit the change to svn
* manually tag in svn {{svn copy 
https://svn.apache.org/repos/asf/sling/trunk/tooling/ide 
https://svn.apache.org/repos/asf/sling/tags/sling-ide-tooling-1.0.2}}
* deploy the project with p2/gpg signing enabled {{mvn clean deploy 
-Psign,!eclipse-test}} ( alternatively {{mvn clean deploy 
-Psign,\!eclipse-test}} to make bash happy) 
* inspect the staging repository from nexus to ensure that all artifacts are 
properly deployed
* call the vote
* Update to next version, e.g. {{mvn tycho-versions:set-version 
-DnewVersion=1.0.3-SNAPSHOT}}

Once the release has passed, the following must be done:

* upload p2update.zip* to https://dist.apache.org/repos/dist/release/sling/
* upload unzipped update site to 
https://dist.apache.org/repos/dist/release/sling/eclipse/1.0.2
** create GPG signatures and checksums for all uploaded jars, possibly using 
the attached [^sign.sh] script
* update 
https://dist.apache.org/repos/dist/release/sling/eclipse/composite\{Content,Artifacts\}.xml
 to point to the latest $VERSION ( remove old one )
* (TODO how?) archive the old artifact versions but leave pointers to 
archive.apache.org 


was (Author: rombert):
For reference, this is the current release process, assuming that the current 
version is 1.0.1-SNAPSHOT

* set the fix version as released: {{mvn tycho-versions:set-version 
-DnewVersion=1.0.2}}
* commit the change to svn
* manually tag in svn {{svn copy 
https://svn.apache.org/repos/asf/sling/trunk/tooling/ide 
https://svn.apache.org/repos/asf/sling/tags/sling-ide-tooling-1.0.2}}
* deploy the project with p2/gpg signing enabled {{mvn clean deploy 
-Psign,!eclipse-test}} ( alternatively {{mvn clean deploy 
-Psign,\!eclipse-test}} to make bash happy) 
* inspect the staging repository from nexus to ensure that all artifacts are 
properly deployed
* call the vote
* Update to next version, e.g. {{mvn tycho-versions:set-version 
-DnewVersion=1.0.3-SNAPSHOT}}

Once the release has passed, the following must be done:

* upload p2update.zip* to https://dist.apache.org/repos/dist/release/sling/
* upload unzipped update site to 
https://dist.apache.org/repos/dist/release/sling/eclipse/1.0.2
* update 
https://dist.apache.org/repos/dist/release/sling/eclipse/composite\{Content,Artifacts\}.xml
 to point to the latest $VERSION ( remove old one )
* (TODO how?) archive the old artifact versions but leave pointers to 
archive.apache.org 

 Document and further automate the IDE tooling release process
 -

 Key: SLING-3685
 URL: https://issues.apache.org/jira/browse/SLING-3685
 Project: Sling
  Issue Type: Task
  Components: IDE
Reporter: Robert Munteanu
 Fix For: Sling Eclipse IDE 1.0.2

 Attachments: sign.sh


 The current release process is very much manual, due to some of tycho's 
 peculiarities ( see also SLING-3620 ). This task tracks the documentation of 
 this release process and possible automation enhancements.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Jenkins build is back to stable : sling-trunk-1.7 » Apache Sling SLF4J Implementation (Logback) #637

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.7/org.apache.sling$org.apache.sling.commons.log/637/



Jenkins build is still unstable: sling-trunk-1.7 » Apache Sling Launchpad Testing #637

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.7/org.apache.sling$org.apache.sling.launchpad.testing/637/



Jenkins build is back to stable : sling-trunk-1.7 » Apache Sling Resource-Based Discovery Service #637

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.7/org.apache.sling$org.apache.sling.discovery.impl/637/



[jira] [Created] (SLING-3739) No repository found at ... : ClassNotFoundException org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory

2014-07-07 Thread Robert Munteanu (JIRA)
Robert Munteanu created SLING-3739:
--

 Summary: No repository found at ... : ClassNotFoundException 
org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 Key: SLING-3739
 URL: https://issues.apache.org/jira/browse/SLING-3739
 Project: Sling
  Issue Type: Bug
  Components: IDE
Affects Versions: Sling Eclipse IDE 1.0.0
Reporter: Robert Munteanu
Priority: Critical
 Fix For: Sling Eclipse IDE 1.0.2


This seems to be a rehash of SLING-3647. When starting up a server on a freshly 
launched Eclipse instance I sometimes get this error

{code}java.lang.IllegalArgumentException: No repository found at 
http://localhost:4504/
http://localhost:4504/server/-/jcr:root : java.lang.ClassNotFoundException: 
org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
http://localhost:4504/crx/-/jcr:root : java.lang.ClassNotFoundException: 
org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
at 
org.apache.sling.ide.jcr.RepositoryUtils.getRepositoryAddress(RepositoryUtils.java:94)
at 
org.apache.sling.ide.jcr.RepositoryUtils.getRepository(RepositoryUtils.java:44)
at 
org.apache.sling.ide.impl.vlt.VltRepository.connect(VltRepository.java:65)
at 
org.apache.sling.ide.impl.vlt.VltRepositoryFactory.connectRepository(VltRepositoryFactory.java:69)
at 
org.apache.sling.ide.eclipse.core.ServerUtil.connectRepository(ServerUtil.java:154)
at 
org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.start(SlingLaunchpadBehaviour.java:88)
at 
org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadLaunchConfigurationDelegate.launch(SlingLaunchpadLaunchConfigurationDelegate.java:45)
at 
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
at 
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
at 
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:700)
at 
org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3541)
at 
org.eclipse.wst.server.core.internal.Server.startImpl(Server.java:3477)
at 
org.eclipse.wst.server.core.internal.Server$StartJob.run(Server.java:367)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53){code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Jenkins build is still unstable: sling-trunk-1.7 #637

2014-07-07 Thread Apache Jenkins Server
See https://builds.apache.org/job/sling-trunk-1.7/changes



[jira] [Created] (SLING-3740) Remove need to manually install the tooling support bundle

2014-07-07 Thread Robert Munteanu (JIRA)
Robert Munteanu created SLING-3740:
--

 Summary: Remove need to manually install the tooling support bundle
 Key: SLING-3740
 URL: https://issues.apache.org/jira/browse/SLING-3740
 Project: Sling
  Issue Type: Bug
  Components: IDE
Affects Versions: Sling Eclipse IDE 1.0.0
Reporter: Robert Munteanu
 Fix For: Sling Eclipse IDE 1.0.2


The initial workflow is a bit strange in terms of how we deploy bundles. We 
should stop prompting the user to install the tooling bundle and simply do that 
as part of the first connection to the server.

The manual controls should stay for now, but in the regular workflow there 
should be no need to do anything by hand.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3739) No repository found at ... : ClassNotFoundException org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory

2014-07-07 Thread Stefan Egli (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053468#comment-14053468
 ] 

Stefan Egli commented on SLING-3739:


yes, I get this too - when getting this, after another few seconds it usually 
works..

 No repository found at ... : ClassNotFoundException 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 --

 Key: SLING-3739
 URL: https://issues.apache.org/jira/browse/SLING-3739
 Project: Sling
  Issue Type: Bug
  Components: IDE
Affects Versions: Sling Eclipse IDE 1.0.0
Reporter: Robert Munteanu
Priority: Critical
 Fix For: Sling Eclipse IDE 1.0.2


 This seems to be a rehash of SLING-3647. When starting up a server on a 
 freshly launched Eclipse instance I sometimes get this error
 {code}java.lang.IllegalArgumentException: No repository found at 
 http://localhost:4504/
 http://localhost:4504/server/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 http://localhost:4504/crx/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepositoryAddress(RepositoryUtils.java:94)
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepository(RepositoryUtils.java:44)
   at 
 org.apache.sling.ide.impl.vlt.VltRepository.connect(VltRepository.java:65)
   at 
 org.apache.sling.ide.impl.vlt.VltRepositoryFactory.connectRepository(VltRepositoryFactory.java:69)
   at 
 org.apache.sling.ide.eclipse.core.ServerUtil.connectRepository(ServerUtil.java:154)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.start(SlingLaunchpadBehaviour.java:88)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadLaunchConfigurationDelegate.launch(SlingLaunchpadLaunchConfigurationDelegate.java:45)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:700)
   at 
 org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3541)
   at 
 org.eclipse.wst.server.core.internal.Server.startImpl(Server.java:3477)
   at 
 org.eclipse.wst.server.core.internal.Server$StartJob.run(Server.java:367)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53){code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3639) Changing node types to/from sling:Folder within .content.xml fails

2014-07-07 Thread Stefan Egli (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053471#comment-14053471
 ] 

Stefan Egli commented on SLING-3639:


implemented second part: merging child nodes (with parent) if the new 
serializationKind is metadata_*

 Changing node types to/from sling:Folder within .content.xml fails
 --

 Key: SLING-3639
 URL: https://issues.apache.org/jira/browse/SLING-3639
 Project: Sling
  Issue Type: Bug
  Components: IDE
Reporter: Stefan Egli
Assignee: Stefan Egli
 Fix For: Sling Eclipse IDE 1.0.2


 When changing the type of a node serialized into a .content.xml to/from 
 sling:Folder, various exceptions occur.
 This ticket is to have a reference between the various bugfixes related to 
 this.
 An earlier fix likely related to this is : http://svn.apache.org/r156
 Consider the following structure:
 {code}
 grandparent [nt:unstructured]
 \- parent [nt:unstructured]
  |- child1 [nt:unstructured]
  \- child2 [nt:unstructured]
 {code}
 initially the structure is serialized into one:
 {code}
 grandparent/.content.xml
 {code}
 If child2 is changed to sling:Folder, the content is published and 
 re-imported, the underlying vault serialization looks as follows:
 {code}
 grandparent/.content.xml
 grandparent/parent/child2/.content.xml
 {code}
 Changing child2 back to nt:unstructured results in:
 {code}
 [June 4, 2014 10:52:04 AM CEST] AddOrUpdateNodeCommand - 
 /content/okapp/grandparent/parent : JcrResult[ success:true] (53 ms)
 [June 4, 2014 10:52:39 AM CEST] AddOrUpdateNodeCommand - 
 /content/okapp/grandparent/parent/child2 : JcrResult[ success:false, 
 exception: org.apache.sling.ide.transport.RepositoryException - 
 javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type] (48 ms)
 org.apache.sling.ide.transport.RepositoryException: 
 javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type
   at org.apache.sling.ide.impl.vlt.JcrResult.failure(JcrResult.java:33)
   at org.apache.sling.ide.impl.vlt.JcrCommand.execute(JcrCommand.java:62)
   at 
 org.apache.sling.ide.transport.TracingCommand.execute(TracingCommand.java:43)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.execute(SlingLaunchpadBehaviour.java:364)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishContentModule(SlingLaunchpadBehaviour.java:330)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishModule(SlingLaunchpadBehaviour.java:182)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1091)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1183)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:987)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
   at 
 org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3154)
   at 
 org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
 Caused by: javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at 
 org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:69)
   at 
 org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:51)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(RepositoryServiceImpl.java:611)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.access$600(RepositoryServiceImpl.java:547)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.submit(RepositoryServiceImpl.java:452)
   at 
 org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.execute(WorkspaceManager.java:858)
   at 
 org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.access$500(WorkspaceManager.java:817)
   at 
 

[jira] [Assigned] (SLING-3639) Changing node types to/from sling:Folder within .content.xml fails

2014-07-07 Thread Stefan Egli (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-3639?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Egli reassigned SLING-3639:
--

Assignee: Robert Munteanu  (was: Stefan Egli)

[~rombert], with the introduction of http://svn.apache.org/r1608378 the 
content-sync mechanism now deletes the parent node unfortunately. Could you pls 
have a look if this could be fixed easily?

The reason this happens is that the 
SlingLaunchpadBehaviour.publishContentModule gets the change of the 
.content.xml first, then gets the delete events of the folders and .content.xml 
of the child. So it looks like that mechanism is too simplistic?

 Changing node types to/from sling:Folder within .content.xml fails
 --

 Key: SLING-3639
 URL: https://issues.apache.org/jira/browse/SLING-3639
 Project: Sling
  Issue Type: Bug
  Components: IDE
Reporter: Stefan Egli
Assignee: Robert Munteanu
 Fix For: Sling Eclipse IDE 1.0.2


 When changing the type of a node serialized into a .content.xml to/from 
 sling:Folder, various exceptions occur.
 This ticket is to have a reference between the various bugfixes related to 
 this.
 An earlier fix likely related to this is : http://svn.apache.org/r156
 Consider the following structure:
 {code}
 grandparent [nt:unstructured]
 \- parent [nt:unstructured]
  |- child1 [nt:unstructured]
  \- child2 [nt:unstructured]
 {code}
 initially the structure is serialized into one:
 {code}
 grandparent/.content.xml
 {code}
 If child2 is changed to sling:Folder, the content is published and 
 re-imported, the underlying vault serialization looks as follows:
 {code}
 grandparent/.content.xml
 grandparent/parent/child2/.content.xml
 {code}
 Changing child2 back to nt:unstructured results in:
 {code}
 [June 4, 2014 10:52:04 AM CEST] AddOrUpdateNodeCommand - 
 /content/okapp/grandparent/parent : JcrResult[ success:true] (53 ms)
 [June 4, 2014 10:52:39 AM CEST] AddOrUpdateNodeCommand - 
 /content/okapp/grandparent/parent/child2 : JcrResult[ success:false, 
 exception: org.apache.sling.ide.transport.RepositoryException - 
 javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type] (48 ms)
 org.apache.sling.ide.transport.RepositoryException: 
 javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type
   at org.apache.sling.ide.impl.vlt.JcrResult.failure(JcrResult.java:33)
   at org.apache.sling.ide.impl.vlt.JcrCommand.execute(JcrCommand.java:62)
   at 
 org.apache.sling.ide.transport.TracingCommand.execute(TracingCommand.java:43)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.execute(SlingLaunchpadBehaviour.java:364)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishContentModule(SlingLaunchpadBehaviour.java:330)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishModule(SlingLaunchpadBehaviour.java:182)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1091)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1183)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:987)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
   at 
 org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3154)
   at 
 org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
 Caused by: javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at 
 org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:69)
   at 
 org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:51)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(RepositoryServiceImpl.java:611)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.access$600(RepositoryServiceImpl.java:547)
   at 
 

[jira] [Commented] (SLING-3739) No repository found at ... : ClassNotFoundException org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory

2014-07-07 Thread Robert Munteanu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053477#comment-14053477
 ] 

Robert Munteanu commented on SLING-3739:


FTR, using Require-Bundle in the impl-vlt bundle to pull in the vlt-wrapper 
bundle does not work.

 No repository found at ... : ClassNotFoundException 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 --

 Key: SLING-3739
 URL: https://issues.apache.org/jira/browse/SLING-3739
 Project: Sling
  Issue Type: Bug
  Components: IDE
Affects Versions: Sling Eclipse IDE 1.0.0
Reporter: Robert Munteanu
Priority: Critical
 Fix For: Sling Eclipse IDE 1.0.2


 This seems to be a rehash of SLING-3647. When starting up a server on a 
 freshly launched Eclipse instance I sometimes get this error
 {code}java.lang.IllegalArgumentException: No repository found at 
 http://localhost:4504/
 http://localhost:4504/server/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 http://localhost:4504/crx/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepositoryAddress(RepositoryUtils.java:94)
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepository(RepositoryUtils.java:44)
   at 
 org.apache.sling.ide.impl.vlt.VltRepository.connect(VltRepository.java:65)
   at 
 org.apache.sling.ide.impl.vlt.VltRepositoryFactory.connectRepository(VltRepositoryFactory.java:69)
   at 
 org.apache.sling.ide.eclipse.core.ServerUtil.connectRepository(ServerUtil.java:154)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.start(SlingLaunchpadBehaviour.java:88)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadLaunchConfigurationDelegate.launch(SlingLaunchpadLaunchConfigurationDelegate.java:45)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:700)
   at 
 org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3541)
   at 
 org.eclipse.wst.server.core.internal.Server.startImpl(Server.java:3477)
   at 
 org.eclipse.wst.server.core.internal.Server$StartJob.run(Server.java:367)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53){code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Eclipse stuff, source vs. convenience binaries

2014-07-07 Thread Bertrand Delacretaz
Hi,

Unless I'm mistaken, I see only binaries at
https://dist.apache.org/repos/dist/release/sling/eclipse/1.0.0/ - did
we release the source code as well, and where?

Also, I think the http://apache.org/dist/sling/eclipse/1.0.0/ HTML
page should include a disclaimer that what's there are only
convenience binaries, and that people should build them from source if
they want the official Apache release. Maybe point to a new page on
our website that explains this better and that can be reused for
similar such releases?

-Bertrand


[jira] [Commented] (SLING-3639) Changing node types to/from sling:Folder within .content.xml fails

2014-07-07 Thread Stefan Egli (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053480#comment-14053480
 ] 

Stefan Egli commented on SLING-3639:


Sure. It's basically the steps shown at the beginning of this ticket, so:

* Create:
{code}
grandparent [nt:unstructured]
\- parent [nt:unstructured]
 |- child1 [nt:unstructured]
 \- child2 [nt:unstructured]
{code}
* Then change child2 to sling:Folder
* Changing child2 back to nt:unstructured then causes the deletion of parent 
(since I delete parent/child2 and parent folders explicitly, as they are no 
longer needed)

 Changing node types to/from sling:Folder within .content.xml fails
 --

 Key: SLING-3639
 URL: https://issues.apache.org/jira/browse/SLING-3639
 Project: Sling
  Issue Type: Bug
  Components: IDE
Reporter: Stefan Egli
Assignee: Robert Munteanu
 Fix For: Sling Eclipse IDE 1.0.2


 When changing the type of a node serialized into a .content.xml to/from 
 sling:Folder, various exceptions occur.
 This ticket is to have a reference between the various bugfixes related to 
 this.
 An earlier fix likely related to this is : http://svn.apache.org/r156
 Consider the following structure:
 {code}
 grandparent [nt:unstructured]
 \- parent [nt:unstructured]
  |- child1 [nt:unstructured]
  \- child2 [nt:unstructured]
 {code}
 initially the structure is serialized into one:
 {code}
 grandparent/.content.xml
 {code}
 If child2 is changed to sling:Folder, the content is published and 
 re-imported, the underlying vault serialization looks as follows:
 {code}
 grandparent/.content.xml
 grandparent/parent/child2/.content.xml
 {code}
 Changing child2 back to nt:unstructured results in:
 {code}
 [June 4, 2014 10:52:04 AM CEST] AddOrUpdateNodeCommand - 
 /content/okapp/grandparent/parent : JcrResult[ success:true] (53 ms)
 [June 4, 2014 10:52:39 AM CEST] AddOrUpdateNodeCommand - 
 /content/okapp/grandparent/parent/child2 : JcrResult[ success:false, 
 exception: org.apache.sling.ide.transport.RepositoryException - 
 javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type] (48 ms)
 org.apache.sling.ide.transport.RepositoryException: 
 javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type
   at org.apache.sling.ide.impl.vlt.JcrResult.failure(JcrResult.java:33)
   at org.apache.sling.ide.impl.vlt.JcrCommand.execute(JcrCommand.java:62)
   at 
 org.apache.sling.ide.transport.TracingCommand.execute(TracingCommand.java:43)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.execute(SlingLaunchpadBehaviour.java:364)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishContentModule(SlingLaunchpadBehaviour.java:330)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishModule(SlingLaunchpadBehaviour.java:182)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1091)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1183)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:987)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
   at 
 org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3154)
   at 
 org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
 Caused by: javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at 
 org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:69)
   at 
 org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:51)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(RepositoryServiceImpl.java:611)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.access$600(RepositoryServiceImpl.java:547)
   at 
 

[jira] [Commented] (SLING-3739) No repository found at ... : ClassNotFoundException org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory

2014-07-07 Thread Robert Munteanu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053482#comment-14053482
 ] 

Robert Munteanu commented on SLING-3739:


Another failed attempt: exporting org.apache.jackrabbit.jcr2spi from vlt-wrapper

 No repository found at ... : ClassNotFoundException 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 --

 Key: SLING-3739
 URL: https://issues.apache.org/jira/browse/SLING-3739
 Project: Sling
  Issue Type: Bug
  Components: IDE
Affects Versions: Sling Eclipse IDE 1.0.0
Reporter: Robert Munteanu
Priority: Critical
 Fix For: Sling Eclipse IDE 1.0.2


 This seems to be a rehash of SLING-3647. When starting up a server on a 
 freshly launched Eclipse instance I sometimes get this error
 {code}java.lang.IllegalArgumentException: No repository found at 
 http://localhost:4504/
 http://localhost:4504/server/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 http://localhost:4504/crx/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepositoryAddress(RepositoryUtils.java:94)
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepository(RepositoryUtils.java:44)
   at 
 org.apache.sling.ide.impl.vlt.VltRepository.connect(VltRepository.java:65)
   at 
 org.apache.sling.ide.impl.vlt.VltRepositoryFactory.connectRepository(VltRepositoryFactory.java:69)
   at 
 org.apache.sling.ide.eclipse.core.ServerUtil.connectRepository(ServerUtil.java:154)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.start(SlingLaunchpadBehaviour.java:88)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadLaunchConfigurationDelegate.launch(SlingLaunchpadLaunchConfigurationDelegate.java:45)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:700)
   at 
 org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3541)
   at 
 org.eclipse.wst.server.core.internal.Server.startImpl(Server.java:3477)
   at 
 org.eclipse.wst.server.core.internal.Server$StartJob.run(Server.java:367)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53){code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3639) Changing node types to/from sling:Folder within .content.xml fails

2014-07-07 Thread Robert Munteanu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053483#comment-14053483
 ] 

Robert Munteanu commented on SLING-3639:


Ah, I see. So the point would be something like 'when processing a deleted 
folder, ensure that it does not have a covering aggregate somewhere higher in 
the filesystem', right?

 Changing node types to/from sling:Folder within .content.xml fails
 --

 Key: SLING-3639
 URL: https://issues.apache.org/jira/browse/SLING-3639
 Project: Sling
  Issue Type: Bug
  Components: IDE
Reporter: Stefan Egli
Assignee: Robert Munteanu
 Fix For: Sling Eclipse IDE 1.0.2


 When changing the type of a node serialized into a .content.xml to/from 
 sling:Folder, various exceptions occur.
 This ticket is to have a reference between the various bugfixes related to 
 this.
 An earlier fix likely related to this is : http://svn.apache.org/r156
 Consider the following structure:
 {code}
 grandparent [nt:unstructured]
 \- parent [nt:unstructured]
  |- child1 [nt:unstructured]
  \- child2 [nt:unstructured]
 {code}
 initially the structure is serialized into one:
 {code}
 grandparent/.content.xml
 {code}
 If child2 is changed to sling:Folder, the content is published and 
 re-imported, the underlying vault serialization looks as follows:
 {code}
 grandparent/.content.xml
 grandparent/parent/child2/.content.xml
 {code}
 Changing child2 back to nt:unstructured results in:
 {code}
 [June 4, 2014 10:52:04 AM CEST] AddOrUpdateNodeCommand - 
 /content/okapp/grandparent/parent : JcrResult[ success:true] (53 ms)
 [June 4, 2014 10:52:39 AM CEST] AddOrUpdateNodeCommand - 
 /content/okapp/grandparent/parent/child2 : JcrResult[ success:false, 
 exception: org.apache.sling.ide.transport.RepositoryException - 
 javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type] (48 ms)
 org.apache.sling.ide.transport.RepositoryException: 
 javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type
   at org.apache.sling.ide.impl.vlt.JcrResult.failure(JcrResult.java:33)
   at org.apache.sling.ide.impl.vlt.JcrCommand.execute(JcrCommand.java:62)
   at 
 org.apache.sling.ide.transport.TracingCommand.execute(TracingCommand.java:43)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.execute(SlingLaunchpadBehaviour.java:364)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishContentModule(SlingLaunchpadBehaviour.java:330)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishModule(SlingLaunchpadBehaviour.java:182)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1091)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1183)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:987)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
   at 
 org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3154)
   at 
 org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
 Caused by: javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at 
 org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:69)
   at 
 org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:51)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(RepositoryServiceImpl.java:611)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.access$600(RepositoryServiceImpl.java:547)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.submit(RepositoryServiceImpl.java:452)
   at 
 org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.execute(WorkspaceManager.java:858)
   at 
 

[jira] [Commented] (SLING-3639) Changing node types to/from sling:Folder within .content.xml fails

2014-07-07 Thread Stefan Egli (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053484#comment-14053484
 ] 

Stefan Egli commented on SLING-3639:


exactly

 Changing node types to/from sling:Folder within .content.xml fails
 --

 Key: SLING-3639
 URL: https://issues.apache.org/jira/browse/SLING-3639
 Project: Sling
  Issue Type: Bug
  Components: IDE
Reporter: Stefan Egli
Assignee: Robert Munteanu
 Fix For: Sling Eclipse IDE 1.0.2


 When changing the type of a node serialized into a .content.xml to/from 
 sling:Folder, various exceptions occur.
 This ticket is to have a reference between the various bugfixes related to 
 this.
 An earlier fix likely related to this is : http://svn.apache.org/r156
 Consider the following structure:
 {code}
 grandparent [nt:unstructured]
 \- parent [nt:unstructured]
  |- child1 [nt:unstructured]
  \- child2 [nt:unstructured]
 {code}
 initially the structure is serialized into one:
 {code}
 grandparent/.content.xml
 {code}
 If child2 is changed to sling:Folder, the content is published and 
 re-imported, the underlying vault serialization looks as follows:
 {code}
 grandparent/.content.xml
 grandparent/parent/child2/.content.xml
 {code}
 Changing child2 back to nt:unstructured results in:
 {code}
 [June 4, 2014 10:52:04 AM CEST] AddOrUpdateNodeCommand - 
 /content/okapp/grandparent/parent : JcrResult[ success:true] (53 ms)
 [June 4, 2014 10:52:39 AM CEST] AddOrUpdateNodeCommand - 
 /content/okapp/grandparent/parent/child2 : JcrResult[ success:false, 
 exception: org.apache.sling.ide.transport.RepositoryException - 
 javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type] (48 ms)
 org.apache.sling.ide.transport.RepositoryException: 
 javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type
   at org.apache.sling.ide.impl.vlt.JcrResult.failure(JcrResult.java:33)
   at org.apache.sling.ide.impl.vlt.JcrCommand.execute(JcrCommand.java:62)
   at 
 org.apache.sling.ide.transport.TracingCommand.execute(TracingCommand.java:43)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.execute(SlingLaunchpadBehaviour.java:364)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishContentModule(SlingLaunchpadBehaviour.java:330)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishModule(SlingLaunchpadBehaviour.java:182)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1091)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1183)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:987)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
   at 
 org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3154)
   at 
 org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
 Caused by: javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at 
 org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:69)
   at 
 org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:51)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(RepositoryServiceImpl.java:611)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.access$600(RepositoryServiceImpl.java:547)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.submit(RepositoryServiceImpl.java:452)
   at 
 org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.execute(WorkspaceManager.java:858)
   at 
 org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.access$500(WorkspaceManager.java:817)
   at 
 org.apache.jackrabbit.jcr2spi.WorkspaceManager.execute(WorkspaceManager.java:620)
   at 
 

Re: Eclipse stuff, source vs. convenience binaries

2014-07-07 Thread Robert Munteanu
Hi.

On Mon, Jul 7, 2014 at 12:25 PM, Bertrand Delacretaz
bdelacre...@apache.org wrote:
 Hi,

 Unless I'm mistaken, I see only binaries at
 https://dist.apache.org/repos/dist/release/sling/eclipse/1.0.0/ - did
 we release the source code as well, and where?

Hm, you're right. The 'release' artifact was the p2 update site at
[1], but that only contains binary artifacts as well. The source jars
are only in Nexus for now.

I can see several ways out:

1. upload all jars + source jars ; this has the slight disadvantage of
polluting the repo with 15+ new jars. One way to alleviate that is to
place them under sling/eclipse ( but then we probably need to
restructure sling/eclipse a bit ) . It's also worth mentioning that
due to the way Eclipse plug-ins are built, one single source can not
be built standalone, or at least not trivially. The way to build them
is to use the reactor build.

2. Upload a source bundle of the whole project, which can then be used
to rebuild the project using mvn package.

 Also, I think the http://apache.org/dist/sling/eclipse/1.0.0/ HTML
 page should include a disclaimer that what's there are only
 convenience binaries, and that people should build them from source if
 they want the official Apache release. Maybe point to a new page on
 our website that explains this better and that can be reused for
 similar such releases?

Agree, I'll update the template.

As for the documentation, I would add an 'Installation' section to [2]
and reference it from the update site.

Robert


 -Bertrand

[1]: 
https://dist.apache.org/repos/dist/release/sling/org.apache.sling.ide.p2update-1.0.0.zip
[2]: https://sling.apache.org/documentation/development/ide-tooling.html


[jira] [Created] (SLING-3741) When processing deleted folders, check for a covering aggregate higher in the filesytem hierarchy

2014-07-07 Thread Robert Munteanu (JIRA)
Robert Munteanu created SLING-3741:
--

 Summary: When processing deleted folders, check for a covering 
aggregate higher in the filesytem hierarchy
 Key: SLING-3741
 URL: https://issues.apache.org/jira/browse/SLING-3741
 Project: Sling
  Issue Type: Bug
  Components: IDE
Affects Versions: Sling Eclipse IDE 1.0.0
Reporter: Robert Munteanu
 Fix For: Sling Eclipse IDE 1.0.2


Minimal scenario reported by [~egli]

* Create:
{code}
grandparent [nt:unstructured]
\- parent [nt:unstructured]
 |- child1 [nt:unstructured]
 \- child2 [nt:unstructured]
{code}
* Then change child2 to sling:Folder
* Changing child2 back to nt:unstructured then causes the deletion of parent 
(since I delete parent/child2 and parent folders explicitly, as they are no 
longer needed)




--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3639) Changing node types to/from sling:Folder within .content.xml fails

2014-07-07 Thread Robert Munteanu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053497#comment-14053497
 ] 

Robert Munteanu commented on SLING-3639:


Thanks for confirming. Filed SLING-3741 and linked it to this one as a blocker.

 Changing node types to/from sling:Folder within .content.xml fails
 --

 Key: SLING-3639
 URL: https://issues.apache.org/jira/browse/SLING-3639
 Project: Sling
  Issue Type: Bug
  Components: IDE
Reporter: Stefan Egli
Assignee: Robert Munteanu
 Fix For: Sling Eclipse IDE 1.0.2


 When changing the type of a node serialized into a .content.xml to/from 
 sling:Folder, various exceptions occur.
 This ticket is to have a reference between the various bugfixes related to 
 this.
 An earlier fix likely related to this is : http://svn.apache.org/r156
 Consider the following structure:
 {code}
 grandparent [nt:unstructured]
 \- parent [nt:unstructured]
  |- child1 [nt:unstructured]
  \- child2 [nt:unstructured]
 {code}
 initially the structure is serialized into one:
 {code}
 grandparent/.content.xml
 {code}
 If child2 is changed to sling:Folder, the content is published and 
 re-imported, the underlying vault serialization looks as follows:
 {code}
 grandparent/.content.xml
 grandparent/parent/child2/.content.xml
 {code}
 Changing child2 back to nt:unstructured results in:
 {code}
 [June 4, 2014 10:52:04 AM CEST] AddOrUpdateNodeCommand - 
 /content/okapp/grandparent/parent : JcrResult[ success:true] (53 ms)
 [June 4, 2014 10:52:39 AM CEST] AddOrUpdateNodeCommand - 
 /content/okapp/grandparent/parent/child2 : JcrResult[ success:false, 
 exception: org.apache.sling.ide.transport.RepositoryException - 
 javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type] (48 ms)
 org.apache.sling.ide.transport.RepositoryException: 
 javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type
   at org.apache.sling.ide.impl.vlt.JcrResult.failure(JcrResult.java:33)
   at org.apache.sling.ide.impl.vlt.JcrCommand.execute(JcrCommand.java:62)
   at 
 org.apache.sling.ide.transport.TracingCommand.execute(TracingCommand.java:43)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.execute(SlingLaunchpadBehaviour.java:364)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishContentModule(SlingLaunchpadBehaviour.java:330)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishModule(SlingLaunchpadBehaviour.java:182)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1091)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1183)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:987)
   at 
 org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
   at 
 org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3154)
   at 
 org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
 Caused by: javax.jcr.nodetype.ConstraintViolationException: node 
 /content/okapp/grandparent/parent/child2: no applicable definition found in 
 parent node's node type
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at 
 org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:69)
   at 
 org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:51)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(RepositoryServiceImpl.java:611)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.access$600(RepositoryServiceImpl.java:547)
   at 
 org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.submit(RepositoryServiceImpl.java:452)
   at 
 org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.execute(WorkspaceManager.java:858)
   at 
 org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.access$500(WorkspaceManager.java:817)
   at 
 

Jenkins build is still unstable: sling-trunk-1.6 » Apache Sling Launchpad Testing #2263

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.6/org.apache.sling$org.apache.sling.launchpad.testing/2263/



[jira] [Commented] (SLING-3739) No repository found at ... : ClassNotFoundException org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory

2014-07-07 Thread Robert Munteanu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053503#comment-14053503
 ] 

Robert Munteanu commented on SLING-3739:


The original stack trace shows that class loading is done via Plexus 
Classworlds. Not sure whether this is fine or not, but it does stand out.

{code}javax.jcr.RepositoryException: java.lang.ClassNotFoundException: 
org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
at 
org.apache.jackrabbit.client.RepositoryFactoryImpl.getRepository(RepositoryFactoryImpl.java:71)
at 
org.apache.jackrabbit.vault.davex.DAVExRepositoryFactory.createRepository(DAVExRepositoryFactory.java:124)
at 
org.apache.sling.ide.jcr.RepositoryUtils.getRepositoryAddress(RepositoryUtils.java:71)
at 
org.apache.sling.ide.jcr.RepositoryUtils.getRepository(RepositoryUtils.java:44)
at 
org.apache.sling.ide.impl.vlt.VltRepository.connect(VltRepository.java:65)
at 
org.apache.sling.ide.impl.vlt.VltRepositoryFactory.connectRepository(VltRepositoryFactory.java:69)
at 
org.apache.sling.ide.eclipse.core.ServerUtil.connectRepository(ServerUtil.java:154)
at 
org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.start(SlingLaunchpadBehaviour.java:88)
at 
org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadLaunchConfigurationDelegate.launch(SlingLaunchpadLaunchConfigurationDelegate.java:45)
at 
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
at 
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
at 
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:700)
at 
org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3541)
at 
org.eclipse.wst.server.core.internal.Server.startImpl(Server.java:3477)
at 
org.eclipse.wst.server.core.internal.Server$StartJob.run(Server.java:367)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: 
org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
at 
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at 
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at 
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at 
org.apache.jackrabbit.client.RepositoryFactoryImpl.getRepository(RepositoryFactoryImpl.java:65)
... 15 more{code}

 No repository found at ... : ClassNotFoundException 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 --

 Key: SLING-3739
 URL: https://issues.apache.org/jira/browse/SLING-3739
 Project: Sling
  Issue Type: Bug
  Components: IDE
Affects Versions: Sling Eclipse IDE 1.0.0
Reporter: Robert Munteanu
Priority: Critical
 Fix For: Sling Eclipse IDE 1.0.2


 This seems to be a rehash of SLING-3647. When starting up a server on a 
 freshly launched Eclipse instance I sometimes get this error
 {code}java.lang.IllegalArgumentException: No repository found at 
 http://localhost:4504/
 http://localhost:4504/server/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 http://localhost:4504/crx/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepositoryAddress(RepositoryUtils.java:94)
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepository(RepositoryUtils.java:44)
   at 
 org.apache.sling.ide.impl.vlt.VltRepository.connect(VltRepository.java:65)
   at 
 org.apache.sling.ide.impl.vlt.VltRepositoryFactory.connectRepository(VltRepositoryFactory.java:69)
   at 
 org.apache.sling.ide.eclipse.core.ServerUtil.connectRepository(ServerUtil.java:154)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.start(SlingLaunchpadBehaviour.java:88)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadLaunchConfigurationDelegate.launch(SlingLaunchpadLaunchConfigurationDelegate.java:45)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:700)
   at 
 org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3541)
   at 
 

Jenkins build is still unstable: sling-trunk-1.6 #2263

2014-07-07 Thread Apache Jenkins Server
See https://builds.apache.org/job/sling-trunk-1.6/changes



[jira] [Commented] (SLING-3739) No repository found at ... : ClassNotFoundException org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory

2014-07-07 Thread Robert Munteanu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053506#comment-14053506
 ] 

Robert Munteanu commented on SLING-3739:


The {{RepositoryFactoryImpl}} class make use ContextClassLoader. I suspect that 
this can be the cause of erratic behaviour.

{code}
Class? repositoryFactoryClass = 
Class.forName(repositoryFactoryName, true,
Thread.currentThread().getContextClassLoader());

repositoryFactory = repositoryFactoryClass.newInstance();
{code}

 No repository found at ... : ClassNotFoundException 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 --

 Key: SLING-3739
 URL: https://issues.apache.org/jira/browse/SLING-3739
 Project: Sling
  Issue Type: Bug
  Components: IDE
Affects Versions: Sling Eclipse IDE 1.0.0
Reporter: Robert Munteanu
Priority: Critical
 Fix For: Sling Eclipse IDE 1.0.2


 This seems to be a rehash of SLING-3647. When starting up a server on a 
 freshly launched Eclipse instance I sometimes get this error
 {code}java.lang.IllegalArgumentException: No repository found at 
 http://localhost:4504/
 http://localhost:4504/server/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 http://localhost:4504/crx/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepositoryAddress(RepositoryUtils.java:94)
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepository(RepositoryUtils.java:44)
   at 
 org.apache.sling.ide.impl.vlt.VltRepository.connect(VltRepository.java:65)
   at 
 org.apache.sling.ide.impl.vlt.VltRepositoryFactory.connectRepository(VltRepositoryFactory.java:69)
   at 
 org.apache.sling.ide.eclipse.core.ServerUtil.connectRepository(ServerUtil.java:154)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.start(SlingLaunchpadBehaviour.java:88)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadLaunchConfigurationDelegate.launch(SlingLaunchpadLaunchConfigurationDelegate.java:45)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:700)
   at 
 org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3541)
   at 
 org.eclipse.wst.server.core.internal.Server.startImpl(Server.java:3477)
   at 
 org.eclipse.wst.server.core.internal.Server$StartJob.run(Server.java:367)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53){code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3739) No repository found at ... : ClassNotFoundException org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory

2014-07-07 Thread Robert Munteanu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053513#comment-14053513
 ] 

Robert Munteanu commented on SLING-3739:


Bingo! When the build works, the ClassLoader is 
{noformat}org.eclipse.core.runtime.internal.adaptor.ContextFinder@5cbe48ab{noformat}
 , but when it does not, the ClassLoader is 
{noformat}ClassRealm[projectcom.example:test002.components:0.0.1-SNAPSHOT, 
parent: ClassRealm[maven.api, parent: null]]{noformat} .

 No repository found at ... : ClassNotFoundException 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 --

 Key: SLING-3739
 URL: https://issues.apache.org/jira/browse/SLING-3739
 Project: Sling
  Issue Type: Bug
  Components: IDE
Affects Versions: Sling Eclipse IDE 1.0.0
Reporter: Robert Munteanu
Priority: Critical
 Fix For: Sling Eclipse IDE 1.0.2


 This seems to be a rehash of SLING-3647. When starting up a server on a 
 freshly launched Eclipse instance I sometimes get this error
 {code}java.lang.IllegalArgumentException: No repository found at 
 http://localhost:4504/
 http://localhost:4504/server/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 http://localhost:4504/crx/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepositoryAddress(RepositoryUtils.java:94)
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepository(RepositoryUtils.java:44)
   at 
 org.apache.sling.ide.impl.vlt.VltRepository.connect(VltRepository.java:65)
   at 
 org.apache.sling.ide.impl.vlt.VltRepositoryFactory.connectRepository(VltRepositoryFactory.java:69)
   at 
 org.apache.sling.ide.eclipse.core.ServerUtil.connectRepository(ServerUtil.java:154)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.start(SlingLaunchpadBehaviour.java:88)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadLaunchConfigurationDelegate.launch(SlingLaunchpadLaunchConfigurationDelegate.java:45)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:700)
   at 
 org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3541)
   at 
 org.eclipse.wst.server.core.internal.Server.startImpl(Server.java:3477)
   at 
 org.eclipse.wst.server.core.internal.Server$StartJob.run(Server.java:367)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53){code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: Eclipse stuff, source vs. convenience binaries

2014-07-07 Thread Bertrand Delacretaz
On Mon, Jul 7, 2014 at 11:36 AM, Robert Munteanu romb...@apache.org wrote:
 I can see several ways out:..

 2. Upload a source bundle of the whole project, which can then be used
 to rebuild the project using mvn package

Looks like the best way to me, but is that the source bundle on which
we voted on for the release?

If yes, if you can put it in
https://dist.apache.org/repos/dist/release/sling/eclipse/1.0.0/ in a
way that doesn't disturb Eclipse that's probably best?

And add a link to that file to the
http://apache.org/dist/sling/eclipse/1.0.0/index.html page with a
recommendation to build from source?

-Bertrand


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-07-07 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053565#comment-14053565
 ] 

Konrad Windszus commented on SLING-3499:


Hi [~justinedelson], now that 1.0.6 is released, would it be possible to merge 
my documentation changes?
Thanks a lot!

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus
Assignee: Justin Edelson
 Fix For: Sling Models Implementation 1.0.6, Sling Models API 1.0.2

 Attachments: SLING-3499-Documentation-v1.patch, 
 SLING-3499-Documentation-v2.patch


 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3739) No repository found at ... : ClassNotFoundException org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory

2014-07-07 Thread Robert Munteanu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053583#comment-14053583
 ] 

Robert Munteanu commented on SLING-3739:


See https://dev.eclipse.org/mhonarc/lists/m2e-dev/msg01661.html 

 No repository found at ... : ClassNotFoundException 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 --

 Key: SLING-3739
 URL: https://issues.apache.org/jira/browse/SLING-3739
 Project: Sling
  Issue Type: Bug
  Components: IDE
Affects Versions: Sling Eclipse IDE 1.0.0
Reporter: Robert Munteanu
Priority: Critical
 Fix For: Sling Eclipse IDE 1.0.2


 This seems to be a rehash of SLING-3647. When starting up a server on a 
 freshly launched Eclipse instance I sometimes get this error
 {code}java.lang.IllegalArgumentException: No repository found at 
 http://localhost:4504/
 http://localhost:4504/server/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
 http://localhost:4504/crx/-/jcr:root : java.lang.ClassNotFoundException: 
 org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepositoryAddress(RepositoryUtils.java:94)
   at 
 org.apache.sling.ide.jcr.RepositoryUtils.getRepository(RepositoryUtils.java:44)
   at 
 org.apache.sling.ide.impl.vlt.VltRepository.connect(VltRepository.java:65)
   at 
 org.apache.sling.ide.impl.vlt.VltRepositoryFactory.connectRepository(VltRepositoryFactory.java:69)
   at 
 org.apache.sling.ide.eclipse.core.ServerUtil.connectRepository(ServerUtil.java:154)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.start(SlingLaunchpadBehaviour.java:88)
   at 
 org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadLaunchConfigurationDelegate.launch(SlingLaunchpadLaunchConfigurationDelegate.java:45)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
   at 
 org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:700)
   at 
 org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3541)
   at 
 org.eclipse.wst.server.core.internal.Server.startImpl(Server.java:3477)
   at 
 org.eclipse.wst.server.core.internal.Server$StartJob.run(Server.java:367)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53){code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3737) Instance Sling Identifier may be randomly reset on restart

2014-07-07 Thread Felix Meschberger (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053588#comment-14053588
 ] 

Felix Meschberger commented on SLING-3737:
--

Nice catch indeed.

Yet, some asks for changes:

* Please don't make the methods and classes protected. Protected methods are 
part of a class' API. Rather use package private (default) modifier if you need 
the methods in the tests (and maybe add some non-JavaDoc comment as to why 
these are not private, as they technically should.
* You might want to use FileUtils.readFileToString(File, String encoding) 
instead to also immediately do the conversion.

 Instance Sling Identifier may be randomly reset on restart
 --

 Key: SLING-3737
 URL: https://issues.apache.org/jira/browse/SLING-3737
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Settings 1.3.0
Reporter: Timothee Maret
 Attachments: SLING-3737.diff


 In our Setup, we experience instances changing their Sling identifier upon 
 restart.
 We have experienced only a few occurrences of this issue, but the effect is 
 really bad, turning the services relying on the Sling Identifier into 
 unexpected state (for instance Sling discovery service).
 We have checked that the sling.id.file was present before the issue occurred.
 We also checked that the value in this file was valid (36 byte long UUID).
 Despite having a valid sling.id.file file, the instance sometimes reset the 
 Sling ID upon restart.
 Looking at the latest code in 
 org.apache.sling.settings.impl.SlingSettingsServiceImpl#readSlingId
 it seems there is a bug in the way the sling id is read from the file 
 sling.id.file.
 {code}
 private String readSlingId(final File idFile) {
 if (idFile.exists()  idFile.length() = 36) {
 FileInputStream fin = null;
 try {
 fin = new FileInputStream(idFile);
 final byte[] rawBytes = new byte[36];
 if (fin.read(rawBytes) == 36) {
 final String rawString = new String(rawBytes, 
 ISO-8859-1);
 // roundtrip to ensure correct format of UUID value
 final String id = UUID.fromString(rawString).toString();
 logger.debug(Got Sling ID {} from file {}, id, idFile);
 return id;
 }
 } catch (final Throwable t) {
 logger.error(Failed reading UUID from id file  + idFile
 + , creating new id, t);
 } finally {
 if (fin != null) {
 try {
 fin.close();
 } catch (IOException ignore) {
 }
 }
 }
 }
 return null;
 }
 {code}
 In the line
 {code}
 if (fin.read(rawBytes) == 36) {
 {code}
 The code miss uses the java.io.FileInputStream#read API.
 {code}
 /**
  * Reads up to codeb.length/code bytes of data from this input
  * stream into an array of bytes. This method blocks until some input
  * is available.
  *
  * @param  b   the buffer into which the data is read.
  * @return the total number of bytes read into the buffer, or
  * code-1/code if there is no more data because the end of
  * the file has been reached.
  * @exception  IOException  if an I/O error occurs.
  */
 {code}
 The API stipulates that the method blocks until if finds *some* data.
 This is a common pattern with Java IO APIs, and indeed, the method may return 
 with only one byte read even though the end of the stream was not reached.
 If this is the case, the current logic will treat the slingId as invalid and 
 generate a new one.
 A way to fix that is to read the sling id file completely, for instance using 
 the org.apache.commons.io.FileUtils API
 We are running on CentOS 6.2, JDK 1.7.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3737) Instance Sling Identifier may be randomly reset on restart

2014-07-07 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053597#comment-14053597
 ] 

Chetan Mehrotra commented on SLING-3737:


bq. Nice catch indeed.
+1

One more thing. The Sling Settings Service bundle starts at level 1 where as 
currently commons-io starts at level 5. So if possible copy the logic (or 
embed) and avoid adding new dependency as this particular bundle starts at very 
early stage

 Instance Sling Identifier may be randomly reset on restart
 --

 Key: SLING-3737
 URL: https://issues.apache.org/jira/browse/SLING-3737
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Settings 1.3.0
Reporter: Timothee Maret
 Attachments: SLING-3737.diff


 In our Setup, we experience instances changing their Sling identifier upon 
 restart.
 We have experienced only a few occurrences of this issue, but the effect is 
 really bad, turning the services relying on the Sling Identifier into 
 unexpected state (for instance Sling discovery service).
 We have checked that the sling.id.file was present before the issue occurred.
 We also checked that the value in this file was valid (36 byte long UUID).
 Despite having a valid sling.id.file file, the instance sometimes reset the 
 Sling ID upon restart.
 Looking at the latest code in 
 org.apache.sling.settings.impl.SlingSettingsServiceImpl#readSlingId
 it seems there is a bug in the way the sling id is read from the file 
 sling.id.file.
 {code}
 private String readSlingId(final File idFile) {
 if (idFile.exists()  idFile.length() = 36) {
 FileInputStream fin = null;
 try {
 fin = new FileInputStream(idFile);
 final byte[] rawBytes = new byte[36];
 if (fin.read(rawBytes) == 36) {
 final String rawString = new String(rawBytes, 
 ISO-8859-1);
 // roundtrip to ensure correct format of UUID value
 final String id = UUID.fromString(rawString).toString();
 logger.debug(Got Sling ID {} from file {}, id, idFile);
 return id;
 }
 } catch (final Throwable t) {
 logger.error(Failed reading UUID from id file  + idFile
 + , creating new id, t);
 } finally {
 if (fin != null) {
 try {
 fin.close();
 } catch (IOException ignore) {
 }
 }
 }
 }
 return null;
 }
 {code}
 In the line
 {code}
 if (fin.read(rawBytes) == 36) {
 {code}
 The code miss uses the java.io.FileInputStream#read API.
 {code}
 /**
  * Reads up to codeb.length/code bytes of data from this input
  * stream into an array of bytes. This method blocks until some input
  * is available.
  *
  * @param  b   the buffer into which the data is read.
  * @return the total number of bytes read into the buffer, or
  * code-1/code if there is no more data because the end of
  * the file has been reached.
  * @exception  IOException  if an I/O error occurs.
  */
 {code}
 The API stipulates that the method blocks until if finds *some* data.
 This is a common pattern with Java IO APIs, and indeed, the method may return 
 with only one byte read even though the end of the stream was not reached.
 If this is the case, the current logic will treat the slingId as invalid and 
 generate a new one.
 A way to fix that is to read the sling id file completely, for instance using 
 the org.apache.commons.io.FileUtils API
 We are running on CentOS 6.2, JDK 1.7.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Jenkins build became unstable: sling-trunk-1.7 » Apache Sling SLF4J Implementation (Logback) #638

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.7/org.apache.sling$org.apache.sling.commons.log/638/



Jenkins build is still unstable: sling-trunk-1.7 » Apache Sling Launchpad Testing #638

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.7/org.apache.sling$org.apache.sling.launchpad.testing/638/



Jenkins build is still unstable: sling-trunk-1.7 #638

2014-07-07 Thread Apache Jenkins Server
See https://builds.apache.org/job/sling-trunk-1.7/changes



Jenkins build became unstable: sling-trunk-1.6 » Apache Sling Sample Integration Tests #2264

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.6/org.apache.sling$org.apache.sling.testing.samples.integrationtests/2264/



Jenkins build is still unstable: sling-trunk-1.6 » Apache Sling Launchpad Testing #2264

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.6/org.apache.sling$org.apache.sling.launchpad.testing/2264/



Jenkins build is still unstable: sling-trunk-1.6 #2264

2014-07-07 Thread Apache Jenkins Server
See https://builds.apache.org/job/sling-trunk-1.6/changes



[jira] [Commented] (SLING-3737) Instance Sling Identifier may be randomly reset on restart

2014-07-07 Thread Timothee Maret (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053614#comment-14053614
 ] 

Timothee Maret commented on SLING-3737:
---

bq. Please don't make the methods and classes protected.

Good point, will change that in the patch.

[~fmeschbe], as suggested by [~chetanm] I think it would make sense to not 
leverage an external dependency.
I will provide a patch using classes available in the JRE.

 Instance Sling Identifier may be randomly reset on restart
 --

 Key: SLING-3737
 URL: https://issues.apache.org/jira/browse/SLING-3737
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Settings 1.3.0
Reporter: Timothee Maret
 Attachments: SLING-3737.diff


 In our Setup, we experience instances changing their Sling identifier upon 
 restart.
 We have experienced only a few occurrences of this issue, but the effect is 
 really bad, turning the services relying on the Sling Identifier into 
 unexpected state (for instance Sling discovery service).
 We have checked that the sling.id.file was present before the issue occurred.
 We also checked that the value in this file was valid (36 byte long UUID).
 Despite having a valid sling.id.file file, the instance sometimes reset the 
 Sling ID upon restart.
 Looking at the latest code in 
 org.apache.sling.settings.impl.SlingSettingsServiceImpl#readSlingId
 it seems there is a bug in the way the sling id is read from the file 
 sling.id.file.
 {code}
 private String readSlingId(final File idFile) {
 if (idFile.exists()  idFile.length() = 36) {
 FileInputStream fin = null;
 try {
 fin = new FileInputStream(idFile);
 final byte[] rawBytes = new byte[36];
 if (fin.read(rawBytes) == 36) {
 final String rawString = new String(rawBytes, 
 ISO-8859-1);
 // roundtrip to ensure correct format of UUID value
 final String id = UUID.fromString(rawString).toString();
 logger.debug(Got Sling ID {} from file {}, id, idFile);
 return id;
 }
 } catch (final Throwable t) {
 logger.error(Failed reading UUID from id file  + idFile
 + , creating new id, t);
 } finally {
 if (fin != null) {
 try {
 fin.close();
 } catch (IOException ignore) {
 }
 }
 }
 }
 return null;
 }
 {code}
 In the line
 {code}
 if (fin.read(rawBytes) == 36) {
 {code}
 The code miss uses the java.io.FileInputStream#read API.
 {code}
 /**
  * Reads up to codeb.length/code bytes of data from this input
  * stream into an array of bytes. This method blocks until some input
  * is available.
  *
  * @param  b   the buffer into which the data is read.
  * @return the total number of bytes read into the buffer, or
  * code-1/code if there is no more data because the end of
  * the file has been reached.
  * @exception  IOException  if an I/O error occurs.
  */
 {code}
 The API stipulates that the method blocks until if finds *some* data.
 This is a common pattern with Java IO APIs, and indeed, the method may return 
 with only one byte read even though the end of the stream was not reached.
 If this is the case, the current logic will treat the slingId as invalid and 
 generate a new one.
 A way to fix that is to read the sling id file completely, for instance using 
 the org.apache.commons.io.FileUtils API
 We are running on CentOS 6.2, JDK 1.7.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: adaptTo and results ....

2014-07-07 Thread Justin Edelson
Hi,

On Thu, Jul 3, 2014 at 3:07 PM, Alexander Klimetschek
aklim...@adobe.com wrote:
 On 03.07.2014, at 13:58, Justin Edelson jus...@justinedelson.com wrote:

 It won't work :) This is a hugely non-backwards compatible change. It
 happens to be binary compatible, but it is not semantically compatible
 (which is in some ways just as important). Callers of adaptTo() assume
 (because we have told them to assume) that null will be returned if
 the adaptation can't be done. We can't now start throwing exceptions.
 Callers won't expect this.

 There is a conflict with the other stated problem: that most callers don't 
 expect null either :) So if we change something, this will have an effect on 
 at least some callers either way, unless we add a new method with a different 
 semantic.

 But I'd say this is just adding complexity for no notable benefit. And just 
 improving the logging in case of exceptions in AdpaterFactories and 
 Adaptables or that static adaptOrThrow helper should be enough.

 Maybe some actual real world cases would help (i.e. no Foo.class 
 adaptations :). The only one I see is the Sling Models validation case as 
 originally outlined here [1] - but could you elaborate? I probably miss the 
 knowledge about sling models to see the issue.

Here's a sightly more real world case... let's say you have a call like this:

Comment comment = resource.adaptTo(Comment.class);

And for a Resource to be successfully adapted to a Comment, it must
satisfy two criteria:
1) The resource type must be myco/comment
2) It must have a property called commentType (OK, this part isn't
so real world).

Right now, the caller has no way of knowing which of these critera
wasn't met. That's IMHO the crux of this request - to provide a way
for AdapterFactories to surface the failure reason back to the caller.

Regards,
Justin



 [1] http://markmail.org/message/lcujo4flwek3liez

 Cheers,
 Alex


[jira] [Commented] (SLING-3737) Instance Sling Identifier may be randomly reset on restart

2014-07-07 Thread Felix Meschberger (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053623#comment-14053623
 ] 

Felix Meschberger commented on SLING-3737:
--

[~marett] DataInputStream.readFully might do the trick ?

 Instance Sling Identifier may be randomly reset on restart
 --

 Key: SLING-3737
 URL: https://issues.apache.org/jira/browse/SLING-3737
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Settings 1.3.0
Reporter: Timothee Maret
 Attachments: SLING-3737.diff


 In our Setup, we experience instances changing their Sling identifier upon 
 restart.
 We have experienced only a few occurrences of this issue, but the effect is 
 really bad, turning the services relying on the Sling Identifier into 
 unexpected state (for instance Sling discovery service).
 We have checked that the sling.id.file was present before the issue occurred.
 We also checked that the value in this file was valid (36 byte long UUID).
 Despite having a valid sling.id.file file, the instance sometimes reset the 
 Sling ID upon restart.
 Looking at the latest code in 
 org.apache.sling.settings.impl.SlingSettingsServiceImpl#readSlingId
 it seems there is a bug in the way the sling id is read from the file 
 sling.id.file.
 {code}
 private String readSlingId(final File idFile) {
 if (idFile.exists()  idFile.length() = 36) {
 FileInputStream fin = null;
 try {
 fin = new FileInputStream(idFile);
 final byte[] rawBytes = new byte[36];
 if (fin.read(rawBytes) == 36) {
 final String rawString = new String(rawBytes, 
 ISO-8859-1);
 // roundtrip to ensure correct format of UUID value
 final String id = UUID.fromString(rawString).toString();
 logger.debug(Got Sling ID {} from file {}, id, idFile);
 return id;
 }
 } catch (final Throwable t) {
 logger.error(Failed reading UUID from id file  + idFile
 + , creating new id, t);
 } finally {
 if (fin != null) {
 try {
 fin.close();
 } catch (IOException ignore) {
 }
 }
 }
 }
 return null;
 }
 {code}
 In the line
 {code}
 if (fin.read(rawBytes) == 36) {
 {code}
 The code miss uses the java.io.FileInputStream#read API.
 {code}
 /**
  * Reads up to codeb.length/code bytes of data from this input
  * stream into an array of bytes. This method blocks until some input
  * is available.
  *
  * @param  b   the buffer into which the data is read.
  * @return the total number of bytes read into the buffer, or
  * code-1/code if there is no more data because the end of
  * the file has been reached.
  * @exception  IOException  if an I/O error occurs.
  */
 {code}
 The API stipulates that the method blocks until if finds *some* data.
 This is a common pattern with Java IO APIs, and indeed, the method may return 
 with only one byte read even though the end of the stream was not reached.
 If this is the case, the current logic will treat the slingId as invalid and 
 generate a new one.
 A way to fix that is to read the sling id file completely, for instance using 
 the org.apache.commons.io.FileUtils API
 We are running on CentOS 6.2, JDK 1.7.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: adaptTo and results ....

2014-07-07 Thread Carsten Ziegeler
2014-07-07 14:55 GMT+02:00 Justin Edelson jus...@justinedelson.com:



 Here's a sightly more real world case... let's say you have a call like
 this:

 Comment comment = resource.adaptTo(Comment.class);

 And for a Resource to be successfully adapted to a Comment, it must
 satisfy two criteria:
 1) The resource type must be myco/comment
 2) It must have a property called commentType (OK, this part isn't
 so real world).

 Right now, the caller has no way of knowing which of these critera
 wasn't met. That's IMHO the crux of this request - to provide a way
 for AdapterFactories to surface the failure reason back to the caller.


Hmm, this assumes the caller can do something meaningful with it. Given
your example, what could the client do?

Regards
Carsten


 Regards,
 Justin


 
  [1] http://markmail.org/message/lcujo4flwek3liez
 
  Cheers,
  Alex




-- 
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


[jira] [Resolved] (SLING-3641) Refine 'link with editor' behavior with properties view(s)

2014-07-07 Thread Stefan Egli (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Egli resolved SLING-3641.


Resolution: Fixed

implemented a wrapper which plugs the JcrPropertiesView into the standalone 
properties view - hence this ticket can be marked as resolved

 Refine 'link with editor' behavior with properties view(s)
 --

 Key: SLING-3641
 URL: https://issues.apache.org/jira/browse/SLING-3641
 Project: Sling
  Issue Type: Task
  Components: IDE
Reporter: Stefan Egli
Assignee: Stefan Egli
 Fix For: Sling Eclipse IDE 1.0.2


 Currently there is code that automatically brings the standard eclipse 
 Properties view to top, when 'link with editor' is enabled eg in the Project 
 Explorer.
 This might not necessarily be such a good idea, as it doesn't follow the 
 standard UI behavior.
 Instead we should have a 'link with editor and selection' toggle button in 
 the JCR Properties view itself, and have that enabled by default maybe.
 Later, when we merge the JCR Properties view into the standard Eclipse 
 Properties view (SLING-3628), we can review this.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Assigned] (SLING-3628) Consider reusing the properties view for the custom JCR properties view

2014-07-07 Thread Stefan Egli (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-3628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Egli reassigned SLING-3628:
--

Assignee: Stefan Egli

 Consider reusing the properties view for the custom JCR properties view
 ---

 Key: SLING-3628
 URL: https://issues.apache.org/jira/browse/SLING-3628
 Project: Sling
  Issue Type: Improvement
  Components: IDE
Reporter: Robert Munteanu
Assignee: Stefan Egli
Priority: Minor
 Fix For: Sling Eclipse IDE 1.0.2


 The properties view is something which is already known to the Eclipse 
 developers and it would be good to reuse it. At the same time, it remains to 
 be seen whether we can customize it just like we did for the JCR Properties 
 view.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (SLING-3737) Instance Sling Identifier may be randomly reset on restart

2014-07-07 Thread Carsten Ziegeler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-3737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler updated SLING-3737:


Fix Version/s: Settings 1.3.2

 Instance Sling Identifier may be randomly reset on restart
 --

 Key: SLING-3737
 URL: https://issues.apache.org/jira/browse/SLING-3737
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Settings 1.3.0
Reporter: Timothee Maret
Assignee: Carsten Ziegeler
 Fix For: Settings 1.3.2

 Attachments: SLING-3737.diff


 In our Setup, we experience instances changing their Sling identifier upon 
 restart.
 We have experienced only a few occurrences of this issue, but the effect is 
 really bad, turning the services relying on the Sling Identifier into 
 unexpected state (for instance Sling discovery service).
 We have checked that the sling.id.file was present before the issue occurred.
 We also checked that the value in this file was valid (36 byte long UUID).
 Despite having a valid sling.id.file file, the instance sometimes reset the 
 Sling ID upon restart.
 Looking at the latest code in 
 org.apache.sling.settings.impl.SlingSettingsServiceImpl#readSlingId
 it seems there is a bug in the way the sling id is read from the file 
 sling.id.file.
 {code}
 private String readSlingId(final File idFile) {
 if (idFile.exists()  idFile.length() = 36) {
 FileInputStream fin = null;
 try {
 fin = new FileInputStream(idFile);
 final byte[] rawBytes = new byte[36];
 if (fin.read(rawBytes) == 36) {
 final String rawString = new String(rawBytes, 
 ISO-8859-1);
 // roundtrip to ensure correct format of UUID value
 final String id = UUID.fromString(rawString).toString();
 logger.debug(Got Sling ID {} from file {}, id, idFile);
 return id;
 }
 } catch (final Throwable t) {
 logger.error(Failed reading UUID from id file  + idFile
 + , creating new id, t);
 } finally {
 if (fin != null) {
 try {
 fin.close();
 } catch (IOException ignore) {
 }
 }
 }
 }
 return null;
 }
 {code}
 In the line
 {code}
 if (fin.read(rawBytes) == 36) {
 {code}
 The code miss uses the java.io.FileInputStream#read API.
 {code}
 /**
  * Reads up to codeb.length/code bytes of data from this input
  * stream into an array of bytes. This method blocks until some input
  * is available.
  *
  * @param  b   the buffer into which the data is read.
  * @return the total number of bytes read into the buffer, or
  * code-1/code if there is no more data because the end of
  * the file has been reached.
  * @exception  IOException  if an I/O error occurs.
  */
 {code}
 The API stipulates that the method blocks until if finds *some* data.
 This is a common pattern with Java IO APIs, and indeed, the method may return 
 with only one byte read even though the end of the stream was not reached.
 If this is the case, the current logic will treat the slingId as invalid and 
 generate a new one.
 A way to fix that is to read the sling id file completely, for instance using 
 the org.apache.commons.io.FileUtils API
 We are running on CentOS 6.2, JDK 1.7.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Assigned] (SLING-3737) Instance Sling Identifier may be randomly reset on restart

2014-07-07 Thread Carsten Ziegeler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-3737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler reassigned SLING-3737:
---

Assignee: Carsten Ziegeler

 Instance Sling Identifier may be randomly reset on restart
 --

 Key: SLING-3737
 URL: https://issues.apache.org/jira/browse/SLING-3737
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Settings 1.3.0
Reporter: Timothee Maret
Assignee: Carsten Ziegeler
 Fix For: Settings 1.3.2

 Attachments: SLING-3737.diff


 In our Setup, we experience instances changing their Sling identifier upon 
 restart.
 We have experienced only a few occurrences of this issue, but the effect is 
 really bad, turning the services relying on the Sling Identifier into 
 unexpected state (for instance Sling discovery service).
 We have checked that the sling.id.file was present before the issue occurred.
 We also checked that the value in this file was valid (36 byte long UUID).
 Despite having a valid sling.id.file file, the instance sometimes reset the 
 Sling ID upon restart.
 Looking at the latest code in 
 org.apache.sling.settings.impl.SlingSettingsServiceImpl#readSlingId
 it seems there is a bug in the way the sling id is read from the file 
 sling.id.file.
 {code}
 private String readSlingId(final File idFile) {
 if (idFile.exists()  idFile.length() = 36) {
 FileInputStream fin = null;
 try {
 fin = new FileInputStream(idFile);
 final byte[] rawBytes = new byte[36];
 if (fin.read(rawBytes) == 36) {
 final String rawString = new String(rawBytes, 
 ISO-8859-1);
 // roundtrip to ensure correct format of UUID value
 final String id = UUID.fromString(rawString).toString();
 logger.debug(Got Sling ID {} from file {}, id, idFile);
 return id;
 }
 } catch (final Throwable t) {
 logger.error(Failed reading UUID from id file  + idFile
 + , creating new id, t);
 } finally {
 if (fin != null) {
 try {
 fin.close();
 } catch (IOException ignore) {
 }
 }
 }
 }
 return null;
 }
 {code}
 In the line
 {code}
 if (fin.read(rawBytes) == 36) {
 {code}
 The code miss uses the java.io.FileInputStream#read API.
 {code}
 /**
  * Reads up to codeb.length/code bytes of data from this input
  * stream into an array of bytes. This method blocks until some input
  * is available.
  *
  * @param  b   the buffer into which the data is read.
  * @return the total number of bytes read into the buffer, or
  * code-1/code if there is no more data because the end of
  * the file has been reached.
  * @exception  IOException  if an I/O error occurs.
  */
 {code}
 The API stipulates that the method blocks until if finds *some* data.
 This is a common pattern with Java IO APIs, and indeed, the method may return 
 with only one byte read even though the end of the stream was not reached.
 If this is the case, the current logic will treat the slingId as invalid and 
 generate a new one.
 A way to fix that is to read the sling id file completely, for instance using 
 the org.apache.commons.io.FileUtils API
 We are running on CentOS 6.2, JDK 1.7.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Resolved] (SLING-3628) Consider reusing the properties view for the custom JCR properties view

2014-07-07 Thread Stefan Egli (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-3628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Egli resolved SLING-3628.


Resolution: Fixed

fixed in SLING-3641 / http://svn.apache.org/r1608486

 Consider reusing the properties view for the custom JCR properties view
 ---

 Key: SLING-3628
 URL: https://issues.apache.org/jira/browse/SLING-3628
 Project: Sling
  Issue Type: Improvement
  Components: IDE
Reporter: Robert Munteanu
Assignee: Stefan Egli
Priority: Minor
 Fix For: Sling Eclipse IDE 1.0.2


 The properties view is something which is already known to the Eclipse 
 developers and it would be good to reuse it. At the same time, it remains to 
 be seen whether we can customize it just like we did for the JCR Properties 
 view.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3737) Instance Sling Identifier may be randomly reset on restart

2014-07-07 Thread Carsten Ziegeler (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053762#comment-14053762
 ] 

Carsten Ziegeler commented on SLING-3737:
-

Great finding, [~marett]
I would prefer a way where we don't need additional libs as the sling settings 
service is one of the first bundles to start. In this case this should be 
pretty easy as we know how much data should be read.

 Instance Sling Identifier may be randomly reset on restart
 --

 Key: SLING-3737
 URL: https://issues.apache.org/jira/browse/SLING-3737
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Settings 1.3.0
Reporter: Timothee Maret
Assignee: Carsten Ziegeler
 Fix For: Settings 1.3.2

 Attachments: SLING-3737.diff


 In our Setup, we experience instances changing their Sling identifier upon 
 restart.
 We have experienced only a few occurrences of this issue, but the effect is 
 really bad, turning the services relying on the Sling Identifier into 
 unexpected state (for instance Sling discovery service).
 We have checked that the sling.id.file was present before the issue occurred.
 We also checked that the value in this file was valid (36 byte long UUID).
 Despite having a valid sling.id.file file, the instance sometimes reset the 
 Sling ID upon restart.
 Looking at the latest code in 
 org.apache.sling.settings.impl.SlingSettingsServiceImpl#readSlingId
 it seems there is a bug in the way the sling id is read from the file 
 sling.id.file.
 {code}
 private String readSlingId(final File idFile) {
 if (idFile.exists()  idFile.length() = 36) {
 FileInputStream fin = null;
 try {
 fin = new FileInputStream(idFile);
 final byte[] rawBytes = new byte[36];
 if (fin.read(rawBytes) == 36) {
 final String rawString = new String(rawBytes, 
 ISO-8859-1);
 // roundtrip to ensure correct format of UUID value
 final String id = UUID.fromString(rawString).toString();
 logger.debug(Got Sling ID {} from file {}, id, idFile);
 return id;
 }
 } catch (final Throwable t) {
 logger.error(Failed reading UUID from id file  + idFile
 + , creating new id, t);
 } finally {
 if (fin != null) {
 try {
 fin.close();
 } catch (IOException ignore) {
 }
 }
 }
 }
 return null;
 }
 {code}
 In the line
 {code}
 if (fin.read(rawBytes) == 36) {
 {code}
 The code miss uses the java.io.FileInputStream#read API.
 {code}
 /**
  * Reads up to codeb.length/code bytes of data from this input
  * stream into an array of bytes. This method blocks until some input
  * is available.
  *
  * @param  b   the buffer into which the data is read.
  * @return the total number of bytes read into the buffer, or
  * code-1/code if there is no more data because the end of
  * the file has been reached.
  * @exception  IOException  if an I/O error occurs.
  */
 {code}
 The API stipulates that the method blocks until if finds *some* data.
 This is a common pattern with Java IO APIs, and indeed, the method may return 
 with only one byte read even though the end of the stream was not reached.
 If this is the case, the current logic will treat the slingId as invalid and 
 generate a new one.
 A way to fix that is to read the sling id file completely, for instance using 
 the org.apache.commons.io.FileUtils API
 We are running on CentOS 6.2, JDK 1.7.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3737) Instance Sling Identifier may be randomly reset on restart

2014-07-07 Thread Carsten Ziegeler (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053784#comment-14053784
 ] 

Carsten Ziegeler commented on SLING-3737:
-

No, this is the only way for the sling id. I think we don't need 
DataInputStream, creating a buffer of size 37 bytes and the filling it, should 
do the trick

 Instance Sling Identifier may be randomly reset on restart
 --

 Key: SLING-3737
 URL: https://issues.apache.org/jira/browse/SLING-3737
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Settings 1.3.0
Reporter: Timothee Maret
Assignee: Carsten Ziegeler
 Fix For: Settings 1.3.2

 Attachments: SLING-3737.diff


 In our Setup, we experience instances changing their Sling identifier upon 
 restart.
 We have experienced only a few occurrences of this issue, but the effect is 
 really bad, turning the services relying on the Sling Identifier into 
 unexpected state (for instance Sling discovery service).
 We have checked that the sling.id.file was present before the issue occurred.
 We also checked that the value in this file was valid (36 byte long UUID).
 Despite having a valid sling.id.file file, the instance sometimes reset the 
 Sling ID upon restart.
 Looking at the latest code in 
 org.apache.sling.settings.impl.SlingSettingsServiceImpl#readSlingId
 it seems there is a bug in the way the sling id is read from the file 
 sling.id.file.
 {code}
 private String readSlingId(final File idFile) {
 if (idFile.exists()  idFile.length() = 36) {
 FileInputStream fin = null;
 try {
 fin = new FileInputStream(idFile);
 final byte[] rawBytes = new byte[36];
 if (fin.read(rawBytes) == 36) {
 final String rawString = new String(rawBytes, 
 ISO-8859-1);
 // roundtrip to ensure correct format of UUID value
 final String id = UUID.fromString(rawString).toString();
 logger.debug(Got Sling ID {} from file {}, id, idFile);
 return id;
 }
 } catch (final Throwable t) {
 logger.error(Failed reading UUID from id file  + idFile
 + , creating new id, t);
 } finally {
 if (fin != null) {
 try {
 fin.close();
 } catch (IOException ignore) {
 }
 }
 }
 }
 return null;
 }
 {code}
 In the line
 {code}
 if (fin.read(rawBytes) == 36) {
 {code}
 The code miss uses the java.io.FileInputStream#read API.
 {code}
 /**
  * Reads up to codeb.length/code bytes of data from this input
  * stream into an array of bytes. This method blocks until some input
  * is available.
  *
  * @param  b   the buffer into which the data is read.
  * @return the total number of bytes read into the buffer, or
  * code-1/code if there is no more data because the end of
  * the file has been reached.
  * @exception  IOException  if an I/O error occurs.
  */
 {code}
 The API stipulates that the method blocks until if finds *some* data.
 This is a common pattern with Java IO APIs, and indeed, the method may return 
 with only one byte read even though the end of the stream was not reached.
 If this is the case, the current logic will treat the slingId as invalid and 
 generate a new one.
 A way to fix that is to read the sling id file completely, for instance using 
 the org.apache.commons.io.FileUtils API
 We are running on CentOS 6.2, JDK 1.7.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: adaptTo and results ....

2014-07-07 Thread Alexander Klimetschek
On 07.07.2014, at 17:08, Carsten Ziegeler cziege...@apache.org wrote:

 2014-07-07 14:55 GMT+02:00 Justin Edelson jus...@justinedelson.com:
 
 Here's a sightly more real world case... let's say you have a call like
 this:
 
 Comment comment = resource.adaptTo(Comment.class);
 
 And for a Resource to be successfully adapted to a Comment, it must
 satisfy two criteria:
 1) The resource type must be myco/comment
 2) It must have a property called commentType (OK, this part isn't
 so real world).
 
 Right now, the caller has no way of knowing which of these critera
 wasn't met. That's IMHO the crux of this request - to provide a way
 for AdapterFactories to surface the failure reason back to the caller.
 
 
 Hmm, this assumes the caller can do something meaningful with it. Given
 your example, what could the client do?

Right.

In this case I would assume that if 1) is present, you get a Comment back, 
otherwise null. Then Comment has a getter method for the type 2), which would 
also handle the case of a missing type: usually you would fall back to a 
default if no type is specified, since that reduces the constraints the content 
has to follow; but you could also have the application handle the no-type case 
itself and fail in some way (as you were trying to with an exception that is 
passed through from adapterfactory to application code).

Next example please :D

Cheers,
Alex



Re: adaptTo and results ....

2014-07-07 Thread Justin Edelson
Hi,

On Mon, Jul 7, 2014 at 5:57 PM, Alexander Klimetschek
aklim...@adobe.com wrote:
 On 07.07.2014, at 17:08, Carsten Ziegeler cziege...@apache.org wrote:

 2014-07-07 14:55 GMT+02:00 Justin Edelson jus...@justinedelson.com:

 Here's a sightly more real world case... let's say you have a call like
 this:

 Comment comment = resource.adaptTo(Comment.class);

 And for a Resource to be successfully adapted to a Comment, it must
 satisfy two criteria:
 1) The resource type must be myco/comment
 2) It must have a property called commentType (OK, this part isn't
 so real world).

 Right now, the caller has no way of knowing which of these critera
 wasn't met. That's IMHO the crux of this request - to provide a way
 for AdapterFactories to surface the failure reason back to the caller.


 Hmm, this assumes the caller can do something meaningful with it. Given
 your example, what could the client do?

Konrad could probably articulate this better than I can :)


 Right.

 In this case I would assume that if 1) is present, you get a Comment back, 
 otherwise null. Then Comment has a getter method for the type 2), which would 
 also handle the case of a missing type: usually you would fall back to a 
 default if no type is specified, since that reduces the constraints the 
 content has to follow; but you could also have the application handle the 
 no-type case itself and fail in some way (as you were trying to with an 
 exception that is passed through from adapterfactory to application code).

 Next example please :D

I found a more concrete example in the AEM codebase (so apologies to
the non-Adobe people on this thread who will just have to take my word
for it). The adapter factory which adapts Resources into Scene7 set
objects makes a number of validations before returning a non-null
result:
1) Is the Resource an Asset?
2) Does the Asset represet a Scene7 set? (which is done by looking at
a property)
3) Does the requested set class correspond to the set type of the Asset?

Regards,
Justin


 Cheers,
 Alex



Re: adaptTo and results ....

2014-07-07 Thread Carsten Ziegeler
2014-07-07 18:14 GMT+02:00 Justin Edelson jus...@justinedelson.com:

 Hi,


 I found a more concrete example in the AEM codebase (so apologies to
 the non-Adobe people on this thread who will just have to take my word
 for it). The adapter factory which adapts Resources into Scene7 set
 objects makes a number of validations before returning a non-null
 result:
 1) Is the Resource an Asset?
 2) Does the Asset represet a Scene7 set? (which is done by looking at
 a property)
 3) Does the requested set class correspond to the set type of the Asset?


But again, what different action would a client take depending on the error
condition 1, 2 or 3?

Carsten


 Regards,
 Justin

 
  Cheers,
  Alex
 




-- 
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


Re: adaptTo and results ....

2014-07-07 Thread Konrad Windszus
Provide a meaningful error message to the author or at least to the developer 
(leveraging the WCMDeveloperMode). By meaningful I don’t talk about something 
hidden within the logs.
Konrad

On 07 Jul 2014, at 18:27, Carsten Ziegeler cziege...@apache.org wrote:

 2014-07-07 18:14 GMT+02:00 Justin Edelson jus...@justinedelson.com:
 
 Hi,
 
 
 I found a more concrete example in the AEM codebase (so apologies to
 the non-Adobe people on this thread who will just have to take my word
 for it). The adapter factory which adapts Resources into Scene7 set
 objects makes a number of validations before returning a non-null
 result:
 1) Is the Resource an Asset?
 2) Does the Asset represet a Scene7 set? (which is done by looking at
 a property)
 3) Does the requested set class correspond to the set type of the Asset?
 
 
 But again, what different action would a client take depending on the error
 condition 1, 2 or 3?
 
 Carsten
 
 
 Regards,
 Justin
 
 
 Cheers,
 Alex
 
 
 
 
 
 -- 
 Carsten Ziegeler
 Adobe Research Switzerland
 cziege...@apache.org



Re: adaptTo and results ....

2014-07-07 Thread Carsten Ziegeler
2014-07-07 18:29 GMT+02:00 Konrad Windszus konra...@gmx.de:

 Provide a meaningful error message to the author or at least to the
 developer (leveraging the WCMDeveloperMode). By meaningful I don’t talk
 about something hidden within the logs.


This doesn't really convince me - the same argument would hold true for
every API where the exception (cause) is logged, but the method just gives
back true/false,object/null. Even for APIs throwing an exception it might
be hard to get a meaningful message to developer. So this isn't done for
other APIs, why should we do it differently for adaptTo?
In addition, if you have a lot of client code using the adapter pattern,
then you end up in converting the exception to a meaningful message in
various places.

It would be so easy to let the adapter factory do a meaningful log
statement and there are tools/apis to pick up this log message and display
it to the dev without requiring the developer to go to the log

Carsten



 Konrad

 On 07 Jul 2014, at 18:27, Carsten Ziegeler cziege...@apache.org wrote:

  2014-07-07 18:14 GMT+02:00 Justin Edelson jus...@justinedelson.com:
 
  Hi,
 
 
  I found a more concrete example in the AEM codebase (so apologies to
  the non-Adobe people on this thread who will just have to take my word
  for it). The adapter factory which adapts Resources into Scene7 set
  objects makes a number of validations before returning a non-null
  result:
  1) Is the Resource an Asset?
  2) Does the Asset represet a Scene7 set? (which is done by looking at
  a property)
  3) Does the requested set class correspond to the set type of the Asset?
 
 
  But again, what different action would a client take depending on the
 error
  condition 1, 2 or 3?
 
  Carsten
 
 
  Regards,
  Justin
 
 
  Cheers,
  Alex
 
 
 
 
 
  --
  Carsten Ziegeler
  Adobe Research Switzerland
  cziege...@apache.org




-- 
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


Jenkins build is back to stable : sling-trunk-1.7 » Apache Sling Sample Integration Tests #639

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.7/org.apache.sling$org.apache.sling.testing.samples.integrationtests/639/



Jenkins build is back to stable : sling-trunk-1.7 » Apache Sling SLF4J Implementation (Logback) #639

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.7/org.apache.sling$org.apache.sling.commons.log/639/



Jenkins build is back to stable : sling-trunk-1.7 » Apache Sling Models Integration Tests #639

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.7/org.apache.sling$org.apache.sling.models.integration-tests/639/



Jenkins build is still unstable: sling-trunk-1.7 #639

2014-07-07 Thread Apache Jenkins Server
See https://builds.apache.org/job/sling-trunk-1.7/changes



Jenkins build is still unstable: sling-trunk-1.7 » Apache Sling Launchpad Testing #639

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.7/org.apache.sling$org.apache.sling.launchpad.testing/639/



Jenkins build is back to stable : sling-trunk-1.6 » Apache Sling Sample Integration Tests #2265

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.6/org.apache.sling$org.apache.sling.testing.samples.integrationtests/2265/



Jenkins build is still unstable: sling-trunk-1.6 » Apache Sling Launchpad Testing #2265

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.6/org.apache.sling$org.apache.sling.launchpad.testing/2265/



Jenkins build is still unstable: sling-trunk-1.6 #2265

2014-07-07 Thread Apache Jenkins Server
See https://builds.apache.org/job/sling-trunk-1.6/changes



[jira] [Created] (SLING-3742) Python and Ruby language bundle throw exception with sling scripting console

2014-07-07 Thread Nitin Nizhawan (JIRA)
Nitin Nizhawan created SLING-3742:
-

 Summary: Python and Ruby language bundle throw exception with 
sling scripting console
 Key: SLING-3742
 URL: https://issues.apache.org/jira/browse/SLING-3742
 Project: Sling
  Issue Type: Bug
  Components: Console, Extensions
Reporter: Nitin Nizhawan


When running Ruby and Python language bundles from contrib/scripting with sling 
scripting console I am getting following exception

java.lang.NullPointerException
at 
org.apache.sling.scripting.python.PythonScriptEngine.eval(PythonScriptEngine.java:69)
at 
org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)
at 
org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
at 
org.apache.sling.scripting.console.internal.ScriptConsolePlugin.doPost(ScriptConsolePlugin.java:112)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at 
org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:526)
at 
org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:450)
at 
org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96)
at 
org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)
at 
org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (SLING-3742) Python and Ruby language bundle throw exception with sling scripting console

2014-07-07 Thread Nitin Nizhawan (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-3742?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nitin Nizhawan updated SLING-3742:
--

Attachment: SLING-3742.patch

Patch to check for NPE

 Python and Ruby language bundle throw exception with sling scripting console
 

 Key: SLING-3742
 URL: https://issues.apache.org/jira/browse/SLING-3742
 Project: Sling
  Issue Type: Bug
  Components: Console, Extensions
Reporter: Nitin Nizhawan
 Attachments: SLING-3742.patch


 When running Ruby and Python language bundles from contrib/scripting with 
 sling scripting console I am getting following exception
 java.lang.NullPointerException
 at 
 org.apache.sling.scripting.python.PythonScriptEngine.eval(PythonScriptEngine.java:69)
 at 
 org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)
 at 
 org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
 at 
 org.apache.sling.scripting.console.internal.ScriptConsolePlugin.doPost(ScriptConsolePlugin.java:112)
 at 
 javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
 at 
 javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
 at 
 org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:526)
 at 
 org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:450)
 at 
 org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96)
 at 
 org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)
 at 
 org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (SLING-3743) BackgroundHttpServletResponse don't flushes the Writer

2014-07-07 Thread Alexander Berndt (JIRA)
Alexander Berndt created SLING-3743:
---

 Summary: BackgroundHttpServletResponse don't flushes the Writer
 Key: SLING-3743
 URL: https://issues.apache.org/jira/browse/SLING-3743
 Project: Sling
  Issue Type: Bug
Reporter: Alexander Berndt
Priority: Minor


A sling servlet request can be run as a background service, while appending a 
?sling:bg=true to the request. This is done in the 
BackgroundServletStarterFilter.

Unfortunatily this doesn't work for servlets, that use request.getWriter() to 
create the output. The provided BackgroundHttpServletResponse provides also a 
writer, but this isn't flushed during the clean-up.

So the current code:

public BackgroundHttpServletResponse(HttpServletResponse hsr, OutputStream os)
throws IOException {
stream = new ServletOutputStreamWrapper(os);
writer = new PrintWriter(new OutputStreamWriter(stream));
}

public void cleanup() throws IOException {
stream.flush();
stream.close();
}

should be changed to:

public void cleanup() throws IOException {
writer.flush();
writer.close();
}

as the writer also flushes and closes the underlying stream.

kind regards,
Alexander Berndt



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Jenkins build is still unstable: sling-trunk-1.6 » Apache Sling Launchpad Testing #2266

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-trunk-1.6/org.apache.sling$org.apache.sling.launchpad.testing/2266/



Jenkins build is still unstable: sling-trunk-1.6 #2266

2014-07-07 Thread Apache Jenkins Server
See https://builds.apache.org/job/sling-trunk-1.6/changes



[VOTE] Release Apache Sling Scripting Thymeleaf 0.0.2

2014-07-07 Thread Oliver Lietz
Hi,

We solved 1 issue in this release:
https://issues.apache.org/jira/browse/SLING/fixforversion/12327184/

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1076/

You can use this UNIX script to download the release and verify the 
signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1076 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.

Regards,
O.


Jenkins build is back to stable : sling-contrib-1.6 » Apache Sling Replication Integration Tests #1173

2014-07-07 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/sling-contrib-1.6/org.apache.sling$org.apache.sling.replication.it/1173/



Jenkins build is still unstable: sling-trunk-1.7 #640

2014-07-07 Thread Apache Jenkins Server
See https://builds.apache.org/job/sling-trunk-1.7/changes



Re: [VOTE] Release Apache Sling Scripting Thymeleaf 0.0.2

2014-07-07 Thread Chetan Mehrotra
Hi Oliver,

On Tue, Jul 8, 2014 at 1:10 AM, Oliver Lietz apa...@oliverlietz.de wrote:
 sh check_staged_release.sh 1076 /tmp/sling-staging

+1 for the release.
All checks ok

One minor note - Currently quite a few classes are part of public
package 'org.apache.sling.scripting.thymeleaf'. May be all are not
required in Export-Package like SlingWebContext,
ThymeleafScriptEngine, ThymeleafScriptEngineFactory.

Chetan Mehrotra


[jira] [Commented] (SLING-913) Add a cache for pre-compiled scripts

2014-07-07 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14054535#comment-14054535
 ] 

Chetan Mehrotra commented on SLING-913:
---

One observation regarding cache implementation.

 It would work fine if the script is self contained as it only checks the 
modified timestamp for that script. However I am not sure for the case where 
script refers to other script say via include in esp. if the include request 
again gets processed via the Sling Scripting flow then things should work fine 
however if the script engine internally resolves the included scripts and 
compile them then that might cause issue. From what I can make out currently in 
most cases the request for include would be handled via Sling Script support 
itself. Something to be aware of

 Add a cache for pre-compiled scripts
 

 Key: SLING-913
 URL: https://issues.apache.org/jira/browse/SLING-913
 Project: Sling
  Issue Type: New Feature
  Components: Scripting
Affects Versions: Scripting Core 2.0.2
Reporter: Felix Meschberger
 Attachments: SLING-913.patch


 The Java Scripting API provides support for scripting langugages which may 
 precompile script source and reuse the precompiled scripts:
   javax.script.Compilable: May be implemented by a ScriptEngine if 
 precompilation is
   supported
   javax.script.CompiledScript: Result of calling the Compilable.compile 
 method.
 The CompiledScript can be called to repeatedly execute the script without the 
 need for recompilation and thus for improved performance.
 The Sling Core Scripting support should make use of this functionality by 
 maintaining a cache compiled scripts with the following properties
   * indexed by script path
   * size limited (using LinkedHashMap overwriting the removeEldestEntry 
 method)
   * entries are weak or soft references ot cache entries
 A cache entry consists of the following information:
   * The CompiledScript instance
   * The time of last compilation. this is compared to the last modification 
 time of the script to decide on whether to recompile
 We might probaly also try to add a reference to the script engine 
 implementation bundle to only use the cache entry if the bundle has not been 
 stopped since adding the cache entry
 Executing the script would then consist of the following steps:
   1 Check the cache of precompiled scripts. if an entry exists and can be 
 used, use it
   2. if the ScriptEngine is Compilable:
   2a. Compile the script and add it to the cache and use it
   2b. Otherwise have the script engine execute the script



--
This message was sent by Atlassian JIRA
(v6.2#6252)