Re: cocoon 2.1.x and java 8

2015-01-30 Thread Carlos Chávez
Hi Francesco.

I uploaded the patch.

On 16/01/15 01:24, Francesco Chicchiriccò wrote:
 On 15/01/2015 18:59, Carlos Chávez wrote:
 Hi Francesco.

 I downloaded that file and it works with java 8.

 I found another test that is failing,
 http://localhost:/samples/blocks/xsp/java/java5, this seems to be
 related to :

 // Set the sourceCodeVersion
 // Set the target platform

 Check the patch:
 
 Hi,
 thanks for reporting: could you please unify my patch with your changes
 and attach the resulting patch to
 
 https://issues.apache.org/jira/browse/COCOON-2344
 
 ? Thanks.
 
 Regards.
 
 Index:
 src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java

 ===
 ---
 workspace/cocoon-BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java

 (revision 1652165)
 +++
 workspace/cocoon-BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java

 (working copy)
 @@ -215,8 +215,11 @@
   }
   return result;
   }
 -}

 +public boolean ignoreOptionalProblems() {
 +return false;
 +}
 +}

   final INameEnvironment env = new INameEnvironment() {

 @@ -336,6 +339,18 @@
   }
   // Set the sourceCodeVersion
   switch (this.compilerComplianceLevel) {
 +case 180:
 +settings.put(CompilerOptions.OPTION_Source,
 CompilerOptions.VERSION_1_8);
 +settings.put(CompilerOptions.OPTION_Compliance,
 CompilerOptions.VERSION_1_8);
 +break;
 +case 170:
 +settings.put(CompilerOptions.OPTION_Source,
 CompilerOptions.VERSION_1_7);
 +settings.put(CompilerOptions.OPTION_Compliance,
 CompilerOptions.VERSION_1_7);
 +break;
 +case 160:
 +settings.put(CompilerOptions.OPTION_Source,
 CompilerOptions.VERSION_1_6);
 +settings.put(CompilerOptions.OPTION_Compliance,
 CompilerOptions.VERSION_1_6);
 +break;
   case 150:
   settings.put(CompilerOptions.OPTION_Source,
 CompilerOptions.VERSION_1_5);
   settings.put(CompilerOptions.OPTION_Compliance,
 CompilerOptions.VERSION_1_5);
 @@ -348,6 +363,15 @@
   }
   // Set the target platform
   switch (SystemUtils.JAVA_VERSION_INT) {
 +case 180:
 +settings.put(CompilerOptions.OPTION_TargetPlatform,
 CompilerOptions.VERSION_1_8);
 +break;
 +case 170:
 +settings.put(CompilerOptions.OPTION_TargetPlatform,
 CompilerOptions.VERSION_1_7);
 +break;
 +case 160:
 +settings.put(CompilerOptions.OPTION_TargetPlatform,
 CompilerOptions.VERSION_1_6);
 +break;
   case 150:
   settings.put(CompilerOptions.OPTION_TargetPlatform,
 CompilerOptions.VERSION_1_5);
   break;


 On 15/01/15 02:19, Francesco Chicchiriccò wrote:
 On 08/01/2015 00:12, Carlos Chávez wrote:
 Hi all.

 I'm trying to run cocoon in java 8, I found an issue with the JDT core
 that did not recognize java 8, the version in cocoon is

 lib/core/jdtcore-3.1.0.jar


 I did tried updating that version, what I did was copy the file
 org.eclipse.jdt.core_3.10.0.v20140902-0626.jar from my Eclipse Luna
 Installation and it works.

 I did not find a public repository to download the jtdcore jar, I
 searched in maven repos and did not find any updated jar.

 When I compile and run cocoon with java 8, i found the issue testing
 the
 sample http://localhost:/samples/blocks/xsp/java/cacheable which it
 throw a NullPointerException when it tried to compile the XPS.

 With that version the exception is gone and the page is generated.

 thoughts, please ?
 Hi Carlos,
 I tried as you explain above and got exactly the same results: only
 found this updated JAR [1], but the error is the same.

 However, I have found these places [2] [3] from which the version
 reported above can be downloaded.
 I have opened COCOON-2344 [4] and provided a patch with which the XSP
 sample above is working (checked  with OpenJDK 6 / 7 / 8).
 I have not committed the fix because I have no mean to check if
 everything is working with Java 4 / 5 and also if other XSP features are
 affected.

 Can anyone please double check and confirm if the proposed patch can be
 committed?

 Regards.

 [1]
 http://central.maven.org/maven2/eclipse/jdtcore/3.2.0.v_658/jdtcore-3.2.0.v_658.jar


 [2]
 http://repository.grepcode.com/java/eclipse.org/4.4.1/plugins/org.eclipse.jdt.core_3.10.0.v20140902-0626.jar


 [3]
 http://www.aadl.info/aadl/osate/testing/update-site/plugins/org.eclipse.jdt.core_3.10.0.v20140902-0626.jar


 [4] 

[jira] [Assigned] (COCOON-2344) XSP not working with Java 8

2015-01-30 Thread JIRA

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

Francesco Chicchiriccò reassigned COCOON-2344:
--

Assignee: Francesco Chicchiriccò

 XSP not working with Java 8
 ---

 Key: COCOON-2344
 URL: https://issues.apache.org/jira/browse/COCOON-2344
 Project: Cocoon
  Issue Type: Bug
  Components: Blocks: XSP
Affects Versions: 2.1.12
Reporter: Francesco Chicchiriccò
Assignee: Francesco Chicchiriccò
 Fix For: 2.1.13

 Attachments: COCOON-2344.patch


 When running with Java 8 and accessing 
 http://localhost:/samples/blocks/xsp/java/cacheable
 a NullPointerException is reported.
 This seems to be due to lib/core/jdtcore-3.1.0.jar which is reported not 
 working with Java 8.
 See the relevant ML discussion at 
 http://cocoon.10839.n7.nabble.com/cocoon-2-1-x-and-java-8-td58465.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (COCOON-2344) XSP not working with Java 8

2015-01-30 Thread JIRA

[ 
https://issues.apache.org/jira/browse/COCOON-2344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14299680#comment-14299680
 ] 

Francesco Chicchiriccò commented on COCOON-2344:


Patch applied: http://svn.apache.org/r1656165

 XSP not working with Java 8
 ---

 Key: COCOON-2344
 URL: https://issues.apache.org/jira/browse/COCOON-2344
 Project: Cocoon
  Issue Type: Bug
  Components: Blocks: XSP
Affects Versions: 2.1.12
Reporter: Francesco Chicchiriccò
Assignee: Francesco Chicchiriccò
 Fix For: 2.1.13

 Attachments: COCOON-2344.patch


 When running with Java 8 and accessing 
 http://localhost:/samples/blocks/xsp/java/cacheable
 a NullPointerException is reported.
 This seems to be due to lib/core/jdtcore-3.1.0.jar which is reported not 
 working with Java 8.
 See the relevant ML discussion at 
 http://cocoon.10839.n7.nabble.com/cocoon-2-1-x-and-java-8-td58465.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (COCOON-2344) XSP not working with Java 8

2015-01-30 Thread JIRA

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

Francesco Chicchiriccò closed COCOON-2344.
--
Resolution: Fixed

 XSP not working with Java 8
 ---

 Key: COCOON-2344
 URL: https://issues.apache.org/jira/browse/COCOON-2344
 Project: Cocoon
  Issue Type: Bug
  Components: Blocks: XSP
Affects Versions: 2.1.12
Reporter: Francesco Chicchiriccò
Assignee: Francesco Chicchiriccò
 Fix For: 2.1.13

 Attachments: COCOON-2344.patch


 When running with Java 8 and accessing 
 http://localhost:/samples/blocks/xsp/java/cacheable
 a NullPointerException is reported.
 This seems to be due to lib/core/jdtcore-3.1.0.jar which is reported not 
 working with Java 8.
 See the relevant ML discussion at 
 http://cocoon.10839.n7.nabble.com/cocoon-2-1-x-and-java-8-td58465.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (COCOON-2344) XSP not working with Java 8

2015-01-30 Thread JIRA

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

Francesco Chicchiriccò updated COCOON-2344:
---
Attachment: (was: COCOON-2344.patch)

 XSP not working with Java 8
 ---

 Key: COCOON-2344
 URL: https://issues.apache.org/jira/browse/COCOON-2344
 Project: Cocoon
  Issue Type: Bug
  Components: Blocks: XSP
Affects Versions: 2.1.12
Reporter: Francesco Chicchiriccò
 Fix For: 2.1.13

 Attachments: COCOON-2344.patch


 When running with Java 8 and accessing 
 http://localhost:/samples/blocks/xsp/java/cacheable
 a NullPointerException is reported.
 This seems to be due to lib/core/jdtcore-3.1.0.jar which is reported not 
 working with Java 8.
 See the relevant ML discussion at 
 http://cocoon.10839.n7.nabble.com/cocoon-2-1-x-and-java-8-td58465.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (COCOON-2344) XSP not working with Java 8

2015-01-30 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/COCOON-2344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14299686#comment-14299686
 ] 

