Deploying .war containing JavaFX .jar to GlassFish NoClassDefFoundError - glassfish

My JavaFX application requires a class in another jar file.
Both are deployed as part of a war file
The JavaFX jar is not finding the my-xxx.class contained in WEB-INF/lib/MyJavaFXClient.jar
The contents of my war file are:
images/
META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/lib/
WEB-INF/lib/bin/glass.dll
WEB-INF/lib/MyJavaFxClient.jar ( this is the jar my JavaFX app requires )
WEB-INF/sun-web.xml
WEB-INF/web.xml
index.jsp
index.html
MyJavaFxApp.jnlp
MyJavaFxApp.jar (my JavaFx app)
JNLP:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="MyJavaFxApp.jnlp">
<information>
<title>App: TestDriver</title>
<vendor>Demo</vendor>
<description>JavaFX application test client</description>
<homepage href="http://localhost:8080/testdriver/"/>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<jfx:javafx-runtime version="2.2+"
href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows- i586/javafx2.jnlp"/>
</resources>
<resources>
<j2se version="1.6+" java-vm-args="-verbose:class
href="http://java.sun.com/products/autodl/j2se"/>
<property name="javafx.verbose" value="true"/>
<property name="java.library.path" value="WEB-INF/lib/bin"/>
<jar href="MyJavaFxApp.jar" size="318607" download="eager" />
</resources>
<applet-desc width="800" height="600"
main-class="com.javafx.main.NoJavaFXFallback"
name="MyJavaFxApp" >
<param name="requiredFXVersion" value="2.2+"/>
</applet-desc>
<jfx:javafx-desc width="800" height="600"
main-class="ui.client.MyJavaFXMain" name="MyJavaFxApp" />
<update check="background"/>
</jnlp>

Related

Wrong directory of the bat file?

I am trying to create a installer with IzPack. I am trying to execute a batch file before the installation.
install.xml
<izpack:installation version="5.0"
xmlns:izpack="http://izpack.org/schema/installation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/installation http://izpack.org/schema/5.0/izpack-installation-5.0.xsd">
<guiprefs width="640" height="480" resizable="yes"/>
<variables>
<variable name="DesktopShortcutCheckboxEnabled" value="true"/>
</variables>
<locale>
<langpack iso3="eng"/>
</locale>
<resources>
<res id="ProcessPanel.Spec.xml" src="ProcessPanel.Spec.xml"/>
<res id="shortcutSpec.xml" src="shortcutSpec.xml"/>
<res id="LicencePanel.licence" src="License.txt"/>
<res id="InfoPanel.info" src="Readme.txt"/>
</resources>
<panels>
<panel classname="HelloPanel"/>
<panel classname="ProcessPanel"/>
<panel classname="LicencePanel"/>
<panel classname="TargetPanel"/>
<panel classname="PacksPanel"/>
<panel classname="InstallPanel"/>
<panel classname="ShortcutPanel"/>
<panel classname="FinishPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<file src="Readme.txt" targetdir="$INSTALL_PATH"/>
<file src="License.txt" targetdir="$INSTALL_PATH"/>
<file src="phone.ico" targetdir="$INSTALL_PATH"/>
<fileset dir="lib" targetdir="$INSTALL_PATH\lib">
<include name="**"/>
</fileset>
</pack>
</packs>
<native type="izpack" name="ShellLink.dll"/>
<native type="3rdparty" name="COIOSHelper.dll" stage="both">
<os family="windows"/>
</native>
</izpack:installation>
ProcessPanel.Spec.xml
<?xml version="1.0" encoding="UTF-8" ?>
<processing>
<job name="doxyz">
<os family="windows" />
<executefile name="$INSTALL_PATH/scripts/mytest.bat">
<arg>doit</arg><arg>$variable</arg>
</executefile>
</job>
<onFail previous="true" next="false" />
<onSuccess previous="false" next="true" />
</processing>
At the compile time, I don't get any error! But when I am executing the install.jar and when I open the ProcessPanel I am getting the following error:
I used the:
izpack-dist-5.0.6
to generate the installer and my java version is:
java version "1.8.0_66" Java(TM) SE Runtime Environment
(build 1.8.0_66-b18) Java HotSpot(TM) 64-Bit Server VM (build 25.66-b18, mixed mode)
I would call this an expected behaviour.
The file $INSTALL_PATH/scripts/mytest.bat cannot be found because it isn't probably preinstalled due to the activation order of the panels. ProcessPanel is shown before InstallPanel, but InstallPanel is the one installing the file. Problems of this kind the compiler does NOT complain about, you must care about them on your own. It is more or less a problem of the logic introduced by the installer description, not of IzPack.

