Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

Kevin.gaow
Hi all,

I always meet the build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04.
My build env is:
>mvn --version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 21:51:28+0800)
Maven home: /usr/local/apache-maven/apache-maven-3.0.5
Java version: 1.6.0_31, vendor: Sun Microsystems Inc.
Java home: /usr/local/jdk1.6.0_31/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.38-15-generic", arch: "amd64", family: "unix"

############################################################################################

Below is the build log with error in the end:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Cling
[INFO] Cling Core
[INFO] Cling Demo
[INFO] Cling Demo Android
[INFO] Cling Demo Android Browser
[INFO] Cling Demo Android Light
[INFO] Cling Demo OSGi
[INFO] Cling Demo OSGi Basic Device
[INFO] Cling Demo OSGi Lights
[INFO] Cling Support
[INFO] Cling Workbench
[INFO] Cling MediaRenderer
[INFO] Cling OSGi
[INFO] Cling OSGi Base Driver
[INFO] Cling Website
[INFO] Cling Distribution
[INFO] Cling OSGi Tests
[INFO] Cling OSGi Test Common Library
[INFO] Cling OSGi Test Simple Device
[INFO] Cling OSGi Test Integration
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building Cling 2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ cling ---
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ cling ---
[INFO] Installing /home/b679/codes/cling/cling/pom.xml to /home/b679/.m2/repository/org/fourthline/cling/cling/2.0-SNAPSHOT/cling-2.0-SNAPSHOT.pom
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building Cling Core 2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ cling-core ---
[INFO] Deleting /home/b679/codes/cling/cling/core/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ cling-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ cling-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 346 source files to /home/b679/codes/cling/cling/core/target/classes
[WARNING] /home/b679/codes/cling/cling/core/src/main/java/org/fourthline/cling/transport/impl/FixedSunURLStreamHandler.java:[63,69] warning: sun.net.www.protocol.http.HttpURLConnection is Sun proprietary API and may be removed in a future release
[WARNING] /home/b679/codes/cling/cling/core/src/main/java/org/fourthline/cling/transport/impl/FixedSunURLStreamHandler.java:[70,69] warning: sun.net.www.protocol.http.Handler is Sun proprietary API and may be removed in a future release
[WARNING] /home/b679/codes/cling/cling/core/src/main/java/org/fourthline/cling/transport/impl/FixedSunURLStreamHandler.java:[48,49] warning: sun.net.www.protocol.http.Handler is Sun proprietary API and may be removed in a future release
[WARNING] /home/b679/codes/cling/cling/core/src/main/java/org/fourthline/cling/transport/impl/FixedSunURLStreamHandler.java:[48,49] warning: sun.net.www.protocol.http.Handler is Sun proprietary API and may be removed in a future release
[WARNING] Note: /home/b679/codes/cling/cling/core/src/main/java/org/fourthline/cling/transport/impl/apache/HttpServerConnectionUpnpStream.java uses or overrides a deprecated API.
[WARNING] Note: Recompile with -Xlint:deprecation for details.
[WARNING] Note: Some input files use unchecked or unsafe operations.
[WARNING] Note: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ cling-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 48 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ cling-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 93 source files to /home/b679/codes/cling/cling/core/target/test-classes
[WARNING] Note: Some input files use unchecked or unsafe operations.
[WARNING] Note: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-surefire-plugin:2.9:test (default-test) @ cling-core ---
[INFO] Surefire report directory: /home/b679/codes/cling/cling/core/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running TestSuite
Tests run: 375, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 187.048 sec <<< FAILURE!

Results :

Failed tests:   invokeActions(example.controlpoint.ActionCancellationTest): expected:<true> but was:<false>

