Type Error while downloading 'http://google-web-toolkit.googlecode.com/svn/tags/2.7.0/distro-source/core/src/gwt-module.dtd' - gwt

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>

Related

ClassCastException with ECIConnectionFactory running in Liberty

The problem - I am receiving the following message:
java.lang.ClassCastException: com.ibm.connector2.cics.ECIConnectionFactory incompatible with com.ibm.connector2.cics.ECIConnectionFactory
I am receiving it when trying to make the following statement:
eisDci = (ECIConnectionFactory)ctx.lookup(eisn);
The 'eisDci' has been defined previously:
private static ECIConnectionFactory eisDci = null;
And the 'eisn' is the String with the name of the conection like 'eis/DCIXxxxECI'
These connection is defined in the Server.xml:
<connectionFactory id="DCIXxxxECI" jndiName="eis/DCIXxxxECI">
<properties.cicseci ServerName="XXXX" TPNName="xx" connectionUrl="url" portNumber="2006"/>
</connectionFactory>
I understand that this is warning me that the cast is not possible. What I don't know is what I'm doing wrong. That must be comparing one version of the ECIConnectionFactory class with a different version of ECIConnectionFactory.
The server I'm working with is a Liberty, I'm going crazy, I can't figure out why Eclipse is comparing two different versions.
Similar problems I have searched for:
ClassCastException when casting to the same class
Waxwing's answer seems good, but I don't have access to make those changes, This connection is carried out by an external library.
First Thank you for your answer Ben Cox, in Liberty's server.xml (for LOCAL) I have declared the library:
<fileset caseSensitive="false" dir="C:\CICSECI"/>
And in the Liberty Runtime/Shared/resources I have cicseci.rar which I have declared in the server.xml as a resourceAdapter:
<resourceAdapter autoStart="true" id="cicseci" location="${shared.resource.dir}/cicseci.rar">
<classloader apiTypeVisibility="spec, ibm-api, api, third-party"/>
</resourceAdapter>
I have checked the rest of the libraries that I am importing into the project, and so far I have not seen that I have the repeated library.
I think the issue here has to do with classloading between your resource adapter and your application. This is something we more commonly see with DataSources but the results are the same.
The problem is that the same jar is being loaded by two different classloaders. One classloader for the resource adapter, and another classloader for your application. The solution is to use a commonLibraryRef
<library id=cicseci>
<file name="${shared.resource.dir}/cicseci.rar"/>
</library>
<resourceAdapter autoStart="true" id="cicseciRA">
<classloader commonLibraryRef="cicseci"/>
</resourceAdapter>
<connectionFactory id="DCIXxxxECI" jndiName="eis/DCIXxxxECI">
<properties.cicseci ServerName="XXXX" TPNName="xx" connectionUrl="url" portNumber="2006"/>
</connectionFactory>
<!-- Location of app that is trying to cast ECIConnectionFactory -->
<application location="${shared.resource.dir}/cicseci.rar">
<classloader commonLibraryRef="cicseci"/>
</application>
In this configuration, the cicseci.rar will only be loaded once.
ClassCastException can happen when the same class is loaded by two different class loaders, making what otherwise looks like the same class incompatible.
The mechanism that you should be using to avoid this involves configuring the application's class loader with a classProviderRef to the resourceAdapter, which is documented here. For example,
<application location=...>
<classloader classProviderRef="cicseci"/>
</application>
Already resolved
I import global libraries from different directories of my computer, in two of them the libraries were repeated with different versions, the obsolete versions were renamed, but it doesn't matter, the system recognized them as .jar and loaded them, producing the conflict.
I deleted the leftover libraries and it started working.
You have helped me a lot, and for that, Thank you.

GWT module xml source element to specify single class

