FAQs: Frequently asked questions

General

System Requirements

I opened up Eclipse and I cannot find where to start W4T.

When deploying a W4 Toolkit application with the wizard, will I have to edit or create any XML files (like web.xml etc.) for the server?

Is it possible to run W4T Eclipse with JDK 1.3.x.x?

Do you have any plans for making W4T available for non-windows platforms (Linux, MacOS X, ...)?

Platform independence of W4T Eclipse

How do I ...

How to set java.home /java.jre from 1.3.x to 1.4.1 ?

Connection to the database using the WebDataPool

How can I start an example.war application that I have deployed to Tomcat?

Can I use a background of my own in a cell?

I would like to have some classes whose static variables I can use global in all sessions.

Problems

By switching to the designer, I get this error: Name Error: The domain name does not exist.

I can't run the demo! (Error: java.io.IOException: CreateProcess: http://localhost:9010/index.html error=2)

Exception when starting a war file on Tomcat

After some clicks on an application, I get suddenly a nice derangement of characters on the whole page like this: 5 )Y|~?ܨoTtaǧ

Loss of code when changing the view

When I try to start a W4T application in the W4T Perspective using Run As or Debug As, nothing happens.

Advanced topics

Can I use static variables in W4 Toolkit applications?

Are there some more detailed error messages for errors where a MessageBox appears?




General

System Requirements

Minimum Requirements for using the W4T Eclipse Plugin:
P3 600 Mhz - 256 MB
P3 1000 MHz - 512 MB recommended
JVM 1.4
Windows (Linux Support will be available in the near future).
Eclipse 2.1, 2.11 and 3.0 M1 and M2 on Windows Plattforms!

Back to Top


I opened up Eclipse and I cannot find where to start W4T.

Open the W4T Eclipse Perspective from the menu Window > Open Perspective and create then a new WebForm (via the New menu). You could create a example application by File > New > Example > W4T Eclipse Example application. This is a good starting point.

Back to Top


When deploying a W4 Toolkit application with the wizard, will I have to edit or create any XML files (like web.xml etc.) for the server?

No, these things are handled by the library. In general, every web application has its own directory in the webapps/ directory. The XML files there are additional global configuration files (for Tomcat for example). By default, Tomcat regards every directory below webapps/ as a web application. It must fulfil some conditions, though, namely it must contain a WEB-INF/ subdirectory with a valid web.xml file etc. All these things are preconfigured by W4T Eclipse in the war file you generated with the deployment wizard.

Back to Top


Is it possible to run W4T Eclipse with JDK 1.3.x.x?

No. W4T Eclipse requires JDK 1.4.

Back to Top


Do you have any plans for making W4T available for non-windows platforms (Linux, MacOS X, ...)?

We are planning to use a platform-independent browser plugin in one of the next releases. At the moment W4T Eclipse is only available for windows platforms. This is because the design and the preview mode of the editor are browser based and they are currently running with Internet Explorer. Since this is the mostly used browser in the world, it was our first aim to support IE.

Back to Top


Platform independence of W4T Eclipse

The situation with Linux support in W4TEclipse is the following: We make extensive use of a web browser which must be tightly integrated with Eclipse. This is at the moment feasible in the Windows versions of Eclipse only (via the ActiveX integration in SWT).

As of Eclipse 3.0, there will be a native browser widget contained in SWT that makes integration of a browser possible with reasonable effort under Linux (and probably Mac OS). We plan to make W4T Eclipse as platform-independent as that browser widget once we can assume that the Eclipse 3.0 API is stable.

The API freeze is scheduled for the Milestone M6, which is to appear on Dec 19, 2003. Once this has happened, we will start to prototype a 3.0 compatible version of W4TEclipse that uses the new browser widget and will support Linux from the very start. We hope to get an Early Access version out probably shortly after the EclipseCon.

Please note also that W4T can be used independent of W4TEclipse. It is a 100% pure Java class library that depends only on a Servlet engine (like Tomcat) and a Java VM (1.3 or higher). It has been used on servers running several OSs (for instance Linux, IBM AIX, Sun Solaris). It is only the development environment that does run on Windows exclusively at the moment.

Back to Top


How do I ...

How to set java.home /java.jre from 1.3.x to 1.4.1 ?

Just create a desktop link to 'eclipse.exe'. Open the links properties dialog. Select the link tab and change the destination entry to something like this:

  	  C:\eclipse\eclipse.exe -vm C:\programs\Java\j2re1.4.0_03\bin\javaw.exe
	
(Edit the location of the Eclipse executable and the javaw.exe to fit your configuration, if necessary.) After that start the workbench using this link.

Back to Top


Connection to the database using the WebDataPool

Trying to access a database-pool, I get an SQLException "Connection Pool 'myDB' not found". How can I configure the integrated database-pooling in W4T Eclipse? To get a connection to the database, for example:

	  WebConnection wc = new WebConnection();
	  wc.setDbPool( new WebDataPool( "myDB" ) );
	  wc.setAutoCommit( true );
	
you have do define the database-pool. In W4T Eclipse you can define the pools in the menu Preferences. (Window > Preferences > W4 Toolkit > Data Pools). From the export wizard these pools can be integrated in the W4T.xml of the exported application. By the way, you can test the connection already when you are in the menu Preferences.

Back to Top


How can I start an example.war application that I have deployed to Tomcat?

Simply point a browser to the server. Assuming you have Tomcat running on your computer and have not changed the port, this would mean:

http://localhost:8080/example/

Back to Top


Can I use a background of my own in a cell?