Izpack simple installation just to copy files

I am trying to make a very simplistic installer using IzPack. It should do the following two things
1. Copy and paste all the content of dist directory to UserHome/MyApp dir.
2. Execute a batch file to edit registry entry to start the jar file on user logon.
But I am stuck at the first step only! nothing is installed if I use the following XML and generate the installer. Generated installer runs and does show the InstallPanel but nothing is copied to the user_home directory.
From what it seems like I am not able to assign value to Install_path variable.
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
<variables>
<variable name="INSTALL_PATH" value="$USER_HOME/MyApp"/>
</variables>
<info>
<appname>My App</appname>
<appversion>1.0</appversion>
<authors>
<author name="My APP Author" email="support#myapp.com"/>
</authors>
<url>http://SomeURL.net</url>
</info>
<guiprefs width="640" height="480" resizable="yes"/>
<locale>
<langpack iso3="eng"/>
</locale>
<panels>
<panel classname="InstallPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<fileset dir="dist" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
</installation>
UPDATE
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
<variables>
<variable name="TargetPanel.dir.windows" value="$USER_HOME\MyTeamNinja"/>
<variable name="TargetPanel.dir.mac" value="$USER_HOME/MyTeamNinja"/>
</variables>
<info>
<appname>My App</appname>
<appversion>1.0</appversion>
<authors>
<author name="MyTeamNinja" email="support#MyTeamNinja.com"/>
</authors>
<url>http://myteam.ninja</url>
</info>
<guiprefs width="640" height="480" resizable="yes"/>
<locale>
<langpack iso3="eng"/>
</locale>
<panels>
<panel classname="DefaultTargetPanel"/>
<panel classname="InstallPanel"/>
<panel classname="SimpleFinishPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<fileset dir="dist" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
</installation>
Now as soon as I click the installer it starts the install but in c:\program files\My App\
what you need is a TargetPanel. it allows the user to select the destination dir. to install the files. the location selected in this panel sets the value of $INSTALL_PATH.
however, you may also override the default value of the $INSTALL_PATH.in order to override the default value of $INSTALL_PATH, you may do the following:
<variables>
<variable name="TargetPanel.dir.windows" value="$USER_HOME/MyApp"/>
<variable name="TargetPanel.dir.unix" value="$USER_HOME/MyApp"/>
</variables>
or,
<variables>
<variable name="DEFAULT_INSTALL_PATH" value="$USER_HOME/MyApp"/>
</variables>
and also, remember to include the TargetPanel before the InstallPanel in case you choose to allow the user to select the target loc. for the installation.
<panels>
<panel classname="TargetPanel"/>
<panel classname="InstallPanel"/>
</panels>
See HERE for more on this.
UPDATE:
place the entry for TargetPanel before the InstallPanel in the <panels> section.
remove the <resources> section:
<resources>
<res id="TargetPanel.dir.windows" src="$USER_HOME/MyApp"/>
<res id="TargetPanel.dir.unix" src="$USER_HOME/MyApp"/>
</resources> This is where the error is being generated. Instead use <variables> to specify default values for ${INSTALL_PATH} (see in my answer above).
also, to set a value for ${INSTALL_PATH} through <variables> you need to use name="DEFAULT_INSTALL_PATH" or TargetPanel.dir.windows/unix
UPDATE 2: The following piece of code installs in the correct location (as specified by you in the defaultInstallDir.txt).
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
<!-- variables>
<variable name="TargetPanel.dir.windows" value="$USER_HOME\MyTeamNinja"/>
<variable name="TargetPanel.dir.mac" value="$USER_HOME/MyTeamNinja"/>
</variables -->
<!-- remove the above <varible> section and include the REQUIRED defaultInstallDir.txt to set the value for the DefaultTargetPanel -->
<resources>
<res id="TargetPanel.dir" src="defaultInstallDir.txt"/>
</resources>
<info>
<appname>My App</appname>
<appversion>1.0</appversion>
<authors>
<author name="MyTeamNinja" email="support#MyTeamNinja.com"/>
</authors>
<url>http://myteam.ninja</url>
</info>
<guiprefs width="640" height="480" resizable="yes"/>
<locale>
<langpack iso3="eng"/>
</locale>
<panels>
<panel classname="DefaultTargetPanel"/>
<panel classname="InstallPanel"/>
<panel classname="SimpleFinishPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<fileset dir="dist" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
</installation>
now, create a file named defaultInstallDir.txt and simply write the following within this file :
$USER_HOME/MyApp
just make sure that you include this file correctly in the installer through the src=".." attribute of the <resources> section and you're good to go.
double clicking on the installer directly installs the files in $USER_HOME/MyApp (in my case: at C:\Users\Sunny\MyApp)

