H5BP Ant-contrib 1.1.1 not working - ant

When I update to ant build script V1.1.1 in a known successful v1.0 file, the script runs through to "BUILD SUCCESSFUL", but the publish directory is incorrect. CSS appears to be compressed OK. Main.js is mangled, but empty. HTML files are not compressed. Terminal (OSX 10.9.5)reports the following error message:
-htmlcompress:
[echo] Run htmlcompressor on the HTML
[echo] - removing unnecessary whitespace
[echo] - removing html comments
[echo] - compressing inline style/script tag contents
[apply] Exception in thread "main" java.lang.NoSuchMethodError: com.yahoo.platform.yui.compressor.JavaScriptCompressor.compress(Ljava/io/Writer;IZZZZ)V
[apply] at com.googlecode.htmlcompressor.compressor.YuiJavaScriptCompressor.compress(YuiJavaScriptCompressor.java:54)
[apply] at com.googlecode.htmlcompressor.compressor.HtmlCompressor.compressJavaScript(HtmlCompressor.java:975)
[apply] at com.googlecode.htmlcompressor.compressor.HtmlCompressor.processScriptBlocks(HtmlCompressor.java:910)
[apply] at com.googlecode.htmlcompressor.compressor.HtmlCompressor.processPreservedBlocks(HtmlCompressor.java:800)
[apply] at com.googlecode.htmlcompressor.compressor.HtmlCompressor.compress(HtmlCompressor.java:221)
[apply] at com.googlecode.htmlcompressor.CmdLineCompressor.process(CmdLineCompressor.java:275)
[apply] at com.googlecode.htmlcompressor.CmdLineCompressor.main(CmdLineCompressor.java:109)
[apply] Result: 1
Did V1.1.1 make changes beyond updating yuicompressor? I don't see anything in v1.1.1 project.xml that needs changing from V1.0. What am I missing here?

Related

Try-Catch exception in XML

While deploying SOA composites using ant, the deployment fails due to the following error:
[echo]
[echo] ERROR IN TRYCATCH BLOCK:
[echo] /home/oracle/deploymentScripts/build.soa.xml:108: The following error occurred while executing this line:
[echo] /home/oracle/deploymentScripts/build.soa.xml:123: The following error occurred while executing this line:
[echo] /u01/oracle/middleware/Oracle_Home/soa/bin/ant-sca-package.xml:51: The following error occurred while executing this line:
[echo] /u01/oracle/middleware/Oracle_Home/soa/bin/ant-sca-compile.xml:342: Java returned: 1 Check log file : /tmp/out.err for errors
[echo]
[echo] **************************************************************
[echo] *
[echo] * ANT TARGET NAME: deployComposites
[echo] * FAILED PROCESS: UpdateGoNoGoApprovalCRMOD
[echo] ***
This is a part of the buildsoa.xml file.
I'm not actually getting what might be the error.
Kindly help me with this please.
Check your Java home path in your .bat file, and make sure the Java home path is set correctly (please check your Java installation path in your system).
Also check the Java home path in the environment variables of your system.

Jenkins CI: 'NumberFormatException: empty String'

