Jspresso 3.0 beta test is open

24 posts / 0 new
Last post
vvandens
Offline
Joined: 05/29/2008
Jspresso 3.0 beta test is open

Hi all,

The beta version of Jspresso 3.0 is ready to be test-drived. Among many bug fixes and improvements, the most exciting feature of this new release is the native Flex support for all Jspresso based applications. And you will benefit from it without a single line of ActionScript nor MXML since the Jspresso Flex GUI channel is based on a generic client engine that seamlessly communicates with the Jspresso backend through a brand new networking layer that relies on Adobe's BlazeDS. Everything keeps running on the server (your entities, your business rules, your actions, ...) while efficiently notifying the client side whenever needed through generic commands.

If you want to see now what it looks like, lauch the flex version (login demo/demo)of the HR sample application.

Moreover, the Jspresso application development cycle has been greatly simplified by integrating everything in Maven instead of relying on an external ant script for the following steps :

  • generation of the domain model
  • generation of the Hibernate mapping
  • compilation of the Jasper reports
  • generation of the DB schema scripts

Building the webapp is now as simple as "mvn package" with all the previous steps included. And of course, the flex compilation and html/swf generation is also part of the game thanks to the excellent flex-mojos maven plugins).

Neither the site nor the reference documentation have been updated yet to reflect these changes but this will be done before the general availability of the final release.

For those of you who are interested in giving it a try, please first read the release notes as well as the change log. They contain important informations about some major changes that directly impact existing Jspresso applications.

Before migrating an existing Jspresso application, the best approach is certainly to leverage the 3.0 archetype and import the HR sample application sources in it to get a clear idea of the project structure.

Here are the main steps involved (tested with maven 2.0.10):

  1. as Pierre commented below, you must increase the java heap space allocated to Maven :
    on windows :

    set MAVEN_OPTS=-Xmx512m (or set it as a user env variable)

    on linux :

    export MAVEN_OPTS=-Xmx512m (or set it as a user env variable)

  2. generate the HR sample application skeleton using the Jspresso 3.0 archetype :
    mvn archetype:generate
    -DarchetypeCatalog=http://repository.jspresso.org/maven2-snapshots/
    -DgroupId=org.jspresso.hrsample
    -DartifactId=hrsample
  3. download the HR sample application sources here.
  4. unzip (and merge) hrsample-3.0-SNAPSHOT/hrsample-core/main into hrsample/core/src. This will bring the HR sample spring descriptors into your codebase by replacing the default archetype ones.
  5. mvn package

You should obtain your ready-to-deploy war in the hrsample/webapp/target directory.

Deploy it in tomcat (don't forget the -Djava.security.auth.login.config=/path/to/hrsample/conf/jaas.config) and you can play with the HR sample application :

Of course, the project is ready to be imported in Eclipse for further testings. Note that every modification made to the domain model structure will require a "mvn package" and a refresh of the Eclipse project (F5) for getting updated entities.

Whenever you face any problem while testing this release, please post back in this thread.

I hope you will enjoy it !

 

Regards,

Vincent

Edited by vvandens on 03/28/2009 - 10:04
atao
Offline
Joined: 10/15/2008
Jspresso 3.0 beta test is open

Vincent

 

Great job!

 

When I run 'mvn package', I get this exception:

 

Running org.xdoclet.plugin.hibernate.HibernateMappingPlugin
  * Generate mapping for 'City' entity
27 mars 2009 12:03:38 org.generama.defaults.XMLOutputValidator validate
GRAVE: SAXException
org.xml.sax.SAXNotSupportedException: validation is not supported
        at org.gjt.xpp.sax2.Driver.setFeature(Driver.java:166)
        at org.dom4j.io.SAXReader.setFeature(SAXReader.java:186)
        at org.generama.defaults.XMLOutputValidator.validate(XMLOutputValidator.java:57)
        at org.generama.Plugin.start(Plugin.java:260)
        at org.picocontainer.defaults.DefaultPicoContainer.start(DefaultPicoContainer.java:349)
        at org.nanocontainer.integrationkit.LifecycleContainerBuilder.autoStart(LifecycleContainerBuilder.java:52)
        ...

 

vvandens
Offline
Joined: 05/29/2008
Jspresso 3.0 beta test is open

Hi Pierre,

Thanks for testing !

What version of maven are you using ? I don't understand where the "org.gjt.xpp.sax2.Driver" dependency comes from. Actually, I found it in "pull-parser-2.jar" but there seems to be nothing in the xdoclet2 plugin that depends on it.

Vincent

vvandens
Offline
Joined: 05/29/2008
Jspresso 3.0 beta test is open

You can also try to add the following dependency section in the core/pom.xml (just after the xdoclet closing </executions> tag) :

<dependencies>
  <dependency>
    <groupId>xdoclet-plugins</groupId>
    <artifactId>xdoclet-plugin-hibernate</artifactId>
    <version>1.0.4</version>
    <exclusions>
      <exclusion>
        <groupId>pull-parser</groupId>
        <artifactId>pull-parser</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
</dependencies>

vvandens
Offline
Joined: 05/29/2008
Archetype updated

Pierre,

I've updated the archetype, disabling validation for the generated Hibernate mapping file, so it should do the trick even if I don't know where your parser comes from. Anyway, why would we need a validation of a generated XML file ;-)