Yes, you can. Choose the cell using the AreaSelector. In the property editor you can see in the second spot the property: background. Set this one to e.g. 'images/commit.gif' and a standard picture will be used, from the standard picture collection of W4 Toolkit. To use your own images, just create a folder in your project (for example images/myImages/), and put your picture file (someImage.gif) into that folder. Set then background to 'images/myImages/someImage.gif'.

Back to Top


I would like to have some classes whose static variables I can use global in all sessions.

It's possible to load the classes in a global namespace, in order to have their static members shared by all sessions. This means: a class, which is located in a global namespace, will exist once per application, a static variable or method will be shared by all sessions. Any other class is automatically located in the session-wide namespace. You can put a class into the global namespace by creating a globalClasses file (simple textfile). Into this file you have to type (line by line) the fully qualified classnames of your global classes, like this:

	  # comment
	  de.myCompany.somePackage.MyClass1
	  de.myCompany.somePackage.MyClass2
	  # ...
	  de.myCompany.somePackage.MyClassN
	
This file has to be specified in the configuration-file WEB-INF/conf/W4T.xml (the globalClassesList attribute), it has to be relative to the root directory of the web application. Note: classes that are located in the global namespace must not to reference classes from the session-namespace. This means: In the global classes there must not be any method parameter, method return value, static method call or instance variable of a type (e.g. WebForm, WebButton, one of the methods of W4TContext etc.) which belongs to the session local namespace. Otherwise you will inevitably get a conflict.

Back to Top


Problems

By switching to the designer, I get this error: Name Error: The domain name does not exist.

Are you using a proxy with Internet Explorer? If so, you should deactivate it while working with W4T Eclipse. (Possibly you can configure your proxy to exclude the development machine from the forwarding.)

Back to Top


I can't run the demo! (Error: java.io.IOException: CreateProcess: http://localhost:9010/index.html error=2)

If you get the following message:

	  start w4warp!
	  [...]
	  Exception starting browser:
	  java.io.IOException: CreateProcess: http://localhost:9010/index.html error=2
	
	  shutdown w4warp!
	
you'll have to configure the executable of the web browser with which you want to work. This is done by opening the preference page (Window > Preferences) and selecting W4T Eclipse > W4WARP. There you can see an entry [RUNTIME]External Browser where you can specify the executable of your browser. Save your changes and try again to run the example.

Back to Top


Exception when starting a war file on Tomcat

	

Example: The server encountered an internal error () that prevented it from fulfilling this request. [...] javax.servlet.ServletException: Servlet.init() for servlet Delegate threw exception at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1075) [...] root cause java.lang.NullPointerException at java.io.File.(File.java:180) at com.w4t.engine.util.EngineConfig.(Unknown Source) [...]

This problem occurs when the Tomcat server does not extract the contents of the war archive, but tries to start the web application directly from the war file. You can solve this by extracting the war file into the webapps directory. A W4 Toolkit application must be extracted, in order to get write access to its application directory (needed for writing temporary files). You can configure Tomcat to automatically extract war files as follows: Open the file server.xml in the tomcat/conf/ directory and search for an entry like this:
 	  <!-- Define the default virtual host -->
  	  <Host name="localhost" 
       		debug="0" 
        	appBase="webapps" 
        	unpackWARs="false" 
        	autoDeploy="true">
	
Change the unpackWARs="false" to "true" and restart the server. Whenever you put a war file now into the webapps/ directory, it will be unpacked automatically by Tomcat.

Back to Top


After some clicks on an application, I get suddenly a nice derangement of characters on the whole page like this: 5 )Y|~?ܨoTtaǧ

By default the HTML pages are compressed by our library (the browser decompresses them automatically when it detects that a compressed page is incoming). Some older versions of Tomcat seem not mark a compressed page correctly, and the browser doesn't 'know' that it has to decompress. That's the reason for the letterchaos. (we recognised this problem using Tomcat only, OC4J doesn't cause this). The answer to this problem is a new version of Tomcat. By the way, you can also switch off the compress in general (in the W4T.xml with the attribute compression).

Back to Top


Loss of code when changing the view

TODO: one more section (in german) After changing to design mode and registering an another event and following return in the codeview, there is the possibility of losing the first implementation, by not saving in the intermediate steps. So you should always save before a changeover, because only by doing that the manual code changes are taken over into the actual model. When creating a new eventhandler the code generation is triggered and the entry point method for the first eventhandler is created (empty) once more because the model is not informed about the manual added code without saving. The reason lies in the conception of W4T Eclipse. Since W4T Eclipse generates the markup with help of the compiled component tree, the changes will be visible only after saving and compiling.

Back to Top


When I try to start a W4T application in the W4T Perspective using Run As or Debug As, nothing happens.

It is important to have a valid selection of a WebForm in Run As. That means, you have to open up a W4T Eclipse editor, select the WebForm, and start Run As after this, to let the system know which WebForm it has to start. Alternatively a selection in the Package Explorer should suffice. You can also select 'Run' and specify the corresponding startup form in a new W4T Eclipse Launch configuration.

Back to Top


Advanced topics

Can I use static variables in W4 Toolkit applications?

Yes. W4 Toolkit classes (as the component classes like WebForm, WebButton, just as W4TContext) have their own classloader per session, which is responsible for the namespace. Static variables and methods will be shared only within sessions, there will be no undesirable interference between the sessions. This makes the use of Design Patterns (e.g. session-scoped singletons) possible.

Back to Top


Are there some more detailed error messages for errors where a MessageBox appears?

You can take a look at the complete stacktrace using Window > Show > View Other and then PDE Runtime > Error Log. In that view you can see a list with the error messages. Double-click on an entry and a window with a detailed message appears.

Back to Top