Launching GWT dev mode in eclipse debugger - eclipse

This is for GWT 2.7.0 and Google App Engine 1.9.34
I have a GWT application that works fine launching the app using Super Dev Mode in an ANT build script from within Eclipse. This is the ANT task:
<target name="hosted" depends="javac" description="Run hosted mode">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode">
<classpath>
<pathelement location="${src.dir}"/>
<path refid="project.class.path"/>
</classpath>
<jvmarg value="-Xmx1536M"/>
<arg value="-startupUrl"/>
<arg value="eDaptiv.html"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg value="${entrypoint.class}"/>
</java>
The Dev mode debugger comes up and the logging is directed to the console within Eclipse.
When I try to run the app using the using the Run -> Debug using the Google Web App run configuration I get the error shown below. I am aware that Google App-engine does not support JDBC but cannot understand why it seems to work when using the ANT build script to launch. I assume that somehow I need to configure Google Web App to somehow not use the App engine but do not seem to find a way to disable it.
=== 2017-01-15 17:09:56,511 [70-0] ERROR ScreenLoaderServlet - screenLoader - com.isomorphic.servlet.ScreenLoaderServlet top-level exception
java.lang.NoClassDefFoundError: java.lang.management.ManagementFactory is a restricted class. Please see the Google App Engine developer's guide for more details.
at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:52)
at com.isomorphic.util.IOUtil._threadSafeTmpFileName(IOUtil.java:321)
at com.isomorphic.util.IOUtil.threadSafeTmpFileName(IOUtil.java:311)
at com.isomorphic.sql.SQLDriver.(SQLDriver.java:2281)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:259)
at com.google.appengine.tools.development.agent.runtime.RuntimeHelper.checkRestricted(RuntimeHelper.java:70)
at com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:65)
at com.isomorphic.sql.SQLDataSource.init(SQLDataSource.java:309)

Seems that just posting the question has lead my thoughts to the answer ....
In Eclipse Neon there is no checkbox for excluding the Google App Engine.
However, in the run configuration for my app under Google Web App the "(x)=Arguments" tab one of the arguments was this:
-server com.google.appengine.tools.development.gwt.AppEngineLauncher
Simply removing that argument appeared to be the solution as it worked on removing that then executing debug mode.
However, simply removing the -server option does not persist .... something comes back around and adds it back in again after the debug session is terminated so when you try and run it again you are back to the same error if you do not remove it before running.
The persisted solution is to change it to:
-server com.google.gwt.dev.shell.jetty.JettyLauncher

Related

No show anymore message of publisher Java Web Start

I have developed an application via Java Web Start more or less according to this: How do I fix "missing Codebase, Permissions, and Application-Name manifest attribute" in my JNLP app? I have packed the jar with manifest.txt, etc..but in this way I have resolved missing attributes problem, and now I have other problem this message is always showed!! I checked "No show again" and each time I press button to execute and always is showed!! I
Adicionally this is my manifest file:
Manifest-Version: 1.0
Class-Path: .
Main-Class: com.zkteco.biometric.AccesoBiometrioAS2
Permissions: all-permissions
Codebase: http://192.168.111.25:8180/pos-web/
Application-Name: Biometrico
And my Jnlp File this:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://192.168.111.25:8180/pos-web/">
<information> <title>CajaPos</title> <vendor>xxx</vendor>
</information>
<security><all-permissions/>
</security>
<resources>
<j2se version="1.2+"/>
<jar href="xx.jar"
main="true" />
</resources
<application-desc main-class="ec.com.xx.pos" type="JavaFX">
<argument>XY</argument>
</application-desc>
</jnlp>
In this page after check the dialog is not showed again and works fine.
https://docs.oracle.com/javase/tutorial/deployment/webstart/deploying.html
Where XY change for each request because I generate jnlp-xml in a dynamically way with a servlet.
This is due to your Java settings. It is a security prompt. There’s nothing you can change in your application to prevent this dialog, it is up to the end-user to change their security settings to show/hide these dialog windows.
Edit: I also recommend migrating your app to a different delivery platform because Java Web Start is being violently turned off by Oracle.

Worklight ant tasks for deployment

I am using this documentation.
It tells me to do a ant target like this.
<target name="Deploy App">
<app-deployer deployable="${build.apps.dir}/app.wlapp"
worklightServerHost="http://${customConfig.worklightServer.host}:${customConfig.worklightServer.port}/${customConfig.runtime}"
userName="admin" password="admin" />
</target>
However when I run this target it tells me that app-deployer task is deprecated and I should use something else.
The entire message is below:
[app-deployer] The Ant task <app-deployer> is no longer supported.
[app-deployer] You need to replace this invocation with an invocation of the <wladm> Ant task, like this:
[app-deployer] <taskdef resource="com/worklight/ant/deployers/antlib.xml">
[app-deployer] <classpath>
[app-deployer] <pathelement location="buildTools\buildJars\worklight-ant-deployer.jar"/>
[app-deployer] </classpath>
[app-deployer] </taskdef>
[app-deployer] <wladm url="** URL of Worklight administration services **" user="admin" password="admin">
[app-deployer] <deploy-app runtime="** project runtime name **" file="app.wlapp"/>
[app-deployer] </wladm>
[app-deployer] where values between ** markers are to be filled in.
The version of the worklight ant deployer I'm using is this.
[echo] Worklight Ant task version 6.2.0.00.20140613-0730
Nevertheless, when I create a target with wladm it tells me that
Problem: failed to create task or type wladm
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
The most frequent causes for said error message "failed to create task or type wladm" are:
The <taskdef> has not been executed at this point, in the current Ant script. You may have it in a different target, that is not executed before the current target. The fix is to list it in a common initialization target, or outside of any targets, directory under <project>.
The <taskdef> refers to a nonexistent file or to an older version of worklight-ant-deployer.jar than 6.2.0.
The <taskdef> loads resource="com/worklight/ant/defaults.properties", but in 6.2 it needs to load resource="com/worklight/ant/deployers/antlib.xml".
Not exactly an answer to your question but if you do not need Ant, you can use wladm in command line. See doc at https://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.appadmin.doc/admin/r_wladm_program_app_commands.html
The wladm command is in [WorklightInstallDir]/shortcuts

Building Windows 8 Phone App on Command Line

I'm currently porting an existing cross platform framework to Windows Phone 8.
The build process is fully automated and we are using a rock solid CI system.
I can build and deploy Windows Phone 8 samples from Visual Studio (Express 2012),
but now I need to integrate that into our build scripts.
Did anybody ever successfully build (and deploy) a Win Phone 8 app via the commandline?
(Or ant, make, scons, whatever...)
If yes, how?
Any hints are welcome.
I used the following bat file to build WP7 code (+ant automation on top of it). It may be helpful for you.
build.bat
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe build.xml /t:BuildAndCopy /p:Revision=123
where build.xml is something like (build itself goes under BuildAll target)
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<PropertyGroup>
<Major>1</Major>
<Minor>0</Minor>
<Build>0</Build>
<Revision>x</Revision>
<OutputPath>Build\</OutputPath>
<OutputPathDebug>..\Build\Debug\</OutputPathDebug>
<OutputPathRelease>..\Build\</OutputPathRelease>
</PropertyGroup>
<Target Name="BuildAll" DependsOnTargets="Clean; Version">
<msbuild Projects="SomeApp.sln" Properties="Configuration=Release;OutputPath=$(OutputPathRelease)"/>
<msbuild Projects="SomeApp.sln" Properties="Configuration=Debug;OutputPath=$(OutputPathDebug)"/>
</Target>
<Target Name="Clean">
<RemoveDir Directories="$(OutputPath)" Condition="Exists('$(OutputPath)')"/>
<MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')"/>
</Target>
<Target Name="Version">
<Message Text="Version: $(Major).$(Minor).$(Build).$(Revision)"/>
<XmlUpdate
Namespace=""
XmlFileName="WindowsPhone\Properties\WMAppManifest.xml"
XPath="//App[#Version]//#Version"
Value="$(Major).$(Minor).$(Build).$(Revision)"/>
</Target>
<ItemGroup>
<AppFiles Include="$(OutputPath)\**\*.xap"/>
</ItemGroup>
<Target Name="BuildAndCopy" DependsOnTargets="BuildAll">
<Copy
SourceFiles="#(AppFiles)"
DestinationFiles="#(AppFiles->'\\fs\Public\projects\mobile\SomeAppWP\$(Major).$(Minor).$(Build).$(Revision)\%(RecursiveDir)%(Filename)%(Extension)')"
/>
<Copy
SourceFiles="#(AppFiles)"
DestinationFiles="#(AppFiles->'\\fs\Public\projects\mobile\SomeAppWP\latest\%(RecursiveDir)%(Filename)%(Extension)')"
/>
</Target>
</Project>
It should be easy. I'll assume you have the following file structure
$/WP8App/SampleApp.sln
You will have to use the paths and solution file in your project. Execute the following instructions, and make sure to update solution file and path:
Open a command prompt
Execute: %VS110COMNTOOLS%vsvars32.bat
Execute: %VS110COMNTOOLS%..\..\VC\WPSDK\WP80\vcvarsphoneall.bat
Execute: MSBuild "WP8App/SampleApp.sln" /t:rebuild
/p:Configuration=Release /p:Platform="Any CPU" /v:d
Please notice:
The computer where you're going to run these commands should have the development environment for WP8 already set up.
If your application uses native libraries (such as PlayerFramework http://playerframework.codeplex.com/ which are installed into VS, these libraries should also be installed before running the commands)
I have used this process on VS2012 Pro and VS2012 Premium and Jenkins as Build Server.
Good luck,
Herb
Thanks to Sergei's MSBuild.exe hint I was able to build a simple sample via the command line.
https://github.com/AndreasOM/wp8-directx-commandline
There is a build.bat included, which should be enough to get you started to build for "windows phone 8" with the build system of your choice.
It's fairly hacky at the moment,
but once I get the current project done
I will clean it up.
Hint:
Never define a "CL" environment variable when working with "CL.exe" ;)

Proguard - Keep line numbers for J2ME/BlackBerry applications

I've search all over the web and this problem is driving me crazy.
I'm building a mobile application (J2ME, BB) using ANT and Proguard.
In my javac task, I've added the debuglevel paramater, like so:
<javac srcdir="${src.dir}" destdir="${tmp.dir}${application.name}" failonerror="true" source="1.4" target="1.4" debug="true" debuglevel="lines,vars,source">
In my proguard task, I have:
<proguard defaultpackage="" usemixedcaseclassnames="false" note="false" microedition="true" verbose="true" printmapping="true" optimizationpasses="10" renamesourcefileattribute="SourceFile">
...
...
<keepattribute name="LineNumberTable" />
<keepattribute name="SourceFile" />
</proguard>
However, when I look at the output console in Eclipse (after building my application and launching it on an emulator), I don't see lines number, just stuff like that:
at com.mycomp.myapp.Main.a(+47)
at gd.a(+24)
at fq.a(+368)
at fq.b(+188)
at com.mycomp.myapp.Main.run(+29)
I'm using Proguard 4.8.
Thanks a lot for your help,
You are using the correct setting in Proguard:
<keepattribute name="LineNumberTable" />
Do you see the line numbers on the console?, that worked for me.

Eclipse headless build doesnt return error code

I have an ant script that does a headless build using the following ant code
<java jar="${equinoxjar}" fork="true" failonerror="true" logerror="true">
<arg line="-application org.eclipse.ant.core.antRunner -buildfile ${buildscript}" />
</java>
However it seems that even if my code has compilation errors, the returncode from the java task does not return an error. Thus my builds in teamcity are still shown as successful, even though there are compilation errors.
How do i fix this?
The version of eclipse I am using to do the build is 3.6.2
Are you 100% certain that you are building with 3.6.2? There was a bug like this in 3.6.0, but it was fixed in 3.6.1 release.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=321386