Moreover, I found a problem with the classpath of the Eclipse project so updating to the latest archetype snapshot will fix both.

Regards,

Vincent

atao
Offline
Joined: 10/15/2008
Jspresso 3.0 beta test is open

Vincent,

About maven:

C:\DEV\jspresso\workspace\popsuite3B>mvn -v
Maven version: 2.0.9
Java version: 1.6.0_02
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

 

atao
Offline
Joined: 10/15/2008
Jspresso 3.0 beta test is open

Vincent,

 

New exception:

 

[INFO] Loading configuration file C:\DEV\jspresso\workspace\popsuite3B\startup\flex\client\target\classes\config.xml
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Java heap space
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:2760)
        at java.util.Arrays.copyOf(Arrays.java:2734)
        at java.util.ArrayList.ensureCapacity(ArrayList.java:167)
        at java.util.ArrayList.add(ArrayList.java:351)
        at flex2.compiler.API.nextSource(API.java:460)
        at flex2.compiler.API.batch2(API.java:348)
        at flex2.compiler.API.batch(API.java:1117)
        at flex2.compiler.API.compile(API.java:1290)
        at flex2.tools.oem.Application.compile(Application.java:1074)
        at flex2.tools.oem.Application.recompile(Application.java:1026)
        at flex2.tools.oem.Application.compile(Application.java:678)
        at flex2.tools.oem.Application.build(Application.java:425)
        at info.rvin.mojo.flexmojo.compiler.AbstractFlexCompilerMojo.build(AbstractFlexCompilerMojo.java:2060)
        at info.rvin.mojo.flexmojo.compiler.AbstractFlexCompilerMojo.run(AbstractFlexCompilerMojo.java:1120)
        at info.rvin.mojo.flexmojo.AbstractIrvinMojo.execute(AbstractIrvinMojo.java:179)
        ...

vvandens
Offline
Joined: 05/29/2008
Jspresso 3.0 beta test is open

Hi Pierre,

This one is easier, but actually missing, I need to document it. You need to increase the heap size allocated to Maven.

On windows :

set MAVEN_OPTS=-Xmx512m

You can also set it permanently as an environment variable of your user.

I will update the site.

Also, the strange thing from your stacktrace is that your build is using "info.rvin.mojo.flexmojo.compiler.AbstractFlexCompilerMojo" (flex-mojos 2.0.x) instead of "org.sonatype.flexmojos.compiler.AbstractFlexCompilerMojo" that is the latest release (3.0.0) of flex-mojos as declared in the archetype and in the root pom. I changed this one yesterday. Maybe you did not completely regenerate your project from the archetype ? Or there might be a problem with maven checking for an updated version of the snapshot archetype. In this case, the best is to delete the archetype from your local maven repository :

M2_REPO/org/jspresso/framework/jspresso-archetype

Regards,

Vincent

atao
Offline
Joined: 10/15/2008
Jspresso 3.0 beta test is open

Vincent,

 

About AbstractFlexCompilerMojo: you are right. The command "mvn -U package" on the current project didn't update the local repository of jspresso archetype. I had to set up a new project (mvn archetype:generate...) to get it.

 

 

