Setting -XdisableCastChecking to true - gwt

I need to set -XdisableCastChecking to true for building a GWT application (with Eclipse).
I know how to do it to compile the application but I'm not able to set -XdisableCastChecking to true for building the war file (I'm using a build.xml and file).
Does anybody know how to include this flag into the ant file?
Thank you in advance.
Alsila

If you are using a standard build.xml generated with the wepAppCreator, you should have at the top of your build.xml something like the block below. Modify the gwt.args line adding the arguments you want to pass to the gwt compiler:
<?xml version="1.0" encoding="utf-8" ?>
<project name="myproject" default="build" basedir=".">
<!-- Arguments to gwtc and devmode targets -->
<property name="gwt.args" value="-XdisableCastChecking" />
[...]

Related

Unbound classpath container: 'JRE System Library [adoptopenjdk-11]' in project '' with Processing

I want to get processing 4 working in VSCode.
https://github.com/processing/processing4
Right not I get several errors that look like:
Unbound classpath container: 'JRE System Library [adoptopenjdk-11]' in project ''
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="adoptopenjdk-11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
It is not a maven or a graddle project, and I prefer to keep it that way if possible (e.g. using a settings.json).
Hope someone can help fix this error.

Eclipse Maven Update cleans jaxb generated classes and Regenerates them without taking the class name tag into account

I have troubles with eclipse / maven in Netbeans it's working as expected.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jxb:bindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/jxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
jxb:extensionBindingPrefixes="xjc"
version="2.1">
<jxb:bindings schemaLocation="http://myserver/schemas/CustomerOrder_v1.7.xsd" node="/xsd:schema">
<jxb:bindings node="//xsd:element[#name='customerOrder']">
<jxb:class name="ElectronicCustomerOrder"/>
</jxb:bindings>
<jxb:bindings node="//xsd:element[#name='deliveryDate']" multiple="true">
<xjc:javaType adapter="com.prodega.xml.JodaTimeDateAdapter" name="org.joda.time.LocalDate" />
</jxb:bindings>
</jxb:bindings>
</jxb:bindings>
if i do a maven update in eclipse (photon or mars) it generates a class called CustomerOrder into the target:
image
But i'm expecting a class named ElectronicCustomerOrder. As soon i make a change in the xjb file and save it, it renames the class in the target folder. But then the building workspace part is done and it didn't find the class ElectronicCustomerOrder. Can someone Tell me what's happening here since it's anoying to build on commandline and then do a refresh in eclipse.
A normal mvn clean install command will work also properly.

error while building project using Nant

I have file pro.build:
<?xml version="1.0" ?>
<project name="NAnt.NUnit2ReportTasks" default="build" basedir=".">
<sysinfo />
<target name="nunitreport">
<nunit2report out="HTML_TestResults.html">
<fileset>
<includes name="NUnitTestResult.xml" />
</fileset>
</nunit2report>
<echo message="HTML Test report generated." />
</target>
</project>
From command prompt(DOS), I am giving command,
Nant -buildfile:pro.build
But I am getting error
Target 'build' does not exist in this project
Can you help me resolving this?
With <project>'s default attribute you specify the target which should be executed if no other target is specified on the command line.
Problem: On the command line you're calling Nant -buildfile:pro.build so you are not specifying a target there. NAnt tries to execute default target build which is not present and fails.
Solution: Either you specify target nunitreport on the command line by calling Nant -buildfile:pro.build nunitreport. But since specifying a non-existent default target in your build file doesn't make much sense, I would suggest changing the default target:
<project name="NAnt.NUnit2ReportTasks" default="nunitreport" basedir=".">
<!-- ... -->
</project>
Specifing complete path for the buildfile could resolve the issue
nant –buildfile:"c:\FolderpathofAppdotbuildfileGoesHere\buildfilename.build"

failed to run wicket examples on tomcat7

I downloaded wicket examples 1.6.0 and built successfully in netbeans7.2. but got errors when I tried to deploy on tomcat 7:
Cannot deploy the module. The context.xml file seems to be broken. Check whether it is well-formed and valid.
The module has not been deployed.
See the server log for details.
at
org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:210)
at
org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:178)
at
org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:130)
at
org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:212)
at
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
heres the contents in context.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<!-- <Loader className="org.atmosphere.util.AtmosphereClassloader"/> -->
<Loader delegate="true"/>
</Context>
I prefer to run wicket in eclipse as it negates the requirement to mess around with an external tomcat instance.
If you are comfortable with eclipse and maven i would download wicket 1.6 example archetype via maven, import into eclipse and then in the test directory you can run the run.java class to get an internal jetty server host wicket for you.
this should get you started quickly without having to wrestle with tomcat configurations too.
Not really an answer but an alternative route to the same end point
Add parameter path to context tag, same path that app will be served:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/application-path-name/">
<!-- <Loader className="org.atmosphere.util.AtmosphereClassloader"/> -->
<Loader delegate="true"/>
</Context>
Answer obtained from this question.

how to encode in Ant

I have a test script:
<?xml version="1.0" encoding="UTF-8"?>
<project name="test" basedir=".">
<echo encoding="UTF-8" file="test.txt">测试</echo>
</project>
When I open test.txt. I only see "??"
Something more weird. The script run with no problem using Eclipse Ant tool, but it has problem with command line.
Both Eclipse and cmd are using the same Ant lib.
Use this encoding :
<echo encoding="UnicodeLittleUnmarked" file="test.txt">测试</echo>
And you will get the correct result in your file.
I found the reason.
Before running the Ant script, I need to set a system property:
Set ANT_OPTS=-D"file.encoding=UTF-8"
Then
<project name="test" basedir=".">
<echo file="test.txt">测试</echo>
</project>
runs successfully even if there is no encoding in the echo.
Can anyone tells me why the original one doesn't work?