setup installer script in magento module

Hi i am developing a little magento module.
below is my directory structure of module
app/code/local/Xyz/Total
/var/www/magext/app/code/local/Xyz/Total/Block/Prototal.php
/var/www/magext/app/code/local/Xyz/Total/controllers/IndexController.php
/var/www/magext/app/code/local/Xyz/Total/etc/config.xml
/var/www/magext/app/code/local/Xyz/Total/Model/Price/Observer.php
below is my config file code
<?xml version="1.0"?>
<config>
<global>
<blocks>
<total>
<class>Xyz_Total_Block</class>
</total>
</blocks>
<models>
<xyztotal>
<class>Xyz_Total_Model</class>
</xyztotal>
</models>
<events>
<sales_order_place_after>
<observers>
<xyz_total_price_observer>
<type>singleton</type>
<class>Xyz_Total_Model_Price_Observer</class>
<method>apply_discount_percent</method>
</xyz_total_price_observer>
</observers>
</sales_order_place_after>
</events>
</global>
<frontend>
<routers>
<total>
<use>standard</use>
<args>
<module>Xyz_Total</module>
<frontName>newcatalog</frontName>
</args>
</total>
</routers>
<layout>
<updates>
<total>
<file>total.xml</file>
</total>
</updates>
</layout>
</frontend>
</config>
now what i need to install a product attribute through my module
.But i cant understand understand where should i put my installer
script and how to modify config file.
please suggest.
I saw your config.xml i am not able to find xml vesrion.
So you need to give xml version like below example:
<config>
<modules>
<Xyz_Total>
<version>0.1.0</version> <!-- Version of module -->
</Xyz_Total>
</modules>
</config>
Now create the file app/code/local/Xyz/Total/sql/total_setup/mysql4-install-0.1.0.ph‌​p
After that reinstall the module And check it.
You also have to add below code in config.xml under config tag.
<global>
<resources> <!-- These are resource setting giving access to module, read/write permission on database -->
<total_setup>
<setup>
<module>Xyz_Total</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</total_setup>
<total_write>
<connection>
<use>core_write</use>
</connection>
</total_write>
<total_read>
<connection>
<use>core_read</use>
</connection>
</total_read>
</resources>
</global>
After that reinstall module.
Take a look # Adding custom product attributes in Magento using setup script
<modules>
<Xyz_Total>
<version>0.1.0</version>
</Xyz_Total>
</modules>
<global>
....
<models>
<xyztotal>
<class>Xyz_Total_Model</class>
<resourceModel>total_setup</resourceModel>
</xyztotal>
</models>
<resources>
<catalog_setup>
<setup>
<module>Mage_Catalog</module>
<class>Mage_Catalog_Model_Resource_Setup</class><!-- that line !-->
</setup>
</catalog_setup>
</resources>
...
In
app/code/local/Xyz/Total/sql/total_setup/mysql4-install-0.1.0.ph‌​p
$installer->addAttribute('catalog_product', 'offer_type', array(
'backend' => '',
...
));