We have a Jenkins installation and some projects which are tested by NUnit. This works fine and it writes an NUnit results XML file.
Then we have a 'Publish NUnit test result report' post-build step. But since friday it produces this error:
Recording NUnit tests results
ERROR: Step ‘Publish NUnit test result report’ aborted due to exception:
java.io.IOException: remote file operation failed: C:\Jenkins\workspace\xxx at hudson.remoting.Channel#205d5d5c:CIAgent: java.io.IOException: Failed to read C:\Jenkins\workspace\xxx\temporary-junit-reports\TEST-xxx_Tests.TestsWithRealServers.TestWithTwoLocals_1_2.xml
at hudson.FilePath.act(FilePath.java:986)
at hudson.FilePath.act(FilePath.java:968)
at hudson.plugins.nunit.NUnitPublisher.getTestResult(NUnitPublisher.java:226)
[...]
Caused by: java.io.IOException: Failed to read C:\Jenkins\workspace\xxx\temporary-junit-reports\TEST-xxx_Tests.TestsWithRealServers.TestWithTwoLocals_1_2.xml
at hudson.tasks.junit.TestResult.parse(TestResult.java:306)
at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:244)
at hudson.tasks.junit.TestResult.parse(TestResult.java:175)
[...]
... 13 more
Caused by: java.lang.NumberFormatException: empty String
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at sun.misc.FloatingDecimal.parseFloat(Unknown Source)
at java.lang.Float.parseFloat(Unknown Source)
[...]
Archiving artifacts
Finished: FAILURE
The XML file is present in the working directory. I mentioned that the first line of this file looks like this:
<?xml version="1.0" encoding="UTF-8"?><testsuite errors="0" failures="0" name="xxx_Tests.TestsWithRealServers.TestWithTwoLocals" skipped="6" tests="6" time="">
So I guess it fails because the time attribe is empty.
Does anyone how I can fix this or why this error occurs?
Thanks!
Did you recently upgrade the jenkins JUnit plugin to 1.12? There is a reported issue in this update. You might try downgrading back to 1.11.
By the way, Jenkins plugins does not support Nunit 3 XML format. I also had a similar problem on Jenkins. I used to convert Nunit 3 result format to Nunit 2 format.
"C:\NUnit 3.5.0\nunit3-console.exe" /result:\MyApplication.xml;format=nunit2 "D:\Jenkins\workspace\MyApplication.Tests.dll"

"Resource not found" trying to add junit tests into sonarqube

I am trying to associate junit test results with SonarQube.
Here is what I have for Sonar Properties:
sonar.projectKey=FXX
sonar.projectName=FUTURE_Jason
sonar.projectVersion=12.9.0
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.tests=test-build/junit/classes/
sonar.junit.reportsPath=test-build/junit/reports
When executing a Jenkins job associated with SonarQube, I am receiving the following warnings:
13:52:12.923 INFO - Sensor SurefireSensor
13:52:12.924 INFO - parsing /var/lib/jenkins/jobs/FUTURE_SONAR_Jason/workspace/test-build/junit/reports
13:52:13.472 WARN - Resource not found: msc.rc.model.AbstractTrackingUpdateTest
In the Jenkins workspace I have the directory test-build and it includes both the reports and classes.
$ ll /var/lib/jenkins/jobs/FUTURE_SONAR_Jason/workspace/test-build/junit/classes/msc/rc/model/AbstractTrackingUpdateTest.class
-rwxr-xr-x 1 build build 9590 Dec 14 14:39 /var/lib/jenkins/jobs/FUTURE_SONAR_Jason/workspace/test-build/junit/classes/msc/rc/model/AbstractTrackingUpdateTest.class
Any idea what I am missing?
I changed the sonar.tests property to point to the .java files, problem is now resolved.

Ant Build failing because of wrong classpath to JBoss server

How can I fix it or where do I fix it?
It should point to:
C:\jboss\jboss-5.1.0.GA\server\default\lib
Console log
C:\PSC Updated\src>ant build-ejb
Buildfile: C:\PSC Updated\src\build.xml
clean:
build-core:
[mkdir] Created dir: C:\PSC Updated\src\build\classes
[javac] Compiling 159 source files to C:\PSC Updated\src\build\classes
BUILD FAILED
C:\PSC Updated\src\build.xml:110: C:\home\apps\jboss-5.1.0.GA\server\default\lib does not exist.
Worked: When I pointed to my {jboss.home}\server\default\lib
Try double slash for windows path on ant files.
C:\\jboss\\jboss-5.1.0.GA\\server\\default\\lib
Could you post your build.xml for more clarification.

Target "run" does not exist in the project "barbecue"

