Using a .tpk file results in an app crash - maximo-anywhere

I'm attempting to use a .tpk file with Maximo Anywhere Work Execution on Android 6, but I'm experiencing an application crash when trying to access the Map view.
LogCat shows that the code recognises and processes the .tpk but then produces the error:
11-02 12:46:19.873: W/System.err(8251): java.lang.ClassNotFoundException:
org.apache.cordova.geolocation.GeoBroker
I've rebuilt the APK and updated Mobilefirst Studio to the latest IFIX version but this doesn't seem to help. Am I missing something?
Maximo Anywhere 7.6.1
Mobilefirst Studio 7.1.0.00-20171026-1607

mobilefirst team have changed way to use gps in ifix from 2017. Basically they removed org.apache.cordova.geolocation.GeoBroker. On Anywhere 762HF we have applied necessary fixes to support recent ifix. Suggestion is remove GeoBroker from config.xml file:
<feature name="Geolocation">
<param name="android-package" value="org.apache.cordova.geolocation.GeoBroker" />
</feature>
You will find this config file into appName/android/native/res/xml folder.
Make sure that you have into this config.xml the new element used to provide gps feature, that is:
<feature name="WLGeolocationPlugin">
<param name="android-package" value="com.worklight.androidgap.plugin.WLGeolocationPlugin"/>
</feature>
Let me know if this is enough to fix your problem.
Best Regards.

Related

Apache Karaf feature dependency

In feature.xml (Apache Karaf provisioning mechanism) tag feature has a dependency attribute. What does this attribute do?
For example:
<feature dependency="true">custom-feature-name</feature>
Where can I find any information on it?
After a brief googling I've only found dependency attribute on a bundle tag:
The role of the dependency attribute is to mark that a bundle is a dependency. If a dependency is already satisfied (an existing bundle already exports the same packages/version) then it doesn't get installed. This behavior happens if the declared feature resolver is installed (e.g. obr is installed).
Source:
http://karaf.922171.n3.nabble.com/features-xml-dependency-quot-true-quot-td3286359.html
But still, no information on feature tag.
It would seem that the definition of dependency for features in
<feature name="${project.name}-cxf" version="${cxfVersion}" description="Gets CXF up and running." install="auto">
<feature version="${cxfVersion}" dependency="true">cxf</feature>
</feature>
means that the feature ${project.name}-cxf does not have to start cxf, because it is declared that something else will provide it. This is indeed counterintuitive. Whoever came up with that ludicrous misnomer?
To auto install cxf, it should actually be set to false. This can be varified by looking up the name of the feature ${project.name}-cxf when dependency="true" and again set to false.
Developers of Karaf, the dependency=false should be renamed provided=true

The target Flash Player version 11.1.0.0 specified should be equal or higher than the minimum version 23.0.0.0 required by Flex SDK

I am getting this error when trying to build an AdobeAir project.
I have an extension.xml file with this line:
<extension xmlns="http://ns.adobe.com/air/extension/4.0">
I tried to change it to 23.0 in the end, but it didn't help.
The error appeared after upgrading Air SDK from version 18 to 23.
The target Flash Player version 11.1.0.0 specified should be equal or
higher than the minimum version 23.0.0.0 required by Flex SDK
There is no place where 11.1.0.0 is mentioned
In your descriptor file (the one that ends in .xml), change the second line:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/23.0">
It has to start with application, not with extension.
But, something is odd with the message, it indicates Flash Player instead of AIR.
You might want to change the compiler settings as well.
In Flash Builder, create or open a new project.
Open the project Properties panel (right-click and chose 'Properties').
Select Flex Compiler from the list on the left.
Add "-swf-version=34" to the 'Additional compiler arguments' field.
I have copied and adjusted the instructions from the Flash Player 23 Release Notes
There should be a descriptor file where you can define target-player version. I'm using IntelliJ as an IDE where it creates MyProjectName.iml and defines target-player version as below:
<configuration name="MyProjectName" target-platform="Desktop" main-class="Main" output-file="Main.swf" output-folder="$MODULE_DIR$/out/production/MyProjectName">
<dependencies target-player="23.0">
<sdk name="AIR SDK 23.0" />
</dependencies>
</configuration>

Spring Boot app deployed to Glassfish is giving strange results

