What is SmartWeb?

SmartWeb is a Java framework to simplify and speed-up multi-tiered web applications development.

SmartWeb is based on consolidated open source frameworks (mainly Hibernate and Jakarta Struts but there are other frameworks and libraries we use to provide features)

Why do I need SmartWeb?

The framework will provide you a basis to develop your web application in respect of some good architectural designs plus your code should result cleaner than usual.

Other than that the main reason to adopt the framework is to reuse and customize our modules which can provide you a lot of functionalities at pratically no cost!

It's important to precise the framework was initially developed as closed source to ease software productivity, so our solutions are inherited more from experience rather than from theory.

Will I have to pay any fee to use SmartWeb?

The framework was released to the open source community by the SmartLab in the first quarter of 2006 and we choosed to adopt the LGPL license to ensure you'll never pay anything to use the framework nor for the framework modules released under the same license.

It's important to state you can still earn money selling products developed over the framework as the LGPL license doesn't cover derivatives. In consequence of the choosen license there may be modules not available for free for which you could be entitled for a fee.

Obviously we will appreciate both credits and help (in any form) if you adopt our framework both to earn money or to contribute the open source community.


What libraries do I need to compile my SmartWeb based project?

The full list of needed libraries is listed on the Dependencies page.

If you don't use Maven 2 as build tool you have to verify you follow also transitive dependencies which are libraries needed by some libraries we use.

Generally speaking the javax.* dependancies should be provided by your container so you don't need to dowload them, but just to copy them to your compilation classpath which depends on the tool you use.

We suggest to use Maven 2 for your compilation needs as it will transparently resolve all the dependancies you need. The framework is available to Maven 2 adopters in the standard iBiblio repository.

What libraries do I need to deploy my SmartWeb based project?

To deploy an EAR or WAR application the needed libraries are the same listed for compilation in the Dependencies page.

Generally the ehcache caching library will support your needs, but for clustered deployments you can evaluate one of the other caching libraries supported by Hibernate.

I'm trying to use one of your modules which requires a database structure, but I'm not able to find the SQL script to generate that schema!

You should generate that file accordingly to your own database engine as the schema is strictly binded to the engine you are going to deploy to (data types for example).

To generate the database schema you should checkout the project from SVN (not the latest version but the one matching the modules version you are trying to use, please refer to the tags repository folder for this) than edit the res/smartweb-.hcf file altering at least the dialect property to match to your target database. Now you could generate your own DDL issuing the command mvn process-classes which creates a schema.sql file into the project res folder.

What are the .hcf files?

The .hcf acronym stands for Hibernate Configuration File and is nothing more than the classic hibernate.cfg.xml file already documented into the Hibernate documentation

We choose to alter the file naming schema to reflect one of the framework features which seamlessly integrate the support for multiple database configurations on a per module basis.

We suggest to use Maven 2 for your compilation needs.

Where do I must place my .hcf files?

Usually it's suggested to simply alter the standard smartweb.jar.hcf file we include in our examples and project templates into the META-INF directory of the main package (.ear for EAR deployments or .war for WAR deployments).

If you need to provide multiple databases ona per module basis, say you need to place your auth module tables on a specific database, you can add another .hcf file in the same location named like your module JAR, like smartweb-auth.jar.hcf.

If, for some reason, you need to completely alter the strategy we adopted to lookup for the configuration files you can implement it on your own by re-implementing the net.smartlab.web.config.ConfigurationStrategy interface.

More informations needed for the last statement: where to configure the new strategy?


Why do I get ClassCastExceptions and/or NoClassDefFoundExceptions while deploying my application under JBoss Application Server?

It depends on the JBoss Application Server classpath and ClassLoader, anyway the workaround is to ensure there is no library version collision in your project.

A library version collision happens whenever you have into your project a dependancy from a library already present into the JBoss main libraries (those into the root lib folder or into the server/xxx/lib folder) which differs from your own by version (it doesn't matter the name of the file!!!).

In this case you have no choice other than removing the library from your own project and try to use the classes already loaded by the JBoss root ClassLoader: if the library doesn't work you can always try to replace the JBoss one with your at your own risk!

We often succedeed in this activity, but sometimes it fails, depending by the library and the JBoss version you are using...

What the session.errors log messages mean?

When you get one of messages listed below you should double-check your SmartWeb Hibernate configuration file and persistence tier configuration or service

  • session.error.begin
  • session.error.commit
  • session.error.rollback
  • session.error.close
  • session.error.update
  • session.error.remove
  • session.error.paging

What the net.smartlab.web.DAOException: persistance.error.configlog message means?

When you get such kind of messages you should investigate your smartweb.jar.hcf configuration file because this message indicates some problem occurred trying to configure the persistence layer, which is providen by Hibernate

First of all you should check the file META-INF/smartweb.jar.hcf exists inside the WAR or EAR you deployed: if it exists you should double check the file contents.

IDE Integration

What Eclipse plugins do I need or do you suggest to improve productivity on your framework?

You do not need any plugin to develop your own SmartWeb based web application, but you have to manually download the dependency JARs listed here.

We suggest to start with the SmartWeb Eclipse Template Project on which you can customize the providen Maven 2-based pom.xml.

Since the publication of the framework on SourceForge we adopted Maven 2 for project lifecycle so we suggest to install the Maven Eclipse plugin for an easy integration of this tool into your IDE.

We noted productivity boosts in conjuction with the usage of the Eclipse WTP plugin set or, for JBoss development, the JBossIDE plugin set.

If you are stuck with pre-annotation Java version for some reason, as I am, then XDoclet can save you a lot of work too. There is a number of Eclipse plugins for XDoclet integration, plus you can just run it as an external tool or configure it into Maven 2 (as in the template pom).

What Netbeans plugins do I need or do you suggest to improve productivity on your framework?

We suggest to start with the SmartWeb Netbeans Template Project on which you can customize the providen Maven 2-based pom.xml.

What IntelliJ IDEA plugins do I need or do you suggest to improve productivity on your framework?

We suggest to start with the SmartWeb Idea Template Project on which you can customize the providen Maven 2-based pom.xml.

What do I need or do you suggest if I use any other IDE not listed here?

We suggest to start with the SmartWeb Ant Template Project on which you can customize the providen Ant-based build.xml.

This basic tool should be easily supported by your IDE, whatever vendor or version it is. In case even this doesn't satisfy your needs we can provide you the hints you need, so don't feel shy and post a message on our users forum (registration is required to prevent spamming)!