When I try to auto generate the web.xml file while creating a Dynamic Web Project in the Eclipse Enterprise version it shows an error of type "Language Servers". It indicates to this element of the web.xml file as error:
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0"
>
There is '1' error in 'javaee_7.xsd'.
schema_reference.4: Failed to read schema document 'platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd', because 1) could not find the document; 2) the document could not be
read; 3) the root element of the document is not xsd:schema.).
This is a bug in Eclipse which manifested since 2021-03.
It's broken down here: https://github.com/eclipse/lemminx/issues/1042#issuecomment-859778034:
Ok I can reproduce the issue with a fresh Eclipse IDE (the last). I can explain the problem but I don't know how to fix it (for the moment).
When you have "There is '1' error in 'jakartaee_9.xsd'" error, you must open the XSD file (from the cache) and you should see 1 error and 1 warning:
There is a warning:
schema_reference.4: Failed to read schema document 'platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. jakartaee_9.xsd /lemminx-cache/https/jakarta.ee/xml/ns/jakartaee line 52 Language Servers
which try to define xml:lang attribute inside xml.xsd file. But here the xml.xsd cannot be retrieved (the warning message) and you have the error:
It tries to download the XSD from platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd but platform is specific to Eclipse IDE. In other words when http://www.w3.org/2001/xml.xsd must be resolved, it says that platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd is the location of XSD. I don't know who do that?
I have the impression than LemMinx is configured to use XML catalog from WTP:
While waiting for the Eclipse version with the fix (which is indeed not yet released at the time of writing), one work around is disable the LemMinx validation:
#chris21k please note that you can disable LemMinx validation:
Related
When I try to auto generate the web.xml file while creating a Dynamic Web Project in the Eclipse Enterprise version it shows an error of type "Language Servers". It indicates to this element of the web.xml file as error:
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0"
>
There is '1' error in 'javaee_7.xsd'.
schema_reference.4: Failed to read schema document 'platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd', because 1) could not find the document; 2) the document could not be
read; 3) the root element of the document is not xsd:schema.).
This is a bug in Eclipse which manifested since 2021-03.
It's broken down here: https://github.com/eclipse/lemminx/issues/1042#issuecomment-859778034:
Ok I can reproduce the issue with a fresh Eclipse IDE (the last). I can explain the problem but I don't know how to fix it (for the moment).
When you have "There is '1' error in 'jakartaee_9.xsd'" error, you must open the XSD file (from the cache) and you should see 1 error and 1 warning:
There is a warning:
schema_reference.4: Failed to read schema document 'platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. jakartaee_9.xsd /lemminx-cache/https/jakarta.ee/xml/ns/jakartaee line 52 Language Servers
which try to define xml:lang attribute inside xml.xsd file. But here the xml.xsd cannot be retrieved (the warning message) and you have the error:
It tries to download the XSD from platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd but platform is specific to Eclipse IDE. In other words when http://www.w3.org/2001/xml.xsd must be resolved, it says that platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd is the location of XSD. I don't know who do that?
I have the impression than LemMinx is configured to use XML catalog from WTP:
While waiting for the Eclipse version with the fix (which is indeed not yet released at the time of writing), one work around is disable the LemMinx validation:
#chris21k please note that you can disable LemMinx validation:
I try to compile my widgetset in Vaadin 7.7.26 but I get an error :
Unable to find 'AppDefaultWidgetset.gwt.xml' on your classpath
but the name is correct and the file is there.
Opening the .gwt.xml file I see the following error :
Description Resource Path Location Type
Error while downloading 'http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd' to C:\Users\axioma28\.lemminx\cache\http\google-web-toolkit.googlecode.com\svn\tags\2.7.0\distro-source\core\src\gwt-module.dtd. AppDefaultWidgetset.gwt.xml /pax-ui-vaadin-client/src/main/resources line 6 Language Servers
Update the wigetset does nothing.
Tks
The error about downloading the dtd shouldn't be related to the compilation problem. The dtd is used by the IDE to provide better validation and content suggestions when editing the file, but it shouldn't have any direct impact on compilation.
I'm thus strongly suspecting that the problem is about where the file is located in combination with how the compiler is launched. Since you don't provide any information on those aspects, I cannot even speculate on what to look for
Your AppDefaultWidgetset.gwt.xml should by default be located in src\main\resources\whatever\your\package\name\is\ and your widgetset configuration should similarly have e.g. in #VaadinServletConfiguration annotation for your Servlet something like widgetset = "whatever.your.package.name.is.AppDefaultWidgetset" -- is this where your file is and how you refer to it, and if not, does changing it to be like this help?
(And if you have custom client-side classes, those should be in src\main\java\whatever\your\package\name\is\client\ for them to be found.)
Also, if you want to use newer Vaadin 7 versions than 7.7.17, make sure you have extended support for Vaadin 7.
Edit: alternative options where the widgetset might be configured:
annotation on your UI class:
#Widgetset("whatever.your.package.name.is.AppDefaultWidgetset")
web.xml:
<init-param>
<description>Application widgetset</description>
<param-name>widgetset</param-name>
<param-value>whatever.your.package.name.is.AppDefaultWidgetset</param-value>
</init-param>
In drools KIE workbench 7, for a project 'testRemoteKJar', I use 'Knowledge Base Settings:Knowledge bases an sessions' to edit its kmodule.xml, as in below screen shot.
Screen Shot--Knowledge Base Settings.
When I click button 'save' to save kmodule.xml, the console of the KIE workbench print below error message.
08-Jul-2017 19:29:00.161 INFO [Thread-12] org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder.updateResource Incremental build request received for: default://master#repo-demorules/testRemoteKJar/src/main/resources/META-INF/kmodule.xml (updated).
08-Jul-2017 19:29:00.317 INFO [Thread-607] org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder$3.execute Incremental build request being processed: PathImpl{uri='default://master#repo-demorules/testRemoteKJar', fileName='testRemoteKJar', attrs={}} (updated).
08-Jul-2017 19:29:00.325 SEVERE [Thread-13] org.kie.workbench.common.screens.impl.LibraryIndexer.fillIndexBuilder Unable to index default://master#repo-demorules/testRemoteKJar/src/main/resources/META-INF/kmodule.xml: package could not be resolved.
08-Jul-2017 19:29:00.726 SEVERE [Thread-607] org.drools.compiler.kie.builder.impl.AbstractKieModule.buildKnowledgePackages Unable to build KieBase, could not find include: kbase1
And if I download the jar file 'testRemoetKJar' from KIE workbench, the content of the kmodule.xml in that jar is just one line:
<kmodule xmlns="http://www.drools.org/xsd/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
The error log contains words 'package could not be resolved', but the project 'testRemoteKJar' does have package 'org_care.crm.testremotekjar' (the package name is used in the screenshot above). So the error log should have other meaning.
How to fix the error? Thanks a lot.
I downloaded the OfBiz Java application and the following line throws an MissingResourceException:
ResourceBundle res = ResourceBundle.getBundle(settingsResourceName);
The value of settingsResourceName is "cache", but I cannot find any file called cache.properties or cache_en.properties.
Where should I be looking? I'm new to Java. All my research on SO says there should be such a file.
I imported OfBiz in Eclipse using the Import menu option and selecting Existing Project from File System (I'm not in front of my dev machine so I don't remember the exact wording). But I chose the root folder of the downloaded OfBiz.
I then added the appropriate VM Arguments in the Run Configuration to get it to run properly at least. And that's it, on the first Run I got the above error. I think it has to do with a missing class path but I don't know what to add to class path.
Here is the stack trace:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.ofbiz.base.util.Debug.<clinit>(Debug.java:68)
at org.apache.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:61)
at org.apache.ofbiz.base.start.StartupControlPanel.loadStartupLoaders(StartupControlPanel.java:202)
at org.apache.ofbiz.base.start.StartupControlPanel.start(StartupControlPanel.java:69)
at org.apache.ofbiz.base.start.Start.main(Start.java:84)
Caused by: java.util.MissingResourceException: Can't find bundle for base name cache, locale en
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:773)
at org.apache.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:174)
at org.apache.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:170)
at org.apache.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:166)
at org.apache.ofbiz.base.util.cache.UtilCache.<init>(UtilCache.java:124)
at org.apache.ofbiz.base.util.cache.UtilCache.createUtilCache(UtilCache.java:769)
at org.apache.ofbiz.base.util.UtilProperties.<clinit>(UtilProperties.java:75)
... 5 more
UPDATE:
My mistake, I found two files both called cache.properties in the following folders:
ofbiz-trunk/build/resources/main
ofbiz-trunk/framework/base/config
But these are folders, not packages. I tried putting them in the .classpath but that did not work, I still kept getting the same error.
As suspected, I knew it was because of a missing reference to a class path. After looking at a section on this page: http://www.opensourcestrategies.com/ofbiz/ofbiz_eclipse.php, I learned that I was supposed to go to the Java Build Path and in the Libraries tab, click on Add Class Folder, then point that to ofbiz-trunk/framework/base/config. Which is where I have one of the cache.properties files.
I am trying to configure my GWT project to run in SuperDevMode and experience severe problem during server run time.
So, I have working "regular" devMode configuration in Intellij IDEA. Created a new GWT configuration in app-servers list. Set the following values:
[Checked] Super Dev Mode
VM options: -Xmx512m -XX:MaxPermSize=384M
Dev Mode parameters: -bindAddress 0.0.0.0 -port 1234 -workDir d:\projects\myApp\SDV\ -src d:\projects\myApp\src\main\java com.app.MyApp
Made changes to my project's build xml file adding the lines in the end of file:
<add-linker name="xsiframe"/>
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
<!-- enable source maps -->
<set-property name="compiler.useSourceMaps" value="true" />
Here is the console output on this config run:
workDir: d:\projects\myApp\SDV
deleting: d:\projects\myApp\SDV\com.app.MyApp\compile-1
binding: user.agent=safari
binding: compiler.useSourceMaps=true
binding: locale=en
Compiling module com.app.MyApp
Compiling 1 permutation
Compiling permutation 0...
Source Maps Enabled
Compile of permutations succeeded
Linking into d:\projects\myApp\SDV\com.app.MyApp\compile-1\war\myapp; Writing extras to d:\projects\myApp\SDV\com.app.MyApp\compile-1\extras\myapp
Link succeeded
Compilation succeeded -- 84.458s
Compile completed in 85210 ms
deleting: d:\projects\myApp\SDV\com.app.MyApp\compile-1
[ERROR] unable to create directory: d:\projects\myApp\SDV\com.app.MyApp\compile-1
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.codeserver.CompileDir.mkdir(CompileDir.java:103)
at com.google.gwt.dev.codeserver.CompileDir.create(CompileDir.java:93)
at com.google.gwt.dev.codeserver.Recompiler.makeCompileDir(Recompiler.java:267)
at com.google.gwt.dev.codeserver.Recompiler.compile(Recompiler.java:82)
....
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Process finished with exit code 1
I suspect it maybe Win8 file access permissions problem: cannot create the directory because it wasn't deleted successfully. Both lines in the log above that have this text:
deleting: d:\projects\myApp\SDV\com.app.MyApp\compile-1
are of red color in IDEA (if that has any special meaning).
I unchecked READ_ONLY checkbox in the properties of for the work folder in file explorer, and also run idea64.exe as Admin. Should I somehow run this codeserver compiler "as admin" too? Is it possible?
Also it may be a configuration issue, if it is and somebody can see it from the details below - I would really appreciate the help. Thanks in advance!
UPDATE
Running the superDevMode config with parameter "-noprecompile" gives the same results:
workDir: d:\projects\myApp\sdv
deleting: d:\projects\myApp\sdv\com.app.MyApp\compile-1
Module setup completed in 865 ms
deleting: d:\projects\myApp\sdv\com.app.MyApp\compile-1
[ERROR] unable to create directory: d:\projects\myApp\sdv\com.app.MyApp\compile-1
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.codeserver.CompileDir.mkdir(CompileDir.java:103)
at com.google.gwt.dev.codeserver.CompileDir.create(CompileDir.java:93)
at com.google.gwt.dev.codeserver.Recompiler.makeCompileDir(Recompiler.java:267)
So, definitely looks like file access problem (delete doesn't do its job?). Javadoc to CompileDir.create() method says: "Creates a new compileDir directory structure. The directory must not already exist, but its parent should exist." Seems that it already exists.
I think your configuration is correct. I am using the same parameters (with another portnumber) on my Mac and it works as expected.
The red color of the text:
deleting: d:\projects\myApp\SDV\com.app.MyApp\compile-1
is normal and indicates no problem.
I am not familiar with Windows 8, but would think, that you don't need to run idea.exe with admin rights. I think, uncheck the read-only checkbox should solve your problems.
Another way should be, that you create your workDir directory with Intellij.
File -> New -> directory
(That's what I did).
Ok, so this is fixed now in GWT 2.7.0 by GWT team.
https://code.google.com/p/google-web-toolkit/issues/detail?id=8619
Runs well, even though I can notice the message in the IDE console:
[WARN] unable to delete 'C:\Users\me\AppData\Local\Temp\gwt-codeserver-1341369077945982663.tmp\com.bla.MyAPP\compile-1' (skipped)
[ERROR] unable to create directory: C:\Users\me\AppData\Local\Temp\gwt-codeserver-1341369077945982663.tmp\com.bla.MyAPP\compile-1
Loading Java files in com.bla.MyAPP.
after printing this the IDE continues to run the app server.
Resolving the issue.
I also found that if you are converting your project from GWT 2.6.0 to 2.7.0, you should delete your 2.6.0 run configuration and setup a new one with GWT 2.7.0 defaults.