vvandens
Offline
Joined: 05/29/2008
Jspresso 3.0 beta test is open

Pierre,

Maven project generation through an archetype is a one step process. There is actually no mean of updating an existing project (merging differences) with an updated version of the archetype once the project has been generated.

atao
Offline
Joined: 10/15/2008
Jspresso 3.0 beta test is open

Vincent

 

I'm working under Eclipse 3.4.1 with a server Tomcat 5.5.

I set up a project with hr-sample (I changed manually the .classpath and .settings/org.eclipse.wst.common.project.facet.core.xml files to use Tomcat 5.5)

I run it from Eclipse:

1/ with Wings. Everything is fine.

2/ with Flex. I get a blanck page. Below is the log of tomcat loading.

3/ with Swing.  OK

 

Regards

Pierre

 

Log of Tomcat loading:

INFO: Initialisation de Coyote HTTP/1.1 sur http-8080
28 mars 2009 17:22:18 org.apache.catalina.startup.Catalina load
...
**** MessageBrokerServlet failed to initialize due to runtime exception:   Exception: java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom
    at javax.xml.xpath.XPathFactory.newInstance(Unknown Source)
    at flex.messaging.config.XPathServerConfigurationParser.initializeExpressionQuery(XPathServerConfigurationParser.java:46)
    at flex.messaging.config.AbstractConfigurationParser.parse(AbstractConfigurationParser.java:68)
    at flex.messaging.config.FlexConfigurationManager.getMessagingConfiguration(FlexConfigurationManager.java:79)
    at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:106)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
    ...

vvandens
Offline
Joined: 05/29/2008
Jspresso 3.0 beta test is open

Pierre,

Would you try what's posted here ? I need to investigate further by downgrading my tomcat setup and see if I can work on the webapp content to get rid of the problem.

http://www.psuedoguru.com/roller/page/psuedoblog?entry=failed_to_create_...

Thanks,

Vincent

[update] I've just tested with tomcat 5.5.16 and it's working fine for me (the common/endorsed directory is empty). Do you have updated your Tomcat installation with extra libraries ?

atao
Offline
Joined: 10/15/2008
Jspresso 3.0 beta test is open

Vincent,

 

It's a bundle of Tomcat 5.5.17 with XAMPP (basic package) version 1.5.3a.

I haven't had any library to the server.

 

Pierre

vvandens
Offline
Joined: 05/29/2008
Jspresso 3.0 beta test is open

There might be something special with the bundle. I will try it tomorrow. Until then, if you have time, you might check that the common/endorsed directory is empty or try with a tomcat-only package.

Vincent

 

atao
Offline
Joined: 10/15/2008
Jspresso 3.0 beta test is open

Vincent

 

I removed xercesImpl.jar and xml-apis.jar from common/endorsed. I get now the login but nothing more.

 

I have to go. So next episode tomorrow.

 

Pierre

vvandens
Offline
Joined: 05/29/2008
Jspresso 3.0 beta test is open

So, nothing in the Tomcat logs ?

It is strange, since if you see the login dialog, it means that the Flex client engine already did a succesful round-trip to the server... And nothing happens when you click the OK buttton, right ? beware that the [enter] key doesn't actually triggers the login; I have to check that.

atao
Offline
Joined: 10/15/2008
Jspresso 3.0 beta test is open

Vincent,

 

Yes indeed, see below. I get the same log either by doing nothing or by trying to log. And yes nothing happends when I click the OK button.

 

Pierre