Tests run: 375, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Cling ............................................. SUCCESS [0.294s]
[INFO] Cling Core ........................................ FAILURE [3:16.730s]
[INFO] Cling Demo ........................................ SKIPPED
[INFO] Cling Demo Android ................................ SKIPPED
[INFO] Cling Demo Android Browser ........................ SKIPPED
[INFO] Cling Demo Android Light .......................... SKIPPED
[INFO] Cling Demo OSGi ................................... SKIPPED
[INFO] Cling Demo OSGi Basic Device ...................... SKIPPED
[INFO] Cling Demo OSGi Lights ............................ SKIPPED
[INFO] Cling Support ..................................... SKIPPED
[INFO] Cling Workbench ................................... SKIPPED
[INFO] Cling MediaRenderer ............................... SKIPPED
[INFO] Cling OSGi ........................................ SKIPPED
[INFO] Cling OSGi Base Driver ............................ SKIPPED
[INFO] Cling Website ..................................... SKIPPED
[INFO] Cling Distribution ................................ SKIPPED
[INFO] Cling OSGi Tests .................................. SKIPPED
[INFO] Cling OSGi Test Common Library .................... SKIPPED
[INFO] Cling OSGi Test Simple Device ..................... SKIPPED
[INFO] Cling OSGi Test Integration ....................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:19.000s
[INFO] Finished at: Thu Mar 07 15:28:31 CST 2013
[INFO] Final Memory: 21M/200M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.9:test (default-test) on project cling-core: There are test failures.
[ERROR]
[ERROR] Please refer to /home/b679/codes/cling/cling/core/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :cling-core
################################################################################################



Anyone who could help me? Why I alway meet such build error?
Many thanks.

-Regards,
-Kevin.





Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

Christian Bauer
Administrator
What's the failing test?

Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

kevin.gaow
Hi Christian, thanks for ur quick reply.

For ur question, I have no idea. I just want to build the jar files.

What I did is exec command "mvn clean install", seems it's running UT automaticly.

BTW, All my steps are following the "README".
Any suggestion? Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

Christian Bauer
Administrator
In reply to this post by Kevin.gaow
The failing test relies on a timeout, might have been not enough on a slow machine. I've committed a longer timeout.
Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

iank
I am a new entry to using the Cling packages although I have looked at the packages a long time ago. I am a big fan of the BubbleuPnP App for Android and understand that cling is a library that App uses.

I have followed the Readme to the letter for Maven, git-clone (git clone https://github.com/4thline/cling.git) and have tried to perform :

mvn install -X -e -Dandroid.sdk.path=<SDK-PATH>

I am seeing similar Test Failures :-

Results :

Failed tests:   basic(org.fourthline.cling.test.transport.ApacheServerJettyClientTest)
  invokeActions(example.controlpoint.ActionCancellationTest): expected:<true> but was:<false>

Tests run: 375, Failures: 2, Errors: 0, Skipped: 0

My System:-

Ubuntu : 12.04
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 13:51:28+0000)
Maven home: /home/ian/DEV/apache-maven-3.0.5
Java version: 1.6.0_27, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-openjdk-i386/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-38-generic-pae", arch: "i386", family: "unix"

I am more interested in the WorkBench and adding some additions to this great tool. Any pointers to running in Eclipse would be greatly received as well as how to add to the UI for Workbench.
Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

Christian Bauer
Administrator
So, is this with the longer timeout or not? Did you pull from github just now? What's the value of Thread.sleep() in that failing test?
Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

iank
Hello - Many thanks for your super fast response.

I pulled the git repro today (about 1 hour ago). I am still trying to understand the methods here, but performing :-


grep -R "Thread.sleep" * | grep ActionCancellationTest

Shows:-

cling/core/src/test/java/example/controlpoint/ActionCancellationTest.java:        Thread.sleep(1000); // DOC:WAIT_FOR_THREAD
cling/core/src/test/java/example/controlpoint/ActionCancellationTest.java:        Thread.sleep(1000);

I have manually changed the value to 4000:-

167c167
<         Thread.sleep(4000);
---
>         Thread.sleep(1000);

Re-run and still have the failure:-

Tests run: 375, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 190.5 sec <<< FAILURE!

Results :

Failed tests:   invokeActions(example.controlpoint.ActionCancellationTest): expected:<true> but was:<false>

Tests run: 375, Failures: 1, Errors: 0, Skipped: 0

I could try increasing the Thread.sleep for longer but dont see that would do anything. My machine is AMD Athlon(tm) II X4 640 Processor × 4 so dont think its due to MIPS limitations. Any other advise welcome.


Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

Christian Bauer
Administrator
I have no idea why the test fails. Get your debugger out and step through the code.

Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

iank
Hi - I have spent a few hours trying to pick this up. Looking at the Java code, the SwitchPower Class is importing:-

