I am developing an JavaFX application and used the native packaging tool (incl. Inno Setup 5 and WiX) to create .exe files and installers. The program is a self-containing application. When I install and execute it on my own computer (Windows 10) it seems not to run. The error message after clicking the launch icon is: "no main class" and after closing this dialog another dialog error:"Failed to launch JVM"
build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="SVG Prototype Application" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<path id="fxant">
<filelist>
<file name="C:\Program Files\Java\jdk1.8.0_31\lib\ant-javafx.jar"/>
<file name="C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\jfxrt.jar"/>
<file name="${basedir}"/>
</filelist>
</path>
<taskdef classpathref="fxant"
resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"/>
<fx:application id="fxApplication"
name="Test Application"
mainClass="com.testlibrary.Main"
version="1.0"
/>
<fx:jar destfile="dist/test.jar">
<!-- Details about application -->
<fx:application name="SVGPrototype" mainClass="com.testlibrary.Main"/>
<!-- Define what auxilary resources are needed -->
<fx:resources>
<fx:fileset dir="dist" includes="lib/*.jar"/>
</fx:resources>
<!-- What to include into result jar file?
Everything in the build tree -->
<fileset dir="build/classes"/>
</fx:jar>
<fx:deploy height="400" nativeBundles="all" outdir="dist" outfile="SVGViewer" placeholderId="ZZZ" width="600">
<fx:application name="Test Application" mainClass="com.testlibrary.Main"/>
<fx:resources>
<fx:fileset dir="dist" includes="test.jar"/>
<fx:fileset dir="dist" includes="resources/**"/>
</fx:resources>
</fx:deploy>
package.cfg generated
app.mainjar=test.jar
app.version=1.0
app.id=com.testlibrary
app.preferences.id=com/testlibrary
app.mainclass=com/testlibrary/Main
app.classpath=
Does someone know where is the problem?
Thanks in advance!
Related
I am running an aspnet core consol program on centos.I have set up nlog.config to Generate log files. All is well in my windows development environment,but when I run it on Centos I can't get logs files using my settings.
My setting:
<target xsi:type="File" name="target1" fileName="${currentdir}\logs\${shortdate}-nlog.log" ... />
In centos:(click to show img)
It will create a file name "demoBS\logs\2019-06-26-nlog.log" in parent directory.
Thank you and look forward to your help!
Ps: Nlog.config
<?xml version="1.0" encoding="utf-8" ?>
<!-- XSD manual extracted from package NLog.Schema: https://www.nuget.org/packages/NLog.Schema-->
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
internalLogFile="${currentdir}\logs\${shortdate}-internal.log"
internalLogLevel="Info" >
<!-- the targets to write to -->
<targets>
<!-- write logs to file -->
<target xsi:type="File" name="target1" fileName="${currentdir}\logs\${shortdate}-nlog.log"
layout="${date}|${level:uppercase=true}|${message} ${exception}|${logger}|${all-event-properties}" />
<target xsi:type="Console" name="target2"
layout="${date}|${level:uppercase=true}|${message} ${exception}|${logger}|${all-event-properties}" />
</targets>
<!-- rules to map from logger name to target -->
<rules>
<logger name="*" minlevel="Trace" writeTo="target2,target1" />
</rules>
</nlog>
Make sure to use Unix-path instead of Windows-path. Ex:
${currentdir}/logs/${shortdate}-nlog.log
Turn the slashes the other way
I am trying to compile my project by using Ant.
I did. But I have some problem. I don't know how to resolve.
<!-- Compile Modules (S) -->
<target name="compileModules" depends="compileBLP">
<record name="${LOG_DIR}/LOG_${CURR_TIME_SUBFIX}${LOG_FILE_TYPE}" append="false" action="start" />
<cpmdl file="com/dou/pi/views/dm/Module1" />
<cpmdl file="com/dou/pi/views/pim/Module2" />
<record name="${LOG_DIR}/LOG_${CURR_TIME_SUBFIX}${LOG_FILE_TYPE}" action="stop" />
</target>
<!-- Compile Modules (E) -->
<macrodef name="cpmdl">
<attribute name="file" />
<sequential>
<echo>#{file}</echo>
<mxmlc file="${SRC_DIR}/#{file}.mxml" output='${DEPLOY_DIR}/#{file}.swf' optimize="true" debug="false" incremental="false" fork="true">
<compiler.source-path path-element="${SRC_DIR}" />
<source-path path-element="${FLEX_HOME}/frameworks" />
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs" />
</compiler.library-path>
<compiler.library-path dir="${basedir}" append="true">
<include name="libs" />
<include name="src/assets/swc" />
</compiler.library-path>
<source-path path-element="${SRC_DIR}" />
</mxmlc>
</sequential>
</macrodef>
You can see. If I compile 2 modules, I have to load file config 2 times.
[mxmlc] Loading configuration file C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in\sdks\4.1.0\frameworks\flex-config.xml
[mxmlc] D:\Projects\BLP\BUILD\DEPLOY\com\dou\pi\views\dm\Module1.swf (1233413 bytes)
[mxmlc] Loading configuration file C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in\sdks\4.1.0\frameworks\flex-config.xml
[mxmlc] D:\Projects\BLP\BUILD\DEPLOY\com\dou\pi\views\pim\Module2.swf (963045 bytes)
Maybe, that is not good.
I though, can we load it just 1 time?
Hope you can give me any suggestion.
Thanks.
There's really nothing to be done here. The loading of the config file is done internally by mxmlc, not ant. Remember, each time you call mxmlc in your ant script, it's launching a new instance of it, so each instance has to load the configuration for itself.
It's similar to how, if you launch your web browser, close it, and reopen it, you'll end up loading your homepage twice. There's nothing in the environment that can save the page to memory to pass it in to the second invocation of the program.
I created a custom Alfresco action dialog using one of the sample SDK projects
as a base. I kept the sample projects "org.alfresco.sample" package for my java files
and it worked fine.
Then I tried to change the package name to "com.xxxxxx.xxxxx" and it stopped working.
I have checked all of the files in the project to make sure that I have replaced every instance of "org.alfresco.sample" with my new package name.
Can anyone suggest a possible reason for this?
Thanks
I found that when I build the project, it is not building the java files. Can anyone
suggest why it is not building the java files with the new package name?
Thanks
I got the java files build again. But the new actions are still not being used. The new actions use an evaluator but it does not seem to be running. (It would normally write to
the log.)
Here is part of the build.xml:
<project name="Custom Dialog Build File" default="package-amp" basedir=".">
<property name="project.dir" value="."/>
<property name="build.dir" value="${project.dir}/build"/>
<property name="config.dir" value="${project.dir}/config"/>
<property name="jsp.dir" value="${project.dir}/web/jsp"/>
<property name="web.dir" value="${project.dir}/web" />
<property name="package.file.jar" value="${build.dir}/lib/custom-dialog.jar"/>
<property name="package.file.zip" value="${build.dir}/lib/custom-dialog.zip"/>
<property name="amp.file" value="${build.dir}/dist/retailChannels.amp"/>
<path id="class.path">
<dirset dir="${build.dir}" />
<fileset dir="../../lib/server" includes="**/*.jar"/>
</path>
<target name="compile">
<mkdir dir="${build.dir}" />
<javac classpathref="class.path" srcdir="${project.dir}/source" destdir="${build.dir}" />
</target>
<target name="package-jar" depends="increment-build-number">
<delete file="${package.file.jar}" />
<jar destfile="${package.file.jar}">
<fileset dir="${build.dir}">
<exclude name="dist/**" />
<exclude name="lib/**" />
<exclude name="web/**" />
</fileset>
</jar>
</target>
<target name="mkdirs">
<mkdir dir="${build.dir}/dist" />
<mkdir dir="${build.dir}/lib" />
</target>
<target name="clean">
<delete includeemptydirs="true">
<fileset dir="${build.dir}/dist" includes="**/*"/>
</delete>
</target>
<target name="package-amp" depends="clean, mkdirs, package-jar" description="Package the Module" >
<delete file="${amp.file}" />
<zip destfile="${amp.file}" >
<fileset dir="${project.dir}/build" includes="lib/*.jar" />
<fileset dir="${project.dir}/config/alfresco/module/alfresco" includes="*.properties" />
<fileset dir="${project.dir}" includes="config/**/*.*" excludes="**/module.properties" />
<fileset dir="${project.dir}/source">
<include name="web/jsp/**/*.jsp" />
<include name="web/images/**" />
</fileset>
</zip>
</target>
</project>
I just tried going through the maven SDK tutorial that you suggested but I got
this error:
Feb 14, 2014 3:42:48 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
Check the build.xml file. Double-check the compile and package-jar tasks (or similar). For example, one or both of these tasks may have a fileset that uses a pattern to include your classes using the package structure, and it may no longer match now that you've changed your package name.
It's hard to tell without seeing your build.xml.
By the way, if you want a more up-to-date example for creating actions in Alfresco, take a look at this tutorial: http://ecmarchitect.com/alfresco-developer-series-tutorials/actions/tutorial/tutorial.html
It uses the Alfresco Maven SDK to package AMPs. The Alfresco Maven SDK is preferred over the old SDK you are using.
I have an application which has refrences to 4 - 5 external jar (lib). But when i run my application on netbeans , netbeans first loads the jar file and after that my application scene appears. And I am trying to use the javafx preloader as well for splash screen. But preloader scene also loads after the jar files loading.
But I want to have loading of jars during my preloader scene is displaying i.e i want the loading of jars as a progress to my splash screen and then my main application scene should start. Pls help
My JNLP file
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="Black.jnlp">
<information>
<title>Black</title>
<vendor>RATTAN</vendor>
<description>Sample JavaFX 2.0 application.</description>
<offline-allowed/>
</information>
<resources os="Windows">
<jfx:javafx-runtime version="2.0+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
</resources>
<resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="Black.jar" size="2407915" download="eager" />
<jar href="lib/commons-codec-1.6.jar" size="253494" download="eager" />
<jar href="lib/commons-io-1.3.2.jar" size="95657" download="eager" />
<jar href="lib/commons-lang-2.0.jar" size="179419" download="eager" />
<jar href="lib/newlink.jar" size="6161" download="eager" />
<jar href="lib/scribe-1.3.0.jar" size="74544" download="eager" />
</resources>
<security>
<all-permissions/>
</security>
<applet-desc width="800" height="600" main-class="com.javafx.main.NoJavaFXFallback" name="Black" />
<jfx:javafx-desc width="800" height="600" main-class="test.Test" name="Black" />
<update check="always"/>
</jnlp>
I have used another preloader project which i have configured as preloader to my main project in netbeans
Follow the documentation on Packaging an Application with a Preloader.
Check your generated jnlp file, it should contain values something similar to this:
<resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="lib/FirstPreloader.jar" size="2801" download="progress" />
<jar href="AnimatedCircles.jar" size="13729" download="always" />
</resources>
<applet-desc width="800" height="600"
main-class="com.javafx.main.NoJavaFXFallback" name="AnimatedCircles" />
<jfx:javafx-desc width="800" height="600"
main-class="animatedcircles.AnimatedCircles" name="AnimatedCircles"
preloader-class="firstpreloader.FirstPreloader"/>
<update check="background"/>
Note some important tags download="progress" on the Preloader jar, preloader-class and update check="background".
There is also a download=lazy value you can set on some dependent jars if you like (see the jnlp spec). Lazy download might not really be needed if you have a preloader, but it is defined as:
This means the resource does not have to be downloaded onto the client system before the application is launched.
Note once update checks are switched on and lazy downloading is being used, it can be pretty difficult to accurately debug your application during development because on execution, the app may use cached versions of code rather the latest version of code. So these kind of switches are best just used for final deployment.
Also read thread the Performance Tips section of the JavaFX deployment guide.
I'm attempting to compile a Flex application from an ANT script, inside of Eclipse (CFBuilder, based on Eclipse), and I've run into this error:
Could not load definitions from resource flexTasks.tasks. It could not be found.
I haven't been able to find anything that gives directions on where this file (flexTasks.tasks) should be copied to, if it's needed at all. Some places indicate that it should be part of the flexTasks.jar file. I've tried two different things:
Copy the jar file into the ant/plugins/lib folder (and restart my CF Builder instance)
Specify the path to the jar in the classpath attribute, as suggested by the comment on this page
Neither helps me get past this error.
Here's my build script, for reference:
<project name="Tagging" default="compile-tagging" basedir=".">
<!-- setup flex compilation capability -->
<taskdef resource="flexTasks.tasks" />
<property name="flex.src" value="./src" />
<property name="flex.bin" value="./bin"/>
<target name="compile-tagging">
<mxmlc
file="${flex.src}/main.mxml"
output="${flex.bin}/main.swf"
keep-generated-actionscript="true">
<source-path path-element="${FLEX_HOME}/frameworks" />
</mxmlc>
</target>
</project>
Adam, I believe you need to tell taskdef where to look for the file. try keeping flextasks.jar in the same directory as your ant file (for now... you can move it later after you get it working).
then, you can do something like this:
<taskdef name="mxmlc" classname="WhateverTheTaskIsNamed" classpath="flexTAsks.jar" />
While not ideal, this code is working for me at the moment:
<project name="IOLTagging" default="go" basedir=".">
<!-- setup flex compilation capability -->
<property name="FLEX_HOME" value="C:/program files (x86)/Adobe/Adobe Flash Builder Beta 2/sdks/3.4.1/" />
<taskdef name="mxmlc" classname="flex.ant.MxmlcTask" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<taskdef name="html-wrapper" classname="flex.ant.HtmlWrapperTask" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<property name="flex.src" value="./src" />
<property name="flex.bin" value="./bin"/>
<property name="swf.name" value="main" />
<target name="go" depends="compile-flex" />
<target name="compile-flex">
<mxmlc
file="${flex.src}/main.mxml"
output="${flex.bin}/${swf.name}.swf"
debug="false"
keep-generated-actionscript="false">
<source-path path-element="${FLEX_HOME}/frameworks" />
<compiler.library-path dir="${basedir}/libs" append="true">
<include name="*.swc" />
</compiler.library-path>
</mxmlc>
</target>
</project>
I had the same problem, and the reason was in lack of permissions to acces $FLEX_HOME/ant.
You can also put the flexTasks.jar in ~/.ant/lib directory
If you run ant -diagnostics you should see the jar in USER_HOME/.ant/lib jar listing
I think you should have solved this problem. just trying flexmonkey today and also got the same problem.
"Could not load definitions from resource flexTasks.tasks. It could not be found."
solution is to make sure the flexTasks.jar is included in the dir lib of your project workplace.
when I copied flexTasks.jar from flashbuild folder \ant\lib and built it again. the problem is fixed.