Hudson commented on COCOON-2344:


FAILURE: Integrated in Cocoon 2.1.X #98 (See 
[https://builds.apache.org/job/Cocoon%202.1.X/98/])
[COCOON-2344] Applying the provided patch (ilgrosso: 
http://svn.apache.org/viewvc/?view=revrev=1656165)
* /cocoon/branches/BRANCH_2_1_X/lib/core/jdtcore-3.1.0.jar
* 
/cocoon/branches/BRANCH_2_1_X/lib/core/org.eclipse.jdt.core_3.10.0.v20140902-0626.jar
* /cocoon/branches/BRANCH_2_1_X/lib/jars.xml
* /cocoon/branches/BRANCH_2_1_X/misc/notes/review-jars.txt
* 
/cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java


 XSP not working with Java 8
 ---

 Key: COCOON-2344
 URL: https://issues.apache.org/jira/browse/COCOON-2344
 Project: Cocoon
  Issue Type: Bug
  Components: Blocks: XSP
Affects Versions: 2.1.12
Reporter: Francesco Chicchiriccò
Assignee: Francesco Chicchiriccò
 Fix For: 2.1.13

 Attachments: COCOON-2344.patch


 When running with Java 8 and accessing 
 http://localhost:/samples/blocks/xsp/java/cacheable
 a NullPointerException is reported.
 This seems to be due to lib/core/jdtcore-3.1.0.jar which is reported not 
 working with Java 8.
 See the relevant ML discussion at 
 http://cocoon.10839.n7.nabble.com/cocoon-2-1-x-and-java-8-td58465.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: cocoon 2.1.x and java 8

2015-01-30 Thread Francesco Chicchiriccò

On 31/01/2015 06:24, Francesco Chicchiriccò wrote:

On 30/01/2015 15:09, Carlos Chávez wrote:

Hi Francesco.

I uploaded the patch.


Hi Carlos,
patch applied (and issue closed), thanks.


It seems there is a problem; see 
https://builds.apache.org/job/Cocoon%202.1.X/98/console


bad class file: /home/jenkins/jenkins-slave/workspace/Cocoon 
2.1.X/BRANCH_2_1_X/lib/core/org.eclipse.jdt.core_3.10.0.v20140902-0626.jar(org/eclipse/jdt/core/compiler/IProblem.class)

class file has wrong version 50.0, should be 48.0

This means that the JAR above does not work with JDK 1.4, which is 
currently a pre-requisite for Cocoon 2.1.X - can you find a compatible 
version of that JAR?


Alternatively I will need to revert the patch...

Regards.


On 16/01/15 01:24, Francesco Chicchiriccò wrote:

On 15/01/2015 18:59, Carlos Chávez wrote:

Hi Francesco.

I downloaded that file and it works with java 8.

I found another test that is failing,
http://localhost:/samples/blocks/xsp/java/java5, this seems to be
related to :

// Set the sourceCodeVersion
// Set the target platform

Check the patch:

Hi,
thanks for reporting: could you please unify my patch with your changes
and attach the resulting patch to

https://issues.apache.org/jira/browse/COCOON-2344

? Thanks.

Regards.


Index:
src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java 



===
---
workspace/cocoon-BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java 



(revision 1652165)
+++
workspace/cocoon-BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java 



(working copy)
@@ -215,8 +215,11 @@
   }
   return result;
   }