I have a GWT application (FooGwtApp) and a library module (FooLib) used as a dependency in FooGwtApp. The package structure of FooLib looks like this:
packageFoo.ImportantClass
packageFoo.UnimportantClass
packageBar.OtherClass
I want ImportantClass (and only ImportantClass) to be compiled to JS by the GWT compiler. Moving ImportantClass to another package is not an option.
I created ImportantClass.gwt.xml within packageFoo with the following content:
<module>
<inherits name="com.google.gwt.user.User"/>
<source path="" includes="**/ImportantClass*"/>
</module>
Next I put an inherited reference to the ImportantClass module definition in FooGwtApp.gwt.xml (this seems to work: the IDE recognizes it, and is able to parse the reference to ImportantClass.gwt.xml).
Now If I put references to ImportantClass into FooGwtApp's client code, the GWT compiler fails, because it does not find ImportantClass on the source path:
No source code is available for type packageFoo.ImportantClass; did you forget to inherit a required module?
I likely messed up sommething in the source path / includes attribute in ImportantClass.gwt.xml - either defining the current package as root package with path="" is not a valid notation or something's wrong with the includes attribute. Or both. Or neither.
Can you give me a clue about where it all went wrong?
It turns out the problem was not in ImportantClass.gwt.xml, but in other Maven related stuff:
ImportantClass.gwt.xml should be placed under src/main/resources/packageFoo, not src/main/java/packageFoo, otherwise it won't be packaged into the binary jar.
GWT compiler compiles from Java source to Javascript source. This means we don't just need ImportantClass.class in FooLib.jar, but also its source. Best solution for this is to use maven-source-plugin in FooLib's pom.xml and also to import the FooLib dependency into FooGwtApp with sources classifier.
On the latter topic, see the following SO answers:
Maven: Distribute source code with with jar-with-dependencies
How to properly include Java sources in Maven?
After fixing the above problems, the source path declaration present in the question works.

Unable to properly link external Java library in Eclipse

