Fail to create custom UI component in ZK framework - zk

Trying to create custom UI component going through ZK 6.0.1 Component Development Essentials.
Always got error in logs "http://localhost:8080/zk6/zkau/web/_zv2011051111/js/examples.com.foo.wpd : HTTP Status 404 - /js/examples.com.foo.wpd" when trying to use custom component.
Found the war file with this example in scala, it works OK. I have copied all files from it to my project, and got same error.
The project structure is according to tutorial. What might be wrong?

You have to put the web folder, which contains the js files, in the java classpath, that means it should be put under the src folder. More easy way is to use the ZK Maven Archetype to create the template for you.

At least the way IntelliJ IDEA does things (which I see your are using, as am I), simply placing the web folder under the src folder doesn't seem to automatically get it copied to the artifact (although I'm not sure why). So I tried manually putting it in the WEB-INF/classes folder, and that worked. So the correct path for your example is <project-root>/web/WEB-INF/classes/web/js/examples/com/foo/zk.wpd.

Related

Import directory structure into eclipse

I've recently gotten the source code to a jsp application (I'm primarily a c# guy, so apologies for any terminology that doesn't fit). I'm trying to use Eclipse to make changes and run the application locally, but am having some problems getting started.
The folder structure is as follows
/Admin
/css
/js
/jsp
...more folders that look like your typical web site
/WEB-INF
/classes
/lib
web.xml
taglib-i18n.tld
build.xml
index.jsp
I've tried creating an empty dynamic web application and dragging the folders in, but there are ton's of build errors saying that the code found in the sub directories under /classes/ isn't recognized.
I can run a very simple jsp tutorial locally, so I'm confident that tomcat and the jsp framework is installed.
The source code is coming straight from (sorry) Source Safe and the current methodology is to make changes and deploy and test on a development server.
Is there something obvious that I'm missing or need to configure?
Sounds like you are not telling Eclipse about your dependencies. Go to Project > Properties > Java Build Path > Libraries and make sure you have all your dependency JARs referenced there.

Replace a gwt generated jar with a newer version

I've developed a GWT+GXT based web application. Recently we run into an issue that I was able to fix easily.
However when I generate the jar file from the tag, including the backport of the fix, even though I replace the old jar with the new one the fix has no effect.
On the other end if I generate the whole WAR everything works fine, but because of the size of it i'd rather like to be able to provide the patch as a jar file.
Am I missing something?
Thank you in advance
The jar file only contains Java sources and compiled Java - when you compile GWT, that produces JavaScript. This is what the war file contains, in addition to all of the other contents. In order to properly update your application, you need to update the compiled JavaScript.
The easiest way to do this, as you've noticed, is to replace the entire war file. If you want to keep the changes to a minimum, you could try just replacing the compiled JS directory and the jar file, but you'll want to be careful that you get the right directory - and all of the contents.

Where is the bin folder of GWT Internal Jetty Server in DevMode?

I need to put some property files (config file required by a library) in the starting path of the Jetty server in DevMode but could not figure out where to put them. Where should I put them?
I googled but no luck for that. Any help is appreciated.
You need to share your project set up information. Maven? Also mention whether property file is for app or jetty and what you are trying to achieve.
Also you can try putting up the properties file in web-inf/classes if it is project specific.
I am guessing you are not using any standard GWT project set up. It will be very difficult to proceed further even if you get this solved. I recommend you should go with gwt standard set up. You can reference GWT samples folder from here.
Use Hello project set up as template. If you are beginner also read up on https://developers.google.com/web-toolkit/doc/latest/RefCommandLineTools#webAppCreator.
If you use maven in your project, placing them in the src/main/resources should work.
Otherwise put it in your WEB-INF/classes

Referencing a GWT project from another GWT one - Problems

I am already using an open source GWT project (iServe) and I would like to integrate into it another open source GWT project (PetalsBPM), by which I mean being able to call it and reference its methods.
I have imported iServe in Eclipse (it has multiple modules) as separate Maven projects referencing its other and can run it successfully through Runas -> Web application in development mode.
If I do that and run the other project through the console as mvn gwt:run, I call initiate PetalsMBP through iServe. However, that means that the two programs have to run as is, without communication with each other.
I have also imported the second project into eclipse as a java project successfully (converting into a Maven one causes problems - various lifecycle configurations ones), but whenever I try to add to to iServe through Properties -> Java Build Path -> Projects, although it does not cause any errors immediately, I cannot launch iServe anymore. It produces the following error:
"Exception occurred executing command line.
Cannot run program "C:\Program Files\Java\jre7\bin\javaw.exe" (in directory "C:...iserve-sal-gwt-1.0.0-SNAPSHOT"): CreateProcess error=206, The filename or extension is too long"
Are my problems related to the fact that PetalsBPM is not a Maven project in Eclipse (I doubt it)?
Am I doing something wrong, i.e., this is not the way to reference a project from another one? should I add a reference to the first project's (iServe) gwt.xml file?
Is there a way to do what I want without having to wrap the second project as a jar and calling it from iServe? I would prefer not to, since producing a jar every time I make a slight change is not exactly efficient!
P.S: The second project is a regular GWT project with an entrypoint, not just a module. Should I remove this?
UPDATE: Trying to figure out the source of this error, I attempted to simplify the problem, so I performed the following moves:
I created two new simple GWT projects and tried to reference one
from the other. Worked fine
I referenced the project I actually want
to use (PetalsBPM) from the simple one I just created. Also works
fine.
I referenced the new simple project from the original one I
want to use (iServe). Also works fine.
Tried doing what I actually
want to do, copying the settings from 2&3. Produces the same error
"CreateProcess error=206, The filename or extension is too long" if
I reference PetalsBPM (does not when I remove it from the referenced
projects)
So, I tried switching workspaces. I created a new workspace in C:\, and moved the actual projects there. Still it did not work. :(
Any more ideas?
I met the same type of error "Create Process, error=206, path too long etc." a hundred times.
Then, I found a solution/explanation in google-groups, it solved my problem.
I post the content and link as it might help others.
This website (StackOverflow) really helped me a thousand times.
Thanks to you all !
solution/explanation :
(Response from Stephen Johnson)
(...) if you're using eclipse plugin go to Project | Properties, choose
Google \ App Engine \ ORM and only include directories that you have
classes that you want enhanced. By default it does the entire project
so that includes a lot of needless files. (...)
Link :
original post # google-groups
Read the exception message again. Somewhere along the way Maven is generating a path that is too long for (some) Windows API to handle, try moving your workspace to a directory straight below C:\.
I just tried "skolima" reply and it worked for me. In Eclipse I clicked File->Switch Workspace.
Three things to note:
After I created the workspace in "C:\workspace" I had to update my Project->Properties > Java Build Path > Libraries > Add External JARs...
I'm using Windows 7.
I'm using "Eclipse Java EE IDE for Web Developers"
I hope this others.

My first GWT Module

I created a module to share code across a couple of projects.
I created a GWT project: Framework. I then created a module com.framework.Framework within the project. The Framework project contains both client code, in the com.framework.client packages, and server code in the com.framework.server packages.
I try to consume this by
- Adding the project to the Java Build Path
- Adding to the module's definition
When I run the consuming project, I get NoClassDefFoundErrors for Framework classes I use in the module's server code.
What am I missing?
If I jar up the Framework project's WEB-INF\classes contents and put it into the consuming project's WEB-INF\lib folder, as well as add it to the Build Path it seems to work, but I don't see a way to keep the framework classes up to date in the consuming project(s).
Please make sure that you create gwt.xml file via menu New->Module, and in this gwt.xml file, you must declare your entry point class.