[...]
INFO: Server startup in 10234 ms
29 mars 2009 19:34:15 org.apache.catalina.loader.WebappClassLoader modified
INFO:     Additional JARs have been added : 'jdtcore-3.1.0.jar'
29 mars 2009 19:34:15 org.apache.catalina.core.StandardContext reload
INFO: Le rechargement de ce contexte a démarré
[... here the same message about 'jdtcore-3.1.0.jar' comes 4 or 5 times]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [org/jspresso/framework/application/backend/persistence/hibernate/commons-hibernate.xml]: Cannot resolve reference to bean 'hibernateSessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateSessionFactory' defined in class path resource [org/jspresso/hrsample/config.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not instantiate persister org.jspresso.framework.model.persistence.hibernate.entity.persister.EntityProxyJoinedSubclassEntityPersister
[...]
Caused by: java.lang.OutOfMemoryError: PermGen space
    at java.lang.ClassLoader.defineClass1(Native Method)
[...]
GRAVE: Error listenerStart
29 mars 2009 19:35:54 org.apache.catalina.core.StandardContext start
GRAVE: Erreur de démarrage du contexte [/hrsample-webapp] suite aux erreurs précédentes

 

 

vvandens
Offline
Joined: 05/29/2008
Jspresso 3.0 beta test is open

Pierre,

This is a quite "classic" error when using the Sun java VM in development. It runs out of space in the area where it stores the classes bytecode (Class loading and unloading produces that). What you have to do is to allocate more "permanent generation" memory to the VM at startup (as you do for increasing the max heap size). For instance, add the following argument to the server launch configuration (VM config, the same place you configure jaas) : -XX:MaxPermSize=256m

using -XX:MaxPermSize=256m quadruples the default value of the Sun VM. You should then get rid of this error. Of course you can also do this in the standard startup script of tomcat for using outside of Eclipse.

Tell me if it solves the problem.

Vincent

PS : I shortened some of your post stacktraces.

atao
Offline
Joined: 10/15/2008
Jspresso 3.0 beta test is open

Vincent,

With

-XX:MaxPermSize=256m

there are still:

- the loop on

INFO: Server startup in 10234 ms
29 mars 2009 19:34:15 org.apache.catalina.loader.WebappClassLoader modified
INFO:     Additional JARs have been added : 'jdtcore-3.1.0.jar'
29 mars 2009 19:34:15 org.apache.catalina.core.StandardContext reload

but now around 25 times before...

- the exception

Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.lang.OutOfMemoryError: PermGen space
    at java.lang.Throwable.getStackTraceElement(Native Method)
    at java.lang.Throwable.getOurStackTrace(Throwable.java:591)
[...]

- and no reaction when I click on the ok button

Pierre

ps: there is no copyright on my post stacktraces, at least not mine ;-)

 

 

vvandens
Offline
Joined: 05/29/2008
Jspresso 3.0 beta test is open

Ok, the problem comes from the fact that Tomcat keeps reloading the webapp when starting thus producing the "Perm gen space oome". Increasing the perm gen space only delays the oome, by allowing Tomcat to reload it a few more times (5 -> 25).

Would you try the following :
- "mvn clean package" and deploy manually the resulting webapp on your tomcat installation outside of Eclipse. Then start Tomcat and try again.
- If the previous works, there is a problem with the way the project is configured in Eclipse (some kind of loop that makes Eclipse copy and re-copy indefinitely some jars in its deployment directory). In that case, could you send me a zip containing the following files (vvandens[at]jspresso[dot]org) :
  - .project and .classpath
  - the complete .settings directory
- If the startup outside eclipse does not work, the problem comes from the webapp packaging itself and in that case, would you send me a directory listing of the packaged WEB-INF/lib directory ?

Thanks,
Vincent

atao
Offline
Joined: 10/15/2008
Jspresso 3.0 beta test is open

Vincent

Good news: it works! Don't ask me why...

Here is what I did:

- under Eclipse, on the view "Add and Remove Projects" for the Tomcat server, I removed hrsample from the "Configured projects"

- I added my own current jspresso project as "Configured Project"

- I ran Tomcat server and checked my project

- I came back on Tomcat server's view "Add and Remove Projects", removed my project and added hrsample

- I ran Tomcat: OK

Pierre

atao
Offline
Joined: 10/15/2008
Jspresso 3.0 beta test is open

Vincent,

 

Oups, 2 messages with exactly the same time...

 

Do you still want the data you asked?

 

vvandens
Offline
Joined: 05/29/2008
Jspresso 3.0 beta test is open

Great ! There must have been some problems with WTP keeping renewing the deployed webapp libs. It is sometimes touchy... Forget about the files, then.

Now, the good part begins ;-) Tell me if you have any problem running your project in Flex.

atao
Offline
Joined: 10/15/2008
Jspresso 3.0 beta test is open

Vincent

 

don't expect any news soon as I know nothing about flex and I have to write some code for joda date and other stuff.

 

Pierre