import java.beans.PropertyChangeSupport;

My system cannot find this class. I have not been able to locate by standard means.

I am using Ubuntu 12.04 with IcedTea:-
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.3) (6b27-1.12.3-0ubuntu1~12.04.1)
OpenJDK Server VM (build 20.0-b12, mixed mode)

I am kind of running out of ideas as I have tried to install all latest libraries that are available for Ubuntu. I guess the next step is down try the Oracle jre and try to install by hand.

Any other suggestions ?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

iank
Managed to remove the import issue. My system did say that jre7 was installed but the <bin> file was still jre6.

I had to manually (as root):-

ln -s /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java /etc/alternatives/java

Where  /usr/bin/java -> /etc/alternatives/java

I Still have the failed test though

 Running TestSuite
 Tests run: 375, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 190.184 sec <<< FAILURE!

 Results :
 Failed tests:   invokeActions(example.controlpoint.ActionCancellationTest): expected:<true> but was:<false>

 Tests run: 375, Failures: 1, Errors: 0, Skipped: 0
Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

iank
Sorry for adding to this, but I really would like to get this going... [BTW I am learning on this job here also..]

I figured out that Maven was using the older Java Library also, so I added JAVA_HOME to point to the newer Java Library.

mvn -version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 13:51:28+0000)
Maven home: /home/ian/DEV/apache-maven-3.0.5
Java version: 1.7.0_15, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-i386/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-38-generic-pae", arch: "i386", family: "unix"

I have cleaned down my installation and pulled the git repro again.

Now my test failures give :-

Results :

Failed tests:   cancelled(org.fourthline.cling.test.transport.JDKServerApacheClientTest): expected:<true> but was:<false>
  cancelled(org.fourthline.cling.test.transport.JDKServerJettyClientTest): expected:<true> but was:<false>
  invokeActions(example.controlpoint.ActionCancellationTest): expected:<true> but was:<false>

Does this offer any further clues ?

I have tried Eclipse with m2e to perform a remote debug on the java process. Everything connects ok, but I cannot seem to breakpoint, so cannot inspect the class variables. I am think of switching to netbeans gui but have eclipse setup as I did some Android Dev with no issues.

I am hoping my feedback may help others in the same boat.

Ian
Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

Christian Bauer
Administrator
Your attempts to break your Linux install are probably successful, this is not how alternatives work. Also, you need a JDK (which you seem to have) to compile anything, not a JRE.

To actually work on the problem, do the following:

1. Edit core/src/test/resources/default-logging.properties and uncomment "org.fourthline.cling.level=FINEST".

2. Run this and use like I do an absolute path for the logging config file:

mvn -pl core -Djava.util.logging.config.file=/Users/cb/work/cling/master/core/src/test/resources/default-logging.properties -Dtest=example.controlpoint.ActionCancellationTest clean test

3. Post core/target/surefire-reports/example.controlpoint.ActionCancellationTest-output.txt here.

Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

iank
Thanks - yes, to be fair I probably can break things easier than fix then. Still, that's how we learn..

My command was


mvn -pl core -Djava.util.logging.config.file=/home/ian/DEV/CLING/cling/core/target/test-classes/default-logging.properties -Dtest=example.controlpoint.ActionCancellationTest clean test



cat ./core/target/surefire-reports/example.controlpoint.ActionCancellationTest.txt
-------------------------------------------------------------------------------
Test set: example.controlpoint.ActionCancellationTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.518 sec <<< FAILURE!
invokeActions(example.controlpoint.ActionCancellationTest)  Time elapsed: 2.09 sec  <<< FAILURE!
java.lang.AssertionError: expected:<true> but was:<false>
        at org.testng.Assert.fail(Assert.java:89)
        at org.testng.Assert.failNotEquals(Assert.java:489)
        at org.testng.Assert.assertEquals(Assert.java:118)
        at org.testng.Assert.assertEquals(Assert.java:281)
        at org.testng.Assert.assertEquals(Assert.java:291)
        at example.controlpoint.ActionCancellationTest.invokeActions(ActionCancellationTest.java:169)
Christian Bauer wrote
Your attempts to break your Linux install are probably successful, this is not how alternatives work. Also, you need a JDK (which you seem to have) to compile anything, not a JRE.

To actually work on the problem, do the following:

