Why my custom widget does not work in deploy on glassfish?

Why my custom widget does not work in deploy on glassfish?

In Eclipse work:

...     
     [java]
 INFO: Search took 16656ms
     [java]
                Widget set will contain implementations for following components: 
     [java]
                	com.vaadin.ui.AbsoluteLayout
...
     [java]
                	com.vaadin.ui.VerticalSplitPanel
     [java]
                	com.vaadin.ui.Window
     [java]
                	[b]
org.ici.ged.apresentacao.vaadin.comum.EntradaDeTexto
[/b]
     [java]
                Done. (18seconds)
     [java]
    Scanning for additional dependencies: jar:file:/D:/work_eclipse/workspace_ged/cwb_desenvolvimento/WebContent/WEB-INF/lib/vaadin-6.5.0.jar!/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriteria.java
     [java]
       Computing all possible rebind results for 'com.vaadin.terminal.gwt.client.ui.dd.VAcceptCriterionFactory'
...

But in Glassfish deploy not work:

...
     [java]
                Widget set will contain implementations for following components: 
     [java]
                	com.vaadin.ui.AbsoluteLayout
     [java]
                	com.vaadin.ui.Accordion
     [java]
                	com.vaadin.ui.Button
...
     [java]
                	com.vaadin.ui.VerticalLayout
     [java]
                	com.vaadin.ui.VerticalSplitPanel
     [java]
                	com.vaadin.ui.Window
     [java]
                Done. (0seconds)
...

My build code:

	<target name="compilarVaadin">
		
		<mkdir dir="${build}/VAADIN/widgetsets" />
		
		<property name="base" value="${build}" />
		<property name="gwt-location" value="${build}/WEB-INF/lib" />
		<property name="vaadin-jar-location" value="${build}/WEB-INF/lib/vaadin-6.5.0.jar" />
		<property name="src-location" value="src" />
		<property name="server-side-destination" value="${build}/WEB-INF/classes/" />
		<property name="client-side-destination" value="${build}/VAADIN/widgetsets" />
		<property name="widgetset" value="org.ici.ged.apresentacao.vaadin.widgetset.WidgetSet" />
			
		<path id="compile.classpathVaadin">
			<fileset dir="${base}/WEB-INF/lib/">
				<include name="*.jar" />
				<exclude name="xmlparserv2.jar" />
			</fileset>
			<pathelement path="${src-location}" />
		</path>
		
		<java classname="com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder" failonerror="yes" fork="yes" maxmemory="256m">
			<arg value="${widgetset}" />
			<jvmarg value="-Xss1024k" />
			<jvmarg value="-Djava.awt.headless=true" />
			<classpath>
				<path refid="compile.classpathVaadin" />
			</classpath>
		</java>
		
		<java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="256m">
			<arg value="-war" />
			<arg value="${client-side-destination}" />
			<arg value="${widgetset}" />
			<jvmarg value="-Xss1024k" />
			<jvmarg value="-Djava.awt.headless=true" />
			<classpath>
				<path refid="compile.classpathVaadin" />
			</classpath>
		</java>
		
	</target>

I do not understand why WidgetSetBuilder can not detect my widget class.

What is the process that he does to detect?

Any idea?

Tanks!

I’m trying since Monday to work on Glassfish, I am not able to understand where I’m wrong.

My buld.xml:

<?xml version="1.0" encoding="windows-1252"?>

<project default="deploy" name="Deploy" basedir=".">
	
	<property name="build" value="DEPLOY" />

	<target name="deploy">
		
		<mkdir dir="${build}" />
		
		<echo>Copiando Arquivos</echo>
		
		<copy todir="${build}"><fileset dir="WebContent" /></copy>	
		<copy todir="${build}/WEB-INF/classes"><fileset dir="src" /></copy>	
		
		<echo>Compilando Classes Java</echo>
		
		<javac srcdir="src" destdir="${build}/WEB-INF/classes">
			<classpath><fileset dir="WebContent/WEB-INF/lib" /></classpath>
		</javac>
		
		<echo>Compilando Vaadin</echo>
		
		<property name="widgetset" value="org.ici.ged.apresentacao.vaadin.widgetset.WidgetSet" />
		
		<path id="compile.classpathVaadin">
			<pathelement path="src" />
			<pathelement path="${build}/WEB-INF/classes" />
			<fileset dir="WebContent/WEB-INF/lib" excludes="xmlparserv2.jar" />
		</path>
		
		<java classname="com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder" failonerror="yes" fork="yes" maxmemory="256m">
			<arg value="${widgetset}" />
			<jvmarg value="-Xss1024k" />
			<jvmarg value="-Djava.awt.headless=true" />
			<classpath>
				<path refid="compile.classpathVaadin" />
			</classpath>
		</java>
		
		<java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="256m">
			<arg value="-war" />
			<arg value="${build}/VAADIN/widgetsets" />
			<arg value="${widgetset}" />
			<jvmarg value="-Xss1024k" />
			<jvmarg value="-Djava.awt.headless=true" />
			<classpath>
				<path refid="compile.classpathVaadin" />
			</classpath>
		</java>
		
		<echo>Criando Arquivo WAR e Copiando Para Autodeploy</echo>
		
		<war basedir="${build}" destfile="/usr/local/glassfishv3/glassfish/domains/domain1/autodeploy/GEDCWB_TESTE.war" />
		
		<delete dir="${build}" />
		
	</target>

</project>

Based on a quick glance, this looks ok to me. Most likely this is still some kind of a classpath issue with the sources of your widget not found on the classpath.

Are you sure the source code of org.ici.ged.apresentacao.vaadin.comum.EntradaDeTexto is on the classpath? Is it there directly (in a “client” subpackage of the package with the widgetset file) or in a JAR? If it is in a JAR, does the JAR have a Vaadin add-on manifest and a correct widgetset “fragment”?

As a related note, if it is not already the case, I would recommend packaging even your own widgets as add-on JARs, as that makes them easier to reuse. You can do it in Eclipse (Export… → Vaadin Add-on Package) or with ANT, one example using ANT is the ColorPicker add-on (
source code
), even though the ANT file is perhaps more complicated than necessary.

Is it there directly in a “client” subpackage, not in a JAR file.

I thought about doing this and can work, but it’s not practical. I need a separate project in Eclipse just because of a custom field?

If it works in Eclipse, why not work on Glassfish with the same build.xml file?

The file is in classpath, but for some reason difficult to understand Vaadin not find the file. The way of the Vaadin search the file seems to be fragile.