I've been struggling to properly integrate this Netflix Java Client to access Netflix's API into a very basic Eclipse Java Web Project.
Whenever I try to publish any content referring to this library, I get errors like the following, indicating an inability to resolve the type of the classes in the external library I'm trying to use.
Aug 20, 2011 11:48:42 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/OSNet03] threw exception [Unable to compile class for JSP:
An error occurred at line: 19 in the jsp file: /index.jsp
NetflixAPIClient cannot be resolved to a type
16: String myConsumerKey = new String("cefjbgekg7566cqrp2atua2n");
17: String myConsumerSecret = new String("redacted");
18:
19: NetflixAPIClient apiClient = new NetflixAPIClient(myConsumerKey, myConsumerSecret);
20: String uri = APIEndpoints.MOVIE_URI + "/2361637";
21: String details = null;
At the top of the file I include the proper class directories like this:
<%# page import="com.netflix.api.*" %>
<%# page import="com.netflix.api.client.*" %>
<%# page import="com.netflix.api.client.dal.*" %>
And I don't receive any errors from Eclipse telling me it can't resolve the classes. Only once I publish it to the server does this error occur.
I've tried building with jre7 and jdk1.7.0. The library I'm trying to work with includes elements that are from Java v6 and v5.
I included the library by building it with Maven and placing the directory in my WEB-INF/lib folder and then including the jar netflix-client-2.3-SNAPSHOT.jar in my Build Path.
I've looked all over the web for possible causes and tried every prescribed solution I've found but none have worked.
You may be able to tell I'm very new to using Eclipse and Java Web Programming but I'm trying to figure things out as best I can as I go.
check if build automatically is on :P. if not try turning it on for once.
if yes then check the project build path and look for libraries. check if the correct jars are there.
also check if your jars are not corrupted.
these are the usual problems for more wait for sm1 else to answer.
you could also try searching for the resource class that can't be resolved using Ctrl+Shift+R and see if the class turns up.
if you don't get it, then just extract the jar and see if the class is there for real.

How to include predefined set of netbeans platform modules in maven project?

I am working on maven netbeans platform project consisting of several modules. I need to depend on some modules (say java.source module), but when I try to run the application, it reports, that required modules are not installed. And event despite I have dependency on java.source declared in my pom.xml
I think, that I have to tell maven somehow, to install (and turn on) these modules in the final assembled application before my module is loaded.
How could I do something like this?
UPDATE:
When I try to create complete netbeans application project from maven artifact and add Java Source API as a dependency into pom.xml... when I run the application, window with following message appears:
Warning - could not install some modules: Editor Library 2 - None of the modules providing the capability org.netbeans.modules.editor.actions could be installed. Editor Indentation for Projects - The module named org.netbeans.modules.editor.settings.storage/1 was needed and not found. Editor Indentation for Projects - The module named org.netbeans.modules.options.editor/1 was needed and not found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.ActionsFactory could be found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.OpenProjectsTrampoline could be found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.ProjectChooserFactory could be found. Editor Error Stripe Impl - The module named org.netbeans.modules.editor.errorstripe.api/1 was needed and not found. Java Source - The module named org.netbeans.libs.javacimpl/1 was needed and not found. Java Source - The module named org.netbeans.modules.editor.indent.project/0-1 was needed and not found. Java Source - The module named org.netbeans.modules.java.preprocessorbridge was needed and not found. Java Source - The module named org.netbeans.modules.options.editor/1 was needed and not found. Java Source - The module named org.netbeans.modules.parsing.api/1 was needed and not found. Editor Settings - No module providing the capability org.netbeans.api.editor.settings.implementation could be found. Diff - The module named org.netbeans.modules.options.editor/1 was needed and not found. 11 further modules could not be installed due to the above problems.
The error-message "Module dependency has friend dependency [...] but is not listed as friend" means that you need to specify an implementation version of org.netbeans.modules.options.editor.
You can achieve this by editing src/main/nbm/module.xml to contain the following entry (I didn't use the actually needed values here. Make sure to find out which values to enter for id and explicitValue to satisfy the dependencies (You can find explanations / instructions in the article linked below):
<dependencies>
<dependency>
<id>org.netbeans.modules:org-netbeans-modules-editor</id>
<type>impl</type>
<explicitValue>org.netbeans.modules.editor/1 = 201107282000</explicitValue>
</dependency>
</dependencies>
I'm pretty sure that the following article will explain some issues and help you find out the needed values for id and explicitValue (language is english, author is me):
http://blog.macrominds.de/2011/08/open-favorites-per-default-in-netbeans-rich-client-platform-maven-standalone-application/
I'm currently having related problems with my application, so I might come back with a more concrete solution in a while.
the easiest way is to grab a class that its complaining about, say "org.netbeans.modules.editor.actions" and go to the Add Dependencies and plug it into the Query field.
From there you should be able to tell which module you will need to include

JAX-WS Deployement error + LocatableWebServiceException: class not found in runtime descriptor

I have deployed JAX-WS web services in Tomcat and when i restarting the tomcat server. I am getting this error on console.
I have putted entry in web.xml and sun-jaxws.xml as per guidelines given in this link -
http://www.jroller.com/eldaaran/entry/using_jax_ws_2_0
Please advise.
SEVERE: WSSERVLET11: failed to parse runtime descriptor: com.sun.xml.ws.util.exception.LocatableWebServiceException: class not found in runtime descriptor: webservices.jaxws.Math
at line 6 of jndi:/localhost/jaxws/WEB-INF/sun-jaxws.xml
com.sun.xml.ws.util.exception.LocatableWebServiceException: class not found in runtime descriptor: webservices.jaxws.Math at line 6 of jndi:/localhost/jaxws/WEB-INF/sun-jaxws.xml
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.getImplementorClass(DeploymentDescriptorParser.java:525)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:201)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:132)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:93)
It looks like the class webservices.jaxws.Math can't be found.
I can't find any reference to this class on the web, so I can only assume that it's a custom class, or the wrong namespace is being used.
Is there a webservices/jaxws/Math.class file?
Do you have a reference to Math in sun-jaxws.xml? I think it is slightly more likely that java.lang.Math is being misnamed than that there is a webservices.jaxws.Math class (I don't see a copy in my version of jax-ws).
webservices.jaxws.Math seems to be your endpoint implementation class. Is this class well packaged and deployed? Are you sure it's in the classpath?