Apache Ant + Ivy syntax error

I have just setup my first project using apache ant with ivy as dependency manager. It is working great! But I have one thing I cannot get over. Since I have several dependencies that use slf4j there is a conflict with version mismatches. So I defined a conflict tag in the ivy.xml to force a certain version (1.5.6 in this case). Running the Ivy resolve with eclipse plugin IvyIDE works without error. But when using my ant build file to build my application I get a xml syntax error:
Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Buildfile: B:\core-lib\build.xml
parsing buildfile B:\core-lib\build.xml with URI = file:/B:/core-lib/build.xml
Project base dir set to: B:\core-lib
parsing buildfile jar:file:/C:/Program%20Files/InformDevTools/eclipse/plugins/org.apache.ant_1.8.2.v20120109-1030/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/InformDevTools/eclipse/plugins/org.apache.ant_1.8.2.v20120109-1030/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
Build sequence for target(s) `resolve' is [clean, init, resolve]
Complete build sequence is [clean, init, resolve, compile, resources, test, dist, ]
clean:
[delete] Deleting directory B:\core-lib\build
[delete] Deleting directory B:\core-lib\build\lib
[delete] Deleting directory B:\core-lib\build\main
[delete] Deleting directory B:\core-lib\build\report\test
[delete] Deleting directory B:\core-lib\build\report
[delete] Deleting directory B:\core-lib\build\test
[delete] Deleting directory B:\core-lib\build
[delete] Deleting directory B:\core-lib\dist
[delete] Deleting directory B:\core-lib\dist
init:
Override ignored for property "DSTAMP"
Override ignored for property "TSTAMP"
Override ignored for property "TODAY"
[mkdir] Created dir: B:\core-lib\build
[mkdir] Created dir: B:\core-lib\build\main
[mkdir] Created dir: B:\core-lib\build\lib
[mkdir] Created dir: B:\core-lib\dist
[mkdir] Created dir: B:\core-lib\build\test
[mkdir] Created dir: B:\core-lib\build\report\test
resolve:
parsing buildfile jar:file:/C:/Users/admin/.eclipse/org.eclipse.platform_3.7.0_1992851616/plugins/org.apache.ivy.eclipse.ant_2.3.0.cr120120416000235/ivy.jar!/org/apache/ivy/ant/antlib.xml with URI = jar:file:/C:/Users/admin/.eclipse/org.eclipse.platform_3.7.0_1992851616/plugins/org.apache.ivy.eclipse.ant_2.3.0.cr120120416000235/ivy.jar!/org/apache/ivy/ant/antlib.xml from a zip file
[ivy:retrieve] No ivy:settings found for the default reference 'ivy.instance'. A default instance will be used
[ivy:retrieve] Loading jar:file:/C:/Users/admin/.eclipse/org.eclipse.platform_3.7.0_1992851616/plugins/org.apache.ivy.eclipse.ant_2.3.0.cr120120416000235/ivy.jar!/org/apache/ivy/core/settings/ivy.properties
[ivy:retrieve] searching settings file: trying B:\core-lib\ivysettings.xml
[ivy:retrieve] :: Apache Ivy 2.3.0-rc1 - 20120416000235 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] jakarta commons httpclient not found: using jdk url handling
[ivy:retrieve] :: loading settings :: file = B:\core-lib\ivysettings.xml
[ivy:retrieve] no default ivy user dir defined: set to C:\Users\admin\.ivy2
[ivy:retrieve] no default cache defined: set to C:\Users\admin\.ivy2\cache
[ivy:retrieve] settings loaded (31ms)
[ivy:retrieve] default cache: C:\Users\admin\.ivy2\cache
[ivy:retrieve] default resolver: inform-artifactory
[ivy:retrieve] -- 5 resolvers:
[ivy:retrieve] inform [release] [ibiblio]
[ivy:retrieve] inform [snapshot] [ibiblio]
[ivy:retrieve] inform [proxied] [ibiblio]
[ivy:retrieve] inform-artifactory [chain] [inform [proxied], inform [third-party], inform [release], inform [snapshot]]
[ivy:retrieve] inform [third-party] [ibiblio]
[ivy:retrieve] no resolved descriptor found: launching default resolve
Overriding previous definition of property "ivy.version"
[ivy:retrieve] using ivy parser to parse file:/B:/core-lib/ivy.xml
[ivy:retrieve] [xml parsing: ivy.xml:28:108: cvc-complex-type.2.4.a: Ungültiger Content wurde beginnend mit Element "dependency" gefunden. "{conflict}" wird erwartet. in file:/B:/core-lib/ivy.xml
[ivy:retrieve] ]
BUILD FAILED
B:\core-lib\build.xml:77: syntax errors in ivy file: java.text.ParseException: [xml parsing: ivy.xml:28:108: cvc-complex-type.2.4.a: Ungültiger Content wurde beginnend mit Element "dependency" gefunden. "{conflict}" wird erwartet. in file:/B:/core-lib/ivy.xml
]
at org.apache.ivy.ant.IvyResolve.doExecute(IvyResolve.java:396)
at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
at org.apache.ivy.ant.IvyPostResolveTask.ensureResolved(IvyPostResolveTask.java:231)
at org.apache.ivy.ant.IvyPostResolveTask.prepareAndCheck(IvyPostResolveTask.java:178)
at org.apache.ivy.ant.IvyRetrieve.doExecute(IvyRetrieve.java:87)
at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
Caused by: java.text.ParseException: [xml parsing: ivy.xml:28:108: cvc-complex-type.2.4.a: Ungültiger Content wurde beginnend mit Element "dependency" gefunden. "{conflict}" wird erwartet. in file:/B:/core-lib/ivy.xml
]
at org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser$AbstractParser.checkErrors(AbstractModuleDescriptorParser.java:89)
at org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser$AbstractParser.getModuleDescriptor(AbstractModuleDescriptorParser.java:344)
at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser.parseDescriptor(XmlModuleDescriptorParser.java:117)
at org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser.parseDescriptor(AbstractModuleDescriptorParser.java:48)
at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:184)
at org.apache.ivy.Ivy.resolve(Ivy.java:503)
at org.apache.ivy.ant.IvyResolve.doExecute(IvyResolve.java:326)
... 20 more
Total time: 500 milliseconds
If I remove the conflict definition, the build works as expected. Here is the ivy.xml:
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="eu.inform" module="isac3-core" revision="1.0-snapshot"></info>
<configurations>
<conf name="build" description="provide business logic for isac3"/>
<conf name="test" extends="build" visibility="private" description="just for JUnit testing"/>
</configurations>
<publications>
<artifact name="core-lib" type="jar" conf="build" ext="jar"/>
</publications>
<dependencies>
<dependency org="org.apache.commons" name="commons-lang3" rev="3.1" conf="build->default"/>
<dependency org="commons-codec" name="commons-codec" rev="1.6" conf="build->default"/>
<dependency org="org.apache.mina" name="mina-core" rev="2.0.4" conf="build->default"/>
<dependency org="org.apache.tika" name="tika-app" rev="1.1" conf="build->default"/>
<!--
Resolve conflict for SLF4J by selecting the latest compatible version:
Apache tika comes packaged with slf4j 1.5.6, so we cannot exclude this dependency because it is part of the jar.
Hibernate specifies a dependency to slf4j 1.6.1 by maven pom file.
-->
<conflict org="org.slf4j" rev="1.5.6"/>
<dependency org="org.springframework" name="spring-aop" rev="3.1.1.RELEASE" conf="build->default"/>
<dependency org="org.aspectj" name="aspectjweaver" rev="1.5.4" conf="build->default"/>
<dependency org="org.springframework" name="spring-orm" rev="3.1.1.RELEASE" conf="build->default">
<!-- don't include any ORM implementation since we defined the one we use -->
<exclude org="org.eclipse.persistence" />
<exclude org="toplink.essentials" />
<exclude org="org.apache.ibatis" />
<exclude org="org.apache.openjpa" />
<exclude org="org.hibernate" />
</dependency>
<dependency org="org.hibernate" name="hibernate-core" rev="4.1.4.Final" conf="build->default"/>
<dependency org="org.hibernate" name="hibernate-ehcache" rev="4.1.4.Final" conf="build->default"/>
<dependency org="org.hibernate" name="hibernate-envers" rev="4.1.4.Final" conf="build->default"/>
<dependency org="org.hibernate" name="hibernate-search-engine" rev="4.1.1.Final" conf="build->default"/>
<dependency org="org.hibernate" name="hibernate-search-orm" rev="4.1.1.Final" conf="build->default"/>
<dependency org="c3p0" name="c3p0" rev="0.9.1.2" conf="build->default"/>
<dependency org="de.jollyday" name="jollyday" rev="0.4.6" conf="build->default"/>
<dependency org="log4j" name="log4j" rev="1.2.17" conf="build->default"/>
<!-- JDBC drivers -->
<dependency org="net.sourceforge.jtds" name="jtds" rev="1.2.4" conf="build->default"/>
<dependency org="com.microsoft" name="sqljdbc4" rev="4.0" conf="build->default"/>
<dependency org="com.oracle" name="ojdbc6" rev="11.2.0.3" conf="build->default"/>
<!-- dependencies solely for testing purposes (none-deployed) -->
<dependency org="junit" name="junit" rev="4.10" conf="test->default"/>
</dependencies>
And that is the ant build.xml (I left out unnecessary lines to keep it more compact):
<?xml version="1.0" encoding="ISO-8859-1"?>
<property name="src_base" location="src/main" />
<property name="src" location="${src_base}/java" />
<property name="config" location="${src_base}/config" />
<property name="resource" location="${src_base}/resource" />
<property name="build" location="build" />
<property name="buildSrc" location="${build}/main" />
<property name="lib" location="${build}/lib" />
<property name="dist" location="dist" />
<property name="distName" value="isac3-core-lib" />
<property name="distFileName" value="${distName}-${build.timestamp}.jar" />
<property name="zipFileName" value="${distName}-${build.timestamp}.zip" />
<property name="test.src" location="src/test/java" />
<property name="test.build" location="build/test" />
<property name="test.reports" location="build/report/test" />
<property name="ant.build.javac.source" value="1.7" />
<!-- Source-level version number -->
<property name="ant.build.javac.target" value="1.7" />
<!-- Class-compatibility version number -->
<property name="build.compiler" value="modern" />
...
<!-- =================================
target: init
================================= -->
<target name="init" depends="clean">
<!-- Create the time stamp -->
<tstamp />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}" />
<mkdir dir="${buildSrc}" />
<mkdir dir="${lib}" />
<mkdir dir="${dist}" />
<mkdir dir="${test.build}" />
<mkdir dir="${test.reports}" />
</target>
<!-- =================================
target: resolve
================================= -->
<target name="resolve" depends="init" description="retrieve dependencies with ivy">
<ivy:retrieve pattern="${lib}/[conf]/[artifact].[ext]" />
</target>
...
The error happens in the ant target 'resolve'. Ivy seems to be loaded an the settings file is also used as expected. But as already mentioned I get that syntax error.
Has anyone seen this before and can give me a hint?
Regards,
Sebastian
I copied your work and I had the same error, but not in German ;)
Anyway, I tried putting the conflict tag at the end and it worked.
so now it looks like this:
<dependencies>
... all dependencies
<!-- dependencies solely for testing purposes (none-deployed) -->
<dependency org="junit" name="junit" rev="4.10" conf="test->default"/>
<conflict org="org.slf4j" rev="1.5.6" />
</dependencies>
Another thing, it might be a copy-paste mistake, but you have to make sure ivy.xml file ends with
</ivy-module>.
Let us know.

Problems getting Tiles work with Struts2

I'm using struts 2.2.1 and tiles 2.2.2. I've done every step described here but I cannot get tiles work... I get the following error while deploying my war to glassfish 3.1:
[#|2011-10-04T08:43:28.117+0200|SEVERE|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=74;_ThreadName=AutoDeployer;|Exception while invoking class com.sun.enterprise.web.WebApplication start method
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:130)
In my WEB-INF/lib I've got commons-collections-3.1.jar, commons-fileupload-1.2.1.jar, struts2-core-2.2.1.jar, tiles-api-2.2.2.jar, tiles-core-2.2.2.jar, tiles-jsp-2.2.2.jar and xwork-core-2.2.1.jar.
This is my struts.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<package name="basicstruts2" extends="struts-default">
<interceptors>
<interceptor-stack name="appDefault">
<interceptor-ref name="defaultStack">
<param name="exception.logEnabled">true</param>
<param name="exception.logLevel">ERROR</param>
</interceptor-ref>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="appDefault" />
<result-types>
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
</result-types>
<global-results>
<result name="exception">/jsp/exceptions/exception.jsp</result>
<result name="webServiceException">/jsp/exceptions/webserviceexception.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="exception" />
<exception-mapping exception="java.io.IOException" result="exception" />
<exception-mapping exception="exceptions.WebServiceExceptionForStruts"
result="webServiceException" />
</global-exception-mappings>
<action name="tilesTest" class="test.action.TilesTest">
<result name="success" type="tiles">/welcome.tiles</result>
</action>
<action name="index">
<result>/jsp/index.jsp</result>
</action>
</package>
</struts>
After inserting the code into my struts.xml, I get this error in eclipse:
And this is my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Consumer</display-name>
<welcome-file-list>
<welcome-file>/jsp/index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
<context-param>
<param-name>tilesDefinitions</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
</web-app>
Thank you very much!
You're missing the S2 tiles plugin. It's listed in the referenced article.
Your second issue with the XML is clearly stated in the IDE error; the order of elements given in the error message isn't the order you define the elements in your XML file.
ClassNotFoundException, looks like missing jar issue. Can you see the tiles plugin jar in war that is getting deployed on glassfish server.if not check check the war creation setting in you IDE. We faced this problem when it was not pushing jars from lib to the war.
ClassNotFoundException Always alerts you that some class/jar which is referenced is missing. Make sure you have all the basic jars required for tiles.
In my case, I have these jars (besides struts2 jars) in my struts2 application to test a demo tile project.
commons-beanutils-1.7.0.jar
commons-digester-2.0.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
ognl-3.0.1.jar
slf4j-api-1.6.2.jar
slf4j-simple-1.6.2.jar
struts2-tiles-plugin-2.2.3.1.jar
tiles-api-2.2.2.jar
tiles-compat-2.2.2.jar
tiles-core-2.2.2.jar
tiles-jsp-2.2.2.jar
tiles-servlet-2.2.2.jar
tiles-template-2.2.2.jar
Best of luck.
Regards,
Amir Ali