1. Edit core/src/test/resources/default-logging.properties and uncomment "org.fourthline.cling.level=FINEST".

2. Run this and use like I do an absolute path for the logging config file:

mvn -pl core -Djava.util.logging.config.file=/Users/cb/work/cling/master/core/src/test/resources/default-logging.properties -Dtest=example.controlpoint.ActionCancellationTest clean test

3. Post core/target/surefire-reports/example.controlpoint.ActionCancellationTest-output.txt here.
Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

Christian Bauer
Administrator
Wrong file.

3. Post core/target/surefire-reports/example.controlpoint.ActionCancellationTest-output.txt here.

Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

iank
Sorry - My bad. I have uploaded the file rather than waste the space in the reply

Here is the file : core/target/surefire-reports/example.controlpoint.ActionCancellationTest-output.txt
example.controlpoint.ActionCancellationTest-output.txt
Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

Christian Bauer
Administrator
Weird issue, the Java compiler silently removed a while(true) loop in the test under Linux. This test should work now.

I'm seeing some other failures in multithreaded tests on Linux but can't reproduce them right now, it works sometimes, so most likely a timing issue. Need to think about this some more.

Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

iank
Thanks - I am in some ways feel relieved that there is some odd stuff happening...

I have pulled the git-repro changes and tried again. The tests failed on :-

Failed tests:   cancelled(org.fourthline.cling.test.transport.JDKServerApacheClientTest): expected:<true> but was:<false>

(1) Strange thing is I ran again with debug and the test passed.

------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.fourthline.cling.test.transport.JDKServerApacheClientTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.835 sec

Results :

Tests run: 6, Failures: 0, Errors: 0, Skipped: 0

(2) Then I ran install and failed.

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running TestSuite
Tests run: 375, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 188.548 sec <<< FAILURE!

Results :

Failed tests:   cancelled(org.fourthline.cling.test.transport.JDKServerApacheClientTest): expected:<true> but was:<false>

(3) Again with debug for this target and it failed.
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running TestSuite
Tests run: 375, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 188.548 sec <<< FAILURE!

Results :

Failed tests:   cancelled(org.fourthline.cling.test.transport.JDKServerApacheClientTest): expected:<true> but was:<false>

JDKServerApacheClientTest-output.txt

org.fourthline.cling.test.transport.JDKServerApacheClientTest-output.txt
Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

Christian Bauer
Administrator
Well, I've now added some wait time for these tests and I no longer get failures.

Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

iank
Thanks Christian - much appreciate the efforts on this. I have pulled the git repro and updated ok.

I have re run the install using:-
 mvn clean install -Dandroid.sdk.path=<ANDROID-SDK-PATH> and got the failues
    Failed tests:   cancelled(org.fourthline.cling.test.transport.JDKServerApacheClientTest): expected:<true> but was:<false>
    cancelled(org.fourthline.cling.test.transport.JDKServerJettyClientTest): expected:<true> but was:<false>

    Tests run: 375, Failures: 2, Errors: 0, Skipped: 0

I then ran in debug mode the one test :-

#########################################################################################################
mvn -pl core -Djava.util.logging.config.file=/home/ian/DEV/CLING/cling/core/target/test-classes/default-logging.properties -Dtest=test.transport.JDKServerApacheClientTest clean test

Running org.fourthline.cling.test.transport.JDKServerApacheClientTest
Tests run: 6, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 16.865 sec <<< FAILURE!

Results :

Failed tests:   cancelled(org.fourthline.cling.test.transport.JDKServerApacheClientTest): expected:<true> but was:<false>

Tests run: 6, Failures: 1, Errors: 0, Skipped: 0
#######################################################################################################

Here is a link to the file /org.fourthline.cling.test.transport.JDKServerApacheClientTest-output.txt

org.fourthline.cling.test.transport.JDKServerApacheClientTest-output.txt

#####################################################################################################

I have taken my PC off the network (incase a uPnP device is causing problems) and still no joy.

Any additional ideas ?

Is there a method to not run these tests so that I may progress ?

Thanks
Ian
Reply | Threaded
Open this post in threaded view
|

Re: Build error for Cling 2.0-SNAPSHOT on Ubuntu 10.04

Christian Bauer
Administrator
-DskipTests=true
12