-}

+public boolean ignoreOptionalProblems() {
+return false;
+}
+}

   final INameEnvironment env = new INameEnvironment() {

@@ -336,6 +339,18 @@
   }
   // Set the sourceCodeVersion
   switch (this.compilerComplianceLevel) {
+case 180:
+settings.put(CompilerOptions.OPTION_Source,
CompilerOptions.VERSION_1_8);
+ settings.put(CompilerOptions.OPTION_Compliance,
CompilerOptions.VERSION_1_8);
+break;
+case 170:
+settings.put(CompilerOptions.OPTION_Source,
CompilerOptions.VERSION_1_7);
+ settings.put(CompilerOptions.OPTION_Compliance,
CompilerOptions.VERSION_1_7);
+break;
+case 160:
+settings.put(CompilerOptions.OPTION_Source,
CompilerOptions.VERSION_1_6);
+ settings.put(CompilerOptions.OPTION_Compliance,
CompilerOptions.VERSION_1_6);
+break;
   case 150:
settings.put(CompilerOptions.OPTION_Source,
CompilerOptions.VERSION_1_5);
settings.put(CompilerOptions.OPTION_Compliance,
CompilerOptions.VERSION_1_5);
@@ -348,6 +363,15 @@
   }
   // Set the target platform
   switch (SystemUtils.JAVA_VERSION_INT) {
+case 180:
+ settings.put(CompilerOptions.OPTION_TargetPlatform,
CompilerOptions.VERSION_1_8);
+break;
+case 170:
+ settings.put(CompilerOptions.OPTION_TargetPlatform,
CompilerOptions.VERSION_1_7);
+break;
+case 160:
+ settings.put(CompilerOptions.OPTION_TargetPlatform,
CompilerOptions.VERSION_1_6);
+break;
   case 150:
settings.put(CompilerOptions.OPTION_TargetPlatform,
CompilerOptions.VERSION_1_5);
   break;


On 15/01/15 02:19, Francesco Chicchiriccò wrote:

On 08/01/2015 00:12, Carlos Chávez wrote:

Hi all.

I'm trying to run cocoon in java 8, I found an issue with the JDT 
core

that did not recognize java 8, the version in cocoon is

lib/core/jdtcore-3.1.0.jar


I did tried updating that version, what I did was copy the file
org.eclipse.jdt.core_3.10.0.v20140902-0626.jar from my Eclipse Luna
Installation and it works.

I did not find a public repository to download the jtdcore jar, I
searched in maven repos and did not find any updated jar.

When I compile and run cocoon with java 8, i found the issue testing
the
sample http://localhost:/samples/blocks/xsp/java/cacheable 
which it

throw a NullPointerException when it tried to compile the XPS.

With that version the exception is gone and the page is generated.

thoughts, please ?

Hi Carlos,
I tried as you explain above and got exactly the same results: only
found this updated JAR [1], but the error is the same.

However, I have found these places [2] [3] from which the version
reported above can be downloaded.
I have opened COCOON-2344 [4] and provided a patch with which the XSP
sample above is working (checked  with OpenJDK 6 / 7 / 8).
I have not committed the fix because I have no mean to check if
everything is working with Java 4 / 5 and also if other XSP 

[jira] [Updated] (COCOON-2344) XSP not working with Java 8

2015-01-30 Thread JIRA

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

carlos chávez updated COCOON-2344:
--
Attachment: COCOON-2344.patch

Added sourceCodeVersion and target platform to identify java 1.6 to 1.8.

 XSP not working with Java 8
 ---

 Key: COCOON-2344
 URL: https://issues.apache.org/jira/browse/COCOON-2344
 Project: Cocoon
  Issue Type: Bug
  Components: Blocks: XSP
Affects Versions: 2.1.12
Reporter: Francesco Chicchiriccò
 Fix For: 2.1.13

 Attachments: COCOON-2344.patch, COCOON-2344.patch


 When running with Java 8 and accessing 
 http://localhost:/samples/blocks/xsp/java/cacheable
 a NullPointerException is reported.
 This seems to be due to lib/core/jdtcore-3.1.0.jar which is reported not 
 working with Java 8.
 See the relevant ML discussion at 
 http://cocoon.10839.n7.nabble.com/cocoon-2-1-x-and-java-8-td58465.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)