I want to run a sample demo for JasperReport, so I downloaded the file but when I type the following in my windows 7 command line according to the Jasperreport documentation :
C:\jasperreports-4.7.0\demo\samples\barbecue>ant run
I got the following error:
Target "run" does not exist in the project "barbecue" .
So what might be the problem ?
::UPDATED::
After i typed ant –p in my CMD i got the following :-
C:\jasperreports-4.7.0\demo\samples\barbecue>ant -p
Buildfile: C:\jasperreports-4.7.0\demo\samples\barbecue\build.xml
Shows how barcodes could be included in reports using the Barbecue component.
Main targets:
clean Deletes all the generated files.
compile Compiles the XML report design and produces the .jasper file.
csv Generates a CSV version of the report by converting the .jrprint
file.
decompile Decompiles a .jasper file into a .jrxml file.
docx Generates a DOCX version of the report by converting the .jrprin
t file.
fill Fills the compiled report design with data and produces the .jrp
rint file.
html Generates an HTML version of the report by converting the .jrpri
nt file.
javac Compiles the java source files of the test application.
jxl Generates an XLS version of the report by converting the .jrprin
t file using the JExcelApi library.
ods Generates an ODS version of the report by converting the .jrprin
t file.
odt Generates an ODT version of the report by converting the .jrprin
t file.
pdf Generates a PDF version of the report by converting the .jrprint
file.
pptx Generates a PPTX version of the report by converting the .jrprin
t file.
print Sends the report in the .jrprint file to the printer.
rtf Generates an RTF version of the report by converting the .jrprin
t file.
test Runs the sample.
view Launches the report viewer to preview the report stored in the .
jrprint file.
viewDesign Launches the design viewer to preview the compiled report design
.
viewDesignXml Launches the design viewer to preview the XML report design.
viewXml Launches the report viewer to preview the generated report store
d in an XML file.
writeApi Generates a .java version of the report by converting the .jrxml
file.
writeApiXml Generates a .jrxml version of the report by executing the API ve
rsion of the report design.
xhtml Generates an XHTML version of the report by converting the .jrpr
int file.
xls Generates an XLS version of the report by converting the .jrprin
t file using the POI library.
xlsx Generates an XLSX version of the report by converting the .jrpri
nt file.
xml Generates an XML version of the report by converting the .jrprin
t file.
xmlEmbed Generates an XML version of the report by converting the .jrprin
t file.
Default target: test
:::::UPDATED2:::::
i type ant test for the charts demo but the problem is still there:-
C:\jasperreports-4.7.0\demo\samples\charts>ant test
Buildfile: C:\jasperreports-4.7.0\demo\samples\charts\build.xml
test:
[echo] ===================================
[echo] Charts Sample
[echo] ===================================
clean:
clean-sample:
javac:
javac:
[mkdir] Created dir: C:\jasperreports-4.7.0\demo\samples\charts\build\classe
s
[javac] C:\jasperreports-4.7.0\demo\samples\build.xml:41: warning: 'includea
ntruntime' was not set, defaulting to build.sysclasspath=last; set to false for
repeatable builds
[javac] Compiling 2 source files to C:\jasperreports-4.7.0\demo\samples\char
ts\build\classes
[javac] warning: [options] bootstrap class path not set in conjunction with
-source 1.6
[javac] Note: C:\jasperreports-4.7.0\demo\samples\charts\src\ChartsApp.java
uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 warning
[copy] Copied 5 empty directories to 5 empty directories under C:\jasperrep
orts-4.7.0\demo\samples\charts\build\classes
compile:
compile:
[mkdir] Created dir: C:\jasperreports-4.7.0\demo\samples\charts\build\report
s
[jrc] Compiling 24 report design files.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\MultipleAx
isChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\XYBarChart
TimePeriodReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\XYAreaChar
tReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\Pie3DChart
Report.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\StackedBar
3DChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\MeterChart
Report.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\XYBarChart
Report.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\StackedAre
aChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\Candlestic
kChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\HighLowCha
rtReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\XYLineChar
tReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\BubbleChar
tReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\Thermomete
rChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\StackedBar
ChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\ScatterCha
rtReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\TimeSeries
ChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\SubDataset
ChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\AreaChartR
eport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\LineChartR
eport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\XYBarChart
TimeSeriesReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\GanttChart
Report.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\PieChartRe
port.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\Bar3DChart
Report.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\BarChartRe
port.jrxml ... OK.
test:
[java] net.sf.jasperreports.engine.JRException: java.sql.SQLException: sock
et creation error
[java] at net.sf.jasperreports.engine.util.AbstractSampleApp.getDemoHsq
ldbConnection(AbstractSampleApp.java:158)
[java] at ChartsApp.fill(ChartsApp.java:83)
[java] at ChartsApp.test(ChartsApp.java:63)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:57)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:601)
[java] at net.sf.jasperreports.engine.util.AbstractSampleApp.executeTas
k(AbstractSampleApp.java:94)
[java] at net.sf.jasperreports.engine.util.AbstractSampleApp.main(Abstr
actSampleApp.java:179)
[java] at ChartsApp.main(ChartsApp.java:54)
[java] Caused by: java.sql.SQLException: socket creation error
[java] at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
[java] at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
[java] at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
[java] at org.hsqldb.jdbcDriver.connect(Unknown Source)
[java] at java.sql.DriverManager.getConnection(DriverManager.java:579)
[java] at java.sql.DriverManager.getConnection(DriverManager.java:221)
[java] at net.sf.jasperreports.engine.util.AbstractSampleApp.getDemoHsq
ldbConnection(AbstractSampleApp.java:150)
[java] ... 9 more
BUILD SUCCESSFUL
Total time: 8 seconds
C:\jasperreports-4.7.0\demo\samples\charts>ant run
Buildfile: C:\jasperreports-4.7.0\demo\samples\charts\build.xml
BUILD FAILED
Target "run" does not exist in the project "charts".
Total time: 0 seconds
Java errors are like a car accident. One car will hit another which causes the first to careen into a street light. The street light topples over and hits a gasoline truck which explodes.
In the end, you have destruction, fire, and death. However, the whole thing started because the driver was too busy texting and didn't stop at a stop sign.
You have a long, long list of error messages, but what's important are those at the very beginning:
net.sf.jasperreports.engine.JRException: java.sql.SQLException: socket creation error
[java] at net.sf.jasperreports.engine.util.AbstractSampleApp.getDemoHsqldbConnection(AbstractSampleApp.java:158)
This is a socket creation error.
This error seems to point out that you can't connect to the server or the database.
And, that's about as far as I can get with this. I really don't know Jasper, but I did find this. Does that help you at all?
Is there a server you should be running, or a database you need to connect to that's not created? Do you have a firewall that's preventing connecting to the server/database. (I'm leaning towards the database issue because I do see stuff about hsqldb and sql in your error message.
I take it you're not a Java developer because you seemed confused by Ant and it's build.xml file. Is there someone who can help you with this? If you can, look at the build.xml and see what the target test is doing. It's running a Java command, and you can try running that command outside of Ant. Sometimes, that will give you a bit more information.
You should run ant test command for run the sample (cleaning, compiling and generating the report in all formats: xls, pdf, etc.).
For viewing report in JRViewer you should run ant view command.
The result (output) for ant test will be:
d:\java\jasperreports-4.5.1\demo\samples\barbecue>ant test
Buildfile: d:\java\jasperreports-4.5.1\demo\samples\barbecue\build.xml
test:
[echo] ===================================
[echo] Barbecue Sample
[echo] ===================================
clean:
clean-sample:
javac:
javac:
[mkdir] Created dir: d:\java\jasperreports-4.5.1\demo\samples\barbecue\build
\classes
[javac] d:\java\jasperreports-4.5.1\demo\samples\build.xml:41: warning: 'inc
ludeantruntime' was not set, defaulting to build.sysclasspath=last; set to false
for repeatable builds
[javac] Compiling 1 source file to d:\java\jasperreports-4.5.1\demo\samples\
barbecue\build\classes
compile:
compile:
[mkdir] Created dir: d:\java\jasperreports-4.5.1\demo\samples\barbecue\build
\reports
[jrc] Compiling 1 report design files.
[jrc] File : d:\java\jasperreports-4.5.1\demo\samples\barbecue\reports\Bar
becueReport.jrxml ... OK.
test:
[java] Filling time : 3198
[java] PDF creation time : 993
[java] XML creation time : 224
[java] XML creation time : 44
[java] HTML creation time : 109
[java] RTF creation time : 98
[java] XLS creation time : 364
[java] XLS creation time : 248
[java] CSV creation time : 6
[java] ODT creation time : 95
[java] ODS creation time : 12
[java] DOCX creation time : 183
[java] XLSX creation time : 103
[java] PPTX creation time : 74
[java] XHTML creation time : 56
BUILD SUCCESSFUL
Total time: 13 seconds
The reaction on the net.sf.jasperreports.engine.JRException: java.sql.SQLException: sock
et creation error exception:
The sample that you are trying to start is using connection to the HSQLDB server. For starting DB you should run ant runServer command from the demo/hsqldb folder.
For more details how to run sample you can read this post

Resources