Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
AppFuse
AppFuse_it
AppFuse_jp
AppFuse_zh
Downloads
LeftMenu
Main
StrutsResumeSupport




JSPWiki v2.2.33

[RSS]


Hide Menu

AppFuseSupport


Difference between version 121 and version 40:

At line 1 changed 1 line.
This is a list of questions that relate to AppFuse. You might also checkout the [AppFuse Tutorials|Articles] and [StrutsResume Support|StrutsResumeSupport] pages.
This is a list of questions that relate to AppFuse. You might also checkout the [AppFuse Tutorials|Articles] and [StrutsResume Support|StrutsResumeSupport] pages. The [Mailing List Archives|http://news.gmane.org/group/gmane.comp.java.appfuse.user] or the [AppFuse IRC channel|AppFuseIRC] might also be helpful.
At line 3 changed 1 line.
* Where is UserForm.java? __Answer:__ The UserForm.java file is generated by XDoclet using Ant. If you run "ant compile" it gets generated into build/web/gen/org/appfuse/webapp/form.
!Table of Contents
*[1] Common Questions
*[2] Development with AppFuse
*[3] Security Questions
*[4] Struts Specific HowTos
*[5] JSF Specific HowTos
*[6] Database Questions and HowTos
*[7] Application Server Questions and HowTos
*[8] Using Anthill and CruiseControl
*[9] Hibernate Specific Questions
*[10] Archived Questions
At line 15 added 34 lines.
!!Common Questions [#1]
* Where is UserForm.java?
;:''The UserForm.java file is generated by XDoclet using Ant. If you run "ant compile" it gets generated into build/web/gen/org/appfuse/webapp/form.''
* What is [AppFuse]?
;:''[This article|http://today.java.net/pub/a/today/2004/07/15/thefuse.html] explains it best.''
* Is this the right place to ask AppFuse questions?
;:''Sure, but you'll probably get more visibility and input from the [help forum|https://appfuse.dev.java.net/servlets/ForumMessageList?forumID=566] or [mailing list|https://appfuse.dev.java.net/servlets/SummarizeList?listName=users]. Also, this wiki has recently been locked down b/c of spammers so you'll need to get a username/password from me to post anything. Don't forget that the [mailing list archives|http://news.gmane.org/group/gmane.comp.java.appfuse.user] are a great resources.''
* Why am I getting this error "Cannot create JDBC driver of class ' ' for connect URL 'null'"?
;:''Chances are you forgot to run "{{ant setup-tomcat}}" (or "{{ant setup}}" if you need to set up the database as well). Also, if you're using Tomcat make sure you are using the latest [recommended release|DevelopmentEnvironment]. ''
* Why do I get this error "build.xml:1037: taskdef class org.apache.catalina.ant.ReloadTask cannot be found"?
;:''Ant cannot find the ReloadTask which is in $CATALINA_HOME\server\lib\catalina-ant.jar. You need to ensure env var CATALINA_HOME (Windows dir %CATALINA_HOME% or Unix ls $CATALINA_HOME) points to the tomcat install base directory. This error can also occur when you wrap the path in double quotes, (ie. if you have set CATALINA_HOME="c:\Tomcat 5.5" then remove the double quotes!). ''
* How does build.properties and properties.xml fit together?
;:''Ant has immutable properties. The first time a property is set, it cannot be changed. Here's the order of how properties are set in AppFuse.''
<div style="margin-left: 40px">
{{{
command-line using -Dproperty=value
~/.appname-build.properties
~/.build.properties
build.properties
properties.xml (or build.xml) - wherever it's used''
}}}
</div>
* When working on a team, how to run test of a specific POJO using db-load task only in that specific table as well?
;:''First, instead of using all the sample-data.xml file, create another file say sample-person.xml and there put the data that you want insert. After that you can do this:
ant test-dao -Dtestcase=PersonDao -Dfile=metadata/sql/sample-person.xml''
!!Development with AppFuse [#2]
* [HowTo setup your Development Environment|DevelopmentEnvironment]. This is what I typically use when building a new machine. It includes environment variables, downloads, where to install applications, etc.
* What are the major ant tasks? What do they do?
;:''See [AppFuseAntTasks].''
* [Developing your AppFuse application in Eclipse|AppFuseEclipse].
* [Known Environment issues|AppFuseEnvironmentIssues] to be aware of.
!!Security Questions [#3]
At line 9 changed 2 lines.
* What is [AppFuse]? AppFuse is a project that helps you begin developing new web applications. It virtually eliminates the hard part of starting a new project - which is often setup and configuration. It has Ant targets for building, testing and deploying. Tools like JUnit, XDoclet, Hibernate and Spring can be difficult to integrate. If you use AppFuse, it's already done for you. It also provides built-in features like Container Managed Authentication, Password Hint, Remember Me, User Registration and User Management.
!!Struts Specific [#4]
At line 55 added 3 lines.
* How to [use Velocity templates instead of JSPs|AppFuseVelocity].
* How to [deal with Dates using Struts|AppFuseStrutsDates].
* Do you have any Struts validator [examples?|http://phd.netcomp.monash.edu.au/RobertMarkBram/blog/detailPage.asp?id=46]
At line 13 changed 1 line.
* [HowTo setup your Development Environment|DevelopmentEnvironment]. This is what I typically use when building a new machine. It includes environment variables, downloads, where to install applications, etc.
* Why is the JSTL keyword 'empty' not working all the time?
At line 15 changed 1 line.
* [Using AppFuse with SQL Server|AppFuseWithSQLServer].
;:''The empty keyword (pre JSP 2.0), only worked on java.util.List, java.util.Map, on Strings and arrays. Collections like java.util.Set were not supported. If you are using pre JSP 2.0 and want to test whether a Set is empty or not use: {{{
At line 17 changed 1 line.
* [AppFuse and Mckoi database|AppFuseWithMckoi].
<c:if test="${mycollection['empty']}">.
At line 19 changed 1 line.
* To support multiple developers with the same instance of Tomcat, simply change "${webapp.name}" to "${user.name}" in the various deployment methods.
}}}
The most reliable workaround to this problem I have found, is to use this notation:
{{{
<c:forEach items="${mycollection}" var="element" varStatus="rowNum">
At line 21 changed 5 lines.
* [Developing your AppFuse application in Eclipse|AppFuseEclipse].
* [Using Anthill to automate AppFuse testing|AppFuseAnthill].
* How to [run AppFuse on Resin|AppFuseOnResin].
* How to [run AppFuse on Orion|AppFuseOnOrion].
* How to [run AppFuse on JBoss|AppFuseOnJBoss].
<c:if test="${rowNum.count==1}">
<table>
<tr> <th> Value Header </th> </tr>
</c:if>
<tr>
<th>
<c:out value="${element.value}"/>
</th>
</tr>
<c:if test="${rowNum.last}">
</table>
</c:if>
</c:forEach>
}}}
This [article|http://weblogs.java.net/blog/mister__m/archive/2003/11/crazy_jstl_when.html] explains this in more detail. If you are using tomcat 5, this supports JSP 2.0 so you will not experience
this problem.''
!!JSF Specific [#5]
* I get an "Couldn't find template: /home/mats/myapp/metadata/templates/struts_form.xdt" when I run "ant setup test-all" after specifying "jsf" as web framework when running "ant new".
;:''This is caused by the failure of JSF to install. Start with a version that has [JSF pre-installed|https://appfuse.dev.java.net/files/documents/1397/37690/appfuse-jsf-1.9.3-src.zip].''
!!Database Specific [#6]
* I get an "access denied" error when trying to create the MySQL Database.
;:''The issue is likely because you're on Unix or you've changed the root password. See [this page|AssistanceWithAntSetup] for assistance.''
* I get an "Illegal mix of collations" when I try to run tests against a MySQL database.
;:''MySQL 4.1.7+ requires you to add set the default character set to UTF-8 to get unicode support with AppFuse. To do this, add the following to your c:\Windows\my.ini or /etc/my.cnf file:''
<div style="margin-left: 40px">
{{{
[mysqld]
default-character-set=utf8
}}}
</div>
* I'm have methods that throw exceptions in a Transaction and nothing is being rolled back. What gives?
;:''MySQL's default tables (MyISAM) do not support transactions by default. Add or replace the following line in your c:\Windows\my.ini or /etc/my.cnf file. You could also use [PostgreSQL|AppFuseOnPostgreSQL].''
<div style="margin-left: 40px">
{{{
[mysqld]
default-storage-engine=innodb
}}}
%%note __NOTE:__ You may see default-storage-engine's synonym "default-table-type" in the
configuration file. If so, set the value of that parameter to "innodb" instead.%%
</div>
;:''BTW, [MySQL Administrator|http://www.mysql.com/products/administrator/] is a nice tool for administering/monitoring MySQL.''
* I'm having trouble with MySQL on Suse 9.2.
;:''Upgrading to the [MySQL 3.1.5 JDBC Driver|http://jroller.com/page/mmatthews/20041202#connector_j_3_1_5] (or above) should fix this.''
* Can AppFuse talk to multiple [databases?|MultipleDatabases]
* Can I audit any changes to the [Database?|DatabaseAudit]
* I get an "Could not synchronize database state with session" exception when I try to run test-dao.
;:''If a class with a natural key does not declare a version or timestamp property, it's more dificult to get saveOrUpdate() and cascades to work correctly. You might use a custom Hibernate Interceptor as discussed in this chapter. (On the other hand, if you're happy to use explicit save() and explicit update() instead of saveOrUpdate() and cascades, Hibernate doesn't need to be able to distinguish between transient and detached instances; so you can safely ignore this advice.) Composite natural keys extend the same ideas. {Hibernate in Action: pag.:333}''
* What [DB admin/clients|DBTools] can I use to administer my database?
* How do I [use AppFuse with SQL Server|AppFuseWithSQLServer].
* How do I [use AppFuse and Mckoi database|AppFuseWithMckoi].
At line 136 added 3 lines.
* How to [run AppFuse on Oracle|RunningOnOracle].
* How to [configure AppFuse for HSQLDB|AppFuseWithHSQLDB].
* How to [run AppFuse on PostgreSQL|AppFuseOnPostgreSQL].
At line 28 changed 1 line.
* How to [upgrade an AppFuse 1.x app to use Spring|AppFuseSpringUpgrade].
* How do I use a JNDI DataSource instead of a Spring-managed one (1.9+):
At line 30 changed 1 line.
* How to [use Velocity templates instead of JSPs|AppFuseVelocity].
;:In metadata/conf/tomcat-context*.xml, uncomment the JNDI DataSource settings. Then in web/WEB-INF/applicationContext-resources.xml, uncomment the JNDI "dataSource" bean - and delete the active "dataSource" bean. If you decide to make this a permanent change in your project, you can delete {{commons-dbcp.jar}} and {{commons-pool.jar}} from ''lib/jakarta-commons''.
At line 144 added 5 lines.
!!Application Server Specific [#7]
* To support multiple developers with the same instance of Tomcat, simply change "${webapp.name}" to "${user.name}" in the various deployment methods.
* How to [run AppFuse on Resin|AppFuseOnResin].
* How to [run AppFuse on Orion|AppFuseOnOrion].
* How to [run AppFuse on JBoss|AppFuseOnJBoss].
At line 150 added 1 line.
* How to setup/suppress [Tomcat 5.x Logging|Tomcat5Logging]
At line 36 changed 1 line.
* Is this the right place to ask Appfuse questions?
!!Continuous Integration [#8]
* [Using Anthill to automate AppFuse testing|AppFuseAnthill].
* [Using CruiseControl to automate AppFuse testing|AppFuseCruiseControl].
At line 38 changed 1 line.
;:''Sure, but you'll probably get more visibility and input from the [help forum|https://appfuse.dev.java.net/servlets/ForumMessageList?forumID=566] or [mailing list|https://appfuse.dev.java.net/servlets/SummarizeList?listName=users].''
!!Hibernate Specific Questions [#9]
* The [Hibernate Documentation|http://hibernate.org/5.html] is a good source of information.
* Learn more about [Hibernate's Relationships|http://www.xylax.net/hibernate/] (read the intro first).
* A couple of good Hibernate-XDoclet tutorials: [http://www.downside.ch/hibernate/] and [http://www.meagle.com:8080/hibernate.jsp].
* [Many articles|http://www.hibernate.org/78.html] listed on hibernate.org.
* How do I get hold of the [Hibernate Session|GettingHibernateSession]?
* How do I [Setup Hibernate JMX?|HibernateJMX]
* Does Hibernate support [Pagination?|HibernatePagination]
* How do I fix a LazyInitializationException in my unit tests?
;:''See [Karl Baum's writeup on Lazy Initialization|http://www.jroller.com/page/kbaum/20040708]. In particular, the __Being Lazy in your Unit Tests__ section.''
At line 40 changed 1 line.
* What are the major ant tasks? What do they do?
* __Do I have to use XDoclet to generate my *.hbm.xml files? Is it possible to override a single hbm.xml file and create it by hand?__
At line 42 changed 1 line.
;:''See [AppFuseAntTasks].''
<div style="margin-left: 30px">
If you have an @hibernate.class tag on a POJO - hibernatedoclet will generate the mapping file into build/dao/gen. If you have a mapping file (*.hbm.xml) file for your POJO in the src/dao/**/model/*
directory, it will __overwrite__ the generated version. If you don't want to worry about the two conflicting - just remove the @ sign from @hibernate.class in your POJO and put your hbm.xml file in the {{model}}
directory.
At line 44 changed 1 line.
* [Known Environment issues|AppFuseEnvironmentIssues] to be aware of.
No build.xml modification are need for this to work. The "package-dao" target will include these mapping files:
At line 46 changed 1 line.
* I'm have methods that throw exceptions in a Transaction and nothing is being rolled back. What gives?
{{{ <copy todir="${build.dir}/dao/gen">
<fileset dir="src/dao" includes="**/*.xml" excludes="**/*-${dao.type}.xml"/>
<filterset refid="variables.to.replace"/>
</copy>}}}
At line 48 changed 6 lines.
;:''MySQL's default tables (MyISAM) do not support transactions by default. Add the following line to your my.ini (C:\Windows) or my.cnf file.
<div style="margin-left: 40px">
{{{
[mysqld]
default-table-type=innodb
}}}
If you want to get rid of the hibernatedoclet process, you can do that- but make sure and run it first - and then copy all of the generated hbm.xml files into your {{model}} directory.
At line 56 changed 2 lines.
You could also use [PostgreSQL|http://raibledesigns.com/page/rd?anchor=postgresql_8_with_appfuse]''
!!Archived Questions (no longer relevant) [#10]
* How to [upgrade an AppFuse 1.x app to use Spring|AppFuseSpringUpgrade].

Back to AppFuseSupport, or to the Page History.