The default ant settings in Netbeans has the property build.compiler.emacs set to true. What does this mean? The ant documentation just says
Enable emacs-compatible error messages.
I understand emacs is an editor, though I have not used it. What is the effect of setting this property to true or false?
You might not have noticed that that part of the ant documentation describing the javac task is in the "Jikes notes". It's a setting that modifies the result message format of a compilation while using the jikes compiler in a way that when ant is invoked by the Emacs editor (e.g. while using the JDEE environment), the editor can parse the result messages and jump at correct positions in the files related to the messages.
It is indeed a bit weird that NB includes such a setting for a compiler that is not the standard one and seems abandoned for almost a decade.
Given the following ant build.xml file
<project name="mini" basedir="." default="compile">
<property name="build.compiler.emacs" value="off"/>
<property name="build.compiler" value="jikes"/><!-- invoke jikes instead of javac-->
<target name="compile">
<javac srcdir="." destdir="" classpath="." includeantruntime="false">
</javac>
</target>
</project>
The compilation of a simple class comporting a syntax error gives that output:
Buildfile: /Users/seb/projets/java/ant/build.xml
compile:
[javac] Compiling 1 source file to /Users/seb/projets/java/ant
[javac]
[javac] Found 1 semantic error compiling "Hello.java":
[javac]
[javac] 5. System.out.println("Hello, World!"+foo);
[javac] ^-^
[javac] *** Semantic Error: No accessible field named "foo" was found in type "Hello".
BUILD FAILED
/Users/seb/projets/java/ant/build.xml:5: Compile failed; see the compiler error output for details.
Total time: 1 second
While you have this output by changing build.compiler.emacs property to on:
Buildfile: /Users/seb/projets/java/ant/build.xml
compile:
[javac] Compiling 1 source file to /Users/seb/projets/java/ant
[javac] Hello.java:5:52:5:54: Semantic Error: No accessible field named "foo" was found in type "Hello".
BUILD FAILED
/Users/seb/projets/java/ant/build.xml:5: Compile failed; see the compiler error output for details.
Total time: 1 second
In the latter version, the messages are less fancy and Emacs is more capable of parsing them.
Related
I wonder if I am doing something wrong, or if I have stumbled upon a bug in LibGDX/GWT. I have a game with desktop/Android/iOS/HTML backends and upgrading to 1.9.5 from 1.9.5-SNAPSHOT from about a month ago made the HTML build stop working. The main change I can see is the upgrade to GWT 2.8.0 from 2.6.0.
When I run my app in a browser (Chrome 56.0.2924.21 beta (64-bit) on Windows 10), I get the following error:
GwtApplication: exception: com.badlogic.gdx.utils.SerializationException: Error reading file: static/uiskin_hd.json
com.badlogic.gdx.utils.SerializationException: Error reading file: static/uiskin_hd.json
Error reading file: static/uiskin_hd.json
Error reading file: static/uiskin_hd.json
Error loading bitmap font: static/helsinki28plain_hd.fnt
Error loading font file: static/helsinki28plain_hd.fnt
Invalid page id:
For input string: ""
The font has been working previously and I get the same result with any font, including default.fnt from LibGDX tests. The top of the font file looks like this:
info face="Helsinki" size=56 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=2,2,8,4 spacing=0,0
common lineHeight=75 base=52 scaleW=512 scaleH=1024 pages=1 packed=0
page id=0 file="helsinki28plain_hd.png"
chars count=141
char id=32 x=0 y=0 width=0 height=0 xoffset=0 yoffset=52 xadvance=22 page=0 chnl=0
char id=92 x=0 y=0 width=24 height=72 xoffset=-2 yoffset=0 xadvance=22 page=0 chnl=0
char id=47 x=24 y=0 width=24 height=72 xoffset=-2 yoffset=0 xadvance=22 page=0 chnl=0
...
Just to make sure the problem isn't with my setup, I checked out the latest master branch of LibGDX and tried to run the GWT tests:
git clone https://github.com/libgdx/libgdx.git
cd libgdx
ant -f fetch
ant
./gradlew tests:gdx-tests-gwt:draftRun
This also seems to fail:
Compiling module com.badlogic.gdx.tests.gwt.GdxTestsGwt
Finding entry point classes
[ERROR] Errors in 'file:/C:/devtools/libgdx/gdx/src/com/badlogic/gdx/Net.java'
[ERROR] Line 80: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
[ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtNet.java'
[ERROR] Line 70: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
[ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/preloader/Preloader.java'
[ERROR] Line 200: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
[ERROR] Line 203: No source code is available for type java.io.ByteArrayInputStream; did you forget to inherit a required module?
[ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/com/badlogic/gdx/files/FileHandle.java'
[ERROR] Line 78: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
[ERROR] Errors in 'file:/C:/devtools/libgdx/gdx/src/com/badlogic/gdx/net/Socket.java'
[ERROR] Line 41: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
[ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/preloader/Blob.java'
[ERROR] Line 38: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
[ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/io/BufferedInputStream.java'
[ERROR] Line 19: No source code is available for type java.io.FilterInputStream; did you forget to inherit a required module?
[ERROR] Line 20: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
[ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/io/Reader.java'
[ERROR] Line 33: No source code is available for type java.io.Closeable; did you forget to inherit a required module?
[ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/io/Writer.java'
[ERROR] Line 30: No source code is available for type java.io.Closeable; did you forget to inherit a required module?
[ERROR] Line 30: No source code is available for type java.io.Flushable; did you forget to inherit a required module?
[ERROR] Unable to find type 'com.badlogic.gdx.tests.gwt.client.GwtTestStarter'
[ERROR] Hint: Previous compiler errors may have made this type unavailable
[ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
:tests:gdx-tests-gwt:draftCompileGwt FAILED
Any ideas what is going on here? (My Java SDK is jdk1.8.0_20)
Looks like this is a bug in LibGDX 1.9.5. A couple of people have submitted pull requests to fix it, so I expect there will shortly be a 1.9.6-SNAPSHOT available fixing this issue.
https://github.com/libgdx/libgdx/pull/4475
https://github.com/libgdx/libgdx/pull/4467
Is there a way i can automatically generate orm.xml file in Netbeans even if i can modify it later. Am using eclipselink JPA 2.1 and it keeps giving me this warning when am building
warning: Supported source version 'RELEASE_6' from annotation processor 'org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor' less than -source '1.7'
Note: Creating non-static metadata factory ...
Note: Found Option : eclipselink.canonicalmodel.use_static_factory, with value: false
Note: Optional file was not found: META-INF/orm.xml continuing with generation.
Note: Optional file was not found: META-INF/eclipselink-orm.xml continuing with generation.
Note: Found Option : eclipselink.canonicalmodel.use_static_factory, with value: false
Note: Optional file was not found: META-INF/orm.xml continuing with generation.
Note: Optional file was not found: META-INF/eclipselink-orm.xml continuing with generation.
warning: The following options were not recognized by any processor: '[eclipselink.canonicalmodel.use_static_factory]'
Note: C:\Users\USER\Documents\NetBeansProjects\payroll\src\dcl\payroll\GUI\Login.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
The warning is just there to let you know that if you are using an orm.xml to define your mappings, it wasn't found. If you place one there, you will still get messages letting you know one was found. This gives a notice in the log to help point where to start looking if something unexpected in your application occurs - such as the wrong orm.xml version is used or one is unexpectedly packaged and picked up, which seems a common issue in development.
I am developing a simple web application. I am using sencha(gxt) framework to display chart to user.
When I am compiling the project, I am getting following errors.
[ERROR] Errors in 'file:/E:/eclipse%20Workspace/Chart_Demo/src/com/project/client/Chart_Demo.java'
[ERROR] Line 74: No source code is available for type com.sencha.gxt.chart.client.chart.Chart<M>; did you forget to inherit a required module?
[ERROR] Line 78: No source code is available for type com.sencha.gxt.chart.client.draw.Gradient; did you forget to inherit a required module?
[ERROR] Line 79: No source code is available for type com.sencha.gxt.chart.client.draw.RGB; did you forget to inherit a required module?
[ERROR] Line 84: No source code is available for type com.sencha.gxt.chart.client.chart.axis.CategoryAxis<M,V>; did you forget to inherit a required module?
[ERROR] Line 85: No source code is available for type com.sencha.gxt.chart.client.chart.Chart<M>.Position; did you forget to inherit a required module?
[ERROR] Line 87: No source code is available for type com.sencha.gxt.chart.client.draw.sprite.TextSprite; did you forget to inherit a required module?
[ERROR] Line 102: No source code is available for type com.sencha.gxt.chart.client.chart.series.BarSeries<M>; did you forget to inherit a required module?
[ERROR] Unable to find type 'com.project.client.Chart_Demo'
[ERROR] Hint: Previous compiler errors may have made this type unavailable
[ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
Exception in thread "pool-1-thread-1" java.lang.RuntimeException: Unable to read from byte cache
Please help me to resolve this issue.
wilome is right. The <inherits>-tags in the module descriptor are missing.
But it looks like Ranjeet is using GXT 3.
In this case it schould be:
<inherits name='com.sencha.gxt.ui.GXT'/>
<inherits name='com.sencha.gxt.chart.Chart' />
You need to inherit the GXT modules in your main module (yourapp.gwt.xml)
<inherits name="com.extjs.gxt.ui.GXT" />
<inherits name="com.extjs.gxt.themes.Themes" />
<inherits name="com.extjs.gxt.charts.Chart" />
GWT compilation fails in eclipse saying the following reason. This used to happen sometimes. Eclipse project clean would solve the issue. But now it doesn seem to work. Any actual issues that might be present? Thanks.
Compiling module com.kivar.lumina.Application
Validating units:
Ignored 9 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[ERROR] Errors in 'file:/F:/dev/insanity/agni/client/src/main/java/com/kivar/lumina/shared/requestfactory/requestcontext/SearchRequestContext.java'
[ERROR] Line 9: The import com.kivar.lumina.server.filter.FilterConfiguration cannot be resolved
[ERROR] Line 17: FilterConfiguration cannot be resolved to a type
Computing all possible rebind results for 'com.kivar.lumina.shared.requestfactory.ApplicationRequestFactory'
Rebinding com.kivar.lumina.shared.requestfactory.ApplicationRequestFactory
Checking rule <generate-with class='com.google.web.bindery.requestfactory.gwt.rebind.RequestFactoryGenerator'/>
[ERROR] Errors in 'file:/F:/dev/insanity/agni/client/src/main/java/com/kivar/lumina/shared/requestfactory/requestcontext/CampaignRequestContext.java'
[ERROR] Line 9: The import com.kivar.lumina.server.campaign.CampaignsServiceImpl cannot be resolved
[ERROR] Line 18: CampaignsServiceImpl cannot be resolved to a type
[ERROR] Errors in 'file:/F:/dev/insanity/agni/client/src/main/java/com/kivar/lumina/shared/requestfactory/requestcontext/SearchRequestContext.java'
[ERROR] Line 9: The import com.kivar.lumina.server.filter.FilterConfiguration cannot be resolved
[ERROR] Line 17: FilterConfiguration cannot be resolved to a type
[ERROR] Unable to find type 'com.kivar.lumina.shared.requestfactory.ApplicationRequestFactory'
[ERROR] Hint: Previous compiler errors may have made this type unavailable
[ERROR] Hint: Your source appears not to live underneath a subpackage called 'client';.....
From the error it is visibly seen that there is something wrong with the import with specifically below :
[ERROR] Errors in 'file:/F:/dev/insanity/agni/client/src/main/java/com/kivar/lumina/shared/requestfactory/requestcontext/SearchRequestContext.java'
[ERROR] Line 9: The import com.kivar.lumina.server.filter.FilterConfiguration cannot be resolved
Please either add the jar if you want to use FilterConfiguration. Or else, choose the src folder of the project >> Right Click >> Go to Source >> Click on unorganized imports.
It will remove all the imports which are not required for project.
From the log I can't say for sure but I can guess that in your RequestContext definitions you are declaring the service implementation. You should declare the service interface instead.
EDIT:
If a member of the Steering Committee says my answer is not clear it is probably true.
Apologies and I'll try to be more explicit.
From the log looks like there is some server class (i.e. a class that is executed on the application server; given that the log shows an error from the RequestFactory I presume we are in the middle of some client-server communication here) which is declared in the RequestFactory definition file: ApplicationRequestFactory.java.
In particular, I would expect that some parameter in some method of the interface SearchRequestContext is of type FilterConfiguration. This is wrong, you should use the relative proxy instead.
Moreover, looks like in the annotation for SearchRequestContext something like this has been declared:
#Service(value=CampaignsServiceImpl.class"...
interface SearchRequestContext extends RequestContext{
...
This is also wrong because instead of using the service implementation (i.e. CampaignsServiceImpl) you have to use an interface that is implemented by CampaingsServiceImpl (i.e. the service interface) and that exposes the methods defined in SearchRequestContext, obviously with the necessary translation for the request factory receivers.
This implementation details you can find in the request factory documentation available here: look up for the paragraph RequestFactory interface.
I hope this all makes sense to you. Please feel free to get back with questions. In case please post your RequestFactory definition file (i.e. the java interface that extends RequestFactory)
I try to run a example code from a book and it gives errors like:
[DEBUG] [rpc] - Validating newly compiled units
[ERROR] [rpc] - Errors in 'file:/D:/UserData/ge000001/workspace/RPC/src/rpc/client/HelloService.java'
[ERROR] [rpc] - Line 8: No source code is available for type rpc.server.Person; did you forget to inherit a required module?
[ERROR] [rpc] - Errors in 'file:/D:/UserData/ge000001/workspace/RPC/src/rpc/client/HelloServiceAsync.java'
[ERROR] [rpc] - Line 9: No source code is available for type rpc.server.Person; did you forget to inherit a required module?
[ERROR] [rpc] - Errors in 'file:/D:/UserData/ge000001/workspace/RPC/src/rpc/client/RPC.java'
[ERROR] [rpc] - Line 106: No source code is available for type rpc.server.Person; did you forget to inherit a required module?
[TRACE] [rpc] - Finding entry point classes
[ERROR] [rpc] - Unable to find type 'rpc.client.RPC'
[ERROR] [rpc] - Hint: Previous compiler errors may have made this type unavailable
[ERROR] [rpc] - Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
[ERROR] [rpc] - Failed to load module 'rpc' from user agent 'Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1' at localhost:1802
these type errors occurs tomany times with tdifferent project and I cannot get the reason why?
Do you have any idea or suggestion?
It means that for some reason GWT cannot find a class you're including in your code.
These errors usually occurs, and can be quite confusing, when something is fundamentally wrong with the configuration; usually something small and silly that breaks everything.
As the error message suggest it may be because its not included using <inherits name="com.yourcompany.project.SomeClass"/> or because java cannot find it (it's in a different path and not in the classpath or something like that).
It could also be that the classes include other classes/packages that cannot be converted to GWT code, and is ignored by GWT (stuff not in the core java packages). (Also if you use eclipse: it has an annoying habit of automatically add java import statements for stuff you mistype, see the problems tab and see if there are unused imports. You may have to change the preferences; setting "Unused imports" to "Warning", if it's not on by default.)
Try commenting out some of the includes and recompile, it may narrow down where the problem is. Use an IDE like Eclipse, and see if it reports errors. (I cannot give you any more specific help with the current data)