As mentioned here, I am having a heck of a time getting my small Spring-Boot project to deploy "correctly" to Glassfish. It runs fine using the embedded Tomcat, but once I try and move it into my organization's environment (Glassfish 3.1.2) I get some strange behavior.
Thinking it was my code, I reverted to the time-tested "Hello World"-approach and built a super-basic app following this tutorial on Spring's blog.
I did make a few very minor deviations as I went along but nothing that should have affected the app like this at all.
The only major deviation I made was that I found I could not exclude "spring-boot-starter-tomcat" from "spring-boot-starter-web" -- when I tried to that, I got 2 errors in the STS "Markers"-tab:
The project was not built since its build path is incomplete. Cannot find the class file for javax.servlet.ServletContext. Fix the build path then try building this project
The type javax.servlet.ServletContext cannot be resolved. It is indirectly referenced from required .class files Application.java
If I cleaned the STS project, then ran Maven Clean, Update, Install the Install goal gave the following error:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project test: Compilation failure [ERROR] /Users/brandon_utah/Utah Development/sts_workspaces/NidTools Rebooted/test/src/main/java/test/Application.java:[13,8] cannot access javax.servlet.ServletException [ERROR] class file for javax.servlet.ServletException not found
So what I did instead was include this dependency (which I found mentioned in several other SpringBoot resources):
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
In this deployed fine to the embedded Tomcat and it did deploy to my Glassfish (local install) -- but with a whole bunch (about a half-dozen) errors similar to this one:
2014-04-03T16:23:48.156-0600|SEVERE: Class [ Lorg/springframework/jdbc/datasource/embedded/EmbeddedDatabase; ] not found. Error while loading [ class org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration ]
Most of them are SEVERE, but I am also getting a few with a WARNING:
2014-04-04T06:57:35.921-0600|WARNING: Error in annotation processing: java.lang.NoClassDefFoundError: org/springframework/batch/core/configuration/annotation/BatchConfigurer
Except that I'm not referencing any of these missing classes anywhere in my project (other than what might be referenced by Spring Boot itself).
Also, the app doesn't quite work as expected. If I hit the RestController, I do get my page rendered as I expect -- but if I put any sort of System.out or Logger.log statement in the controller's method, that line of code seemingly never gets executed; by all appearances, it just gets skipped.
To demonstrate this problem, in my sample app's RestController I created a static counter. Then in the GET-/ method I increment that counter and System.out.println it's value. I also return the value as part of the Response.
And again, from a user's perspective, it seems to be working: the screen renders "Hello World" and in parentheses it shows the counter's value. I refresh the window, the counter increments. But nothing in the STS Console. And if I navigate to the Glassfish log for the app, nothing there either. Nothing. Nada. Zip. From what I can tell, something is mysteriously eating any attempt to log anything.
To add to the mystery, if I add a System.out to the SpringBootServletInitializer#configure(), that does make it to the Console. But if I declare a constructor in my RestController and include a System.out there, that one does not make it to the Console. For good measure, I even tried including a System.err in the constructor and a Logger.getAnonymousLogger.severe in the method; neither of those result in anything.
I should note that this also deploys and runs as expected using an external Tomcat.
I would very much appreciate any input, as it's not likely that I can convince my organization to deploy this to Tomcat nor use the embedded-Tomcat approach (due to politics and an overwhelming existing Glassfish environment).
My test project on Github is here.
This has been answered here: https://stackoverflow.com/a/29438821/508247
There is a bug in Glassfish 3.1.X. You need to include metadata-complete="true" in your web.xml root element.
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1"
metadata-complete="true"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
</web-app>
I had this problem with Payara 5, I understand the problem became from Glassfish.
Versions:
Payara 5.192
Spring Boot 2.1.6
The solution worked for me:
I added this dependency in the pom.xml.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-batch</artifactId>
<version>2.1.4.RELEASE</version>
</dependency>
My glassfish-web configuration:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC ...>
<glassfish-web-app error-url="">
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
<description>Keep a copy of the generated servlet class' java code.</description>
</property>
</jsp-config>
<!-- set a friendly context root -->
<context-root>/micuenta-api</context-root>
<!-- Change the default character encoding from ISO-8859-1 to UTF-8 -->
<parameter-encoding default-charset="UTF-8"/>
</glassfish-web-app>

Opencms webdav not working

With OpenCms 7.5.3 fresh install:
I create an index.htm page, then export it via webdav to disk. It
creates index.html.xml and __properties/index.html.xml.properties.
Thats ok.
Delete index.html from OpenCms and publish.
Try to import previously exported files via webdav and...
Error 409 conflict when importing __properties/index.html.xml
I tried with 3 different webdav clients, including the Eclipse plugin for webdav.
Also tried with OpenCms 7.5.4 and 8.5.0
Any ideas? Thanks.
It seems to be a known problem by Alkacon (OpenCms developer):
Here is a possible cause:
https://github.com/alkacon/opencms-core/issues/73
("pbeltran" is me there.)
If it helps we did the following on OpenCms 8.5 in order to avoid the error, but sacrificing properties files :(
Just edit WEB-INF/config/opencms-importexport.xml and replace with this:
<repository name="standard" class="org.opencms.repository.CmsRepository">
<params>
<param name="wrapper">org.opencms.file.wrapper.CmsResourceExtensionWrapperJsp</param>
<param name="wrapper">org.opencms.file.wrapper.CmsResourceExtensionWrapperXmlContent</param>
<param name="wrapper">org.opencms.file.wrapper.CmsResourceExtensionWrapperXmlPage</param>
<param name="wrapper">org.opencms.file.wrapper.CmsResourceWrapperSystemFolder</param>
<!--param name="wrapper">org.opencms.file.wrapper.CmsResourceWrapperPropertyFile</param-->
</params>
<filter type="include">
<regex>/</regex>
<!--regex>/__properties/.*</regex-->
<regex>/sites/.*</regex>
<regex>/system/</regex>
<!--regex>/system/__properties/.*</regex-->
<regex>/system/galleries/.*</regex>
<regex>/system/modules/.*</regex>
<!--regex>/system/workplace/.*</regex-->
</filter>
</repository>
Afer that restart your server.
We do regular exports from OpenCms of the modules to keep the whole package (files and properties) in order to keep the solution under control version (SVN). You can create a module with a resource pointing to sites/default to do that. But it's critical to select root site before doing any import/export of that module (if you dont you can break your ocms installation).
Since some months, I'm using the Linux FUSE driver (gentoo's davfs 1.4.7) to mount OpenCms resources. I was quite irritated with the lot of LOG CmsVfsResourceNotFoundException errors, so I ended up removing the __properties dirs from the exported Repository.
If you don't need these __properties files, I'll recommend you to ignore that error and remove the files from the repository as per the instructions in the link.
The corresponding fstab entry:
# WebDAV (opencms)
# http://myserver:8080/opencms/webdav /home/alberto/mnt/myserver-opencms-dav davfs rw,user,noauto 0 0
I have never had Eclipse with webdav up and running, but I successfully use OpenCms 7.5 and 8 daily with webdav:// and webdavs:// from KDE's Kate editor. Maybe give it a try.
In case you want to try, here the URL you need to use to browse the VFS:
webdav(s)://server(:port)/webdav

Error when converting a site from Flex 3 to Flex 4

I'm moving a Flex 3 site to Flex 4, but when I run the application, it attempts to download a .swz file from Adobe, and gives the following error:
*** Security Sandbox Violation ***
Connection to http://fpdownload.adobe.com/pub/swz/tlf/1.1.0.604/textLayout_1.1.0.604.swz halted - not permitted from http://localhost/Fl/CityGIS/main.swf
Error #2048: Security sandbox violation: http://localhost/Fl/CityGIS/main.swf cannot load data from http://fpdownload.adobe.com/pub/swz/tlf/1.1.0.604/textLayout_1.1.0.604.swz.
Failed to load RSL http://fpdownload.adobe.com/pub/swz/tlf/1.1.0.604/textLayout_1.1.0.604.swz
Failing over to RSL textLayout_1.1.0.604.swz
Following this is an attempt to download the same file from localhost.
Is there a way to configure the SDK to get these files, or an issue with the configuration of my application?
I found I only had this problem when I using: -use-network=false, and I was attempting to run the html locally and the .swf was accessing locally files (outside the flex security free folders).
My workaround is to update sdks//frameworks/flex-config.xml (in the Flash Builder directory), and swap the order runtime shared paths: for example:
<runtime-shared-library-path>
<path-element>libs/textLayout.swc</path-element>
<rsl-url>http://fpdownload.adobe.com/pub/swz/tlf/1.1.0.604/textLayout_1.1.0.604.swz</rsl-url>
<policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</policy-file-url>
<rsl-url>textLayout_1.1.0.604.swz</rsl-url>
<policy-file-url></policy-file-url>
</runtime-shared-library-path>
TO:
<runtime-shared-library-path>
<path-element>libs/textLayout.swc</path-element>
<rsl-url>textLayout_1.1.0.604.swz</rsl-url>
<policy-file-url></policy-file-url>
<rsl-url>http://fpdownload.adobe.com/pub/swz/tlf/1.1.0.604/textLayout_1.1.0.604.swz</rsl-url>
<policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</policy-file-url>
</runtime-shared-library-path>
You'll have to do this for the other 5 or so entries.
Adobe should really look at this, and fix the problem.
Hope this helps.
Cheers
Parmy
I think the problem is that the location it is using for the textLayout swc
http://fpdownload.adobe.com/pub/swz/tlf/1.1.0.604/textLayout_1.1.0.604.swz
redirects to
/pub/swz/flex/4.1.0.15186/textLayout_1.1.0.601.swf
and the cross domains policy is not happy about that.
I think this points to an issue with the version of the sdk that you are using. You can go into sdks/<FRAMEWORK_VERSION>/frameworks/flex-config.xml (in the Flash Builder directory) and see exactly how the runtime shared library path is configured for textLayout.swc. This is what I have for flex_sdk_4.1.0.15186:
<!-- TextLayout SWC -->
<runtime-shared-library-path>
<path-element>libs/textLayout.swc</path-element>
<rsl-url>textLayout_1.1.0.601.swf</rsl-url>
<policy-file-url></policy-file-url>
<rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.1.0.15186/textLayout_1.1.0.601.swf</rsl-url>
<policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</policy-file-url>
</runtime-shared-library-path>
I suggest try switching to the latest 4.1 sdk and recompiling.
Hmmmm - generally this is because the site you are accessing does not contain a crossdomain.xml file. However I can download it from here.
Try adding this to your compiler options: -use-network=false
Then clean and force build your app.
If that doesn't work, and just grasping for straws, but have you tried to manually download it and place it in your project lib space?
Also, are you sure you are updated to Flex 4.1?
I just checked my local KB (evernote) and mentioned that FireFox sometimes has an issue with caching, and that restarting FF solved it once for me.

Resources