Vaadin 7 get screen Width - exception

I am getting a UnsatisfiedLinkError exception when I am trying to get the screen Width like this:
int screenWidth = BrowserInfo.get().getScreenWidth();
The exception is thrown at BrowserInfo.getBrowserString():
Feb 25, 2013 2:03:40 PM com.vaadin.server.DefaultErrorHandler doDefault
SEVERE:
java.lang.UnsatisfiedLinkError: com.vaadin.client.BrowserInfo.getBrowserString()Ljava/lang/String;
at com.vaadin.client.BrowserInfo.getBrowserString(Native Method)
at com.vaadin.client.BrowserInfo.<init>(BrowserInfo.java:76)
at com.vaadin.client.BrowserInfo.get(BrowserInfo.java:67)
at com.vaadin.client.BrowserInfo.<clinit>(BrowserInfo.java:56)
at layoutHandler.MainLayoutHanlder.setCssClasses(MainLayoutHanlder.java:34)
Is this a Vaadin 7 bug, or am I just using the BrowserInfo class wrong?

Call Page.getCurrent().getBrowserWindowWidth() instead.
BrowserInfo is a client class, you should not use this in your server side classes. I would avoid putting the client libraries on the class path at all. getBrowserWindowWidth is native because that's the GWT compiler's way to bridge into JavaScript code. If you look at the source, the JavaScript code is in a specially formatted comment.

Related

#grapecity/wijmo throwing run time error after upgrading my Angular project from 8 to 9

Recently iam trying to update my angular project from 8 to 9. While updating i also updated wijmo from wijmo/wijmo to #grapecity/wijmo package as it supports IVY.
But after the completing the upgradation, i can able to compile the application but i am getting the following error at run time
global-error-handler.service.ts:43 Error: Uncaught (in promise): TypeError: (0 , t[n]) is not a function
TypeError: (0 , t[n]) is not a function
at backend.js:61
at Reflect.<anonymous> (backend.js:61)
at push../node_modules/#grapecity/wijmo.angular2.grid.detail/__ivy_ngcc__/index.js.__decorate (index.js:28)
at index.js:53
at Object../node_modules/#grapecity/wijmo.angular2.grid.detail/__ivy_ngcc__/index.js (index.js:53)
at __webpack_require__ (bootstrap:84)
I'd like to get some more info about this error. The quick thing to check is property initialization order. In Ivy, the properties are interpreted as they are specified in markup (previously wijmo controlled how they were interpreted). So you can break components by setting certain properties before others.
For example, if I tried to set the selectedIndex on a combobox BEFORE I set the data source, then the app would break at runtime because there are no items in the list to select yet.
More info here: https://www.grapecity.com/wijmo/docs/GettingStarted/Angular-Components#property-initialization-order-in-angular-9-ivy-and-higher
The next thing to check is component decorators (if you are inheriting our components). There are some breaking changes in decorators in Ivy.
For example, you might need to add {descendants: true} to ContentChildren queries.
Or you might need to add an #Injectable decorator to your class.
You can read more about breaking changes in Ivy and how to fix them here: https://angular.io/guide/ivy-compatibility-examples
But please feel free to contact us to work directly: wijmoexperts#grapecity.com

java.lang.UnsatisfiedLinkError: com.chrysalisits.crypto.LunaAPI.Initialize()V

I am getting below exception while running my application.
Caused by: java.lang.UnsatisfiedLinkError:
com.chrysalisits.crypto.LunaAPI.Initialize()V
at com.chrysalisits.crypto.LunaAPI.Initialize(Native Method)
at com.chrysalisits.crypto.LunaTokenManager.(LunaTokenManager.java:107)
at com.chrysalisits.crypto.LunaTokenManager.getInstance(LunaTokenManager.java:62)
I have added LunaProvider.jar and libLunaAPI in $JAVA_HOME/jre/lib/ext.
I strongly recommend that you ask the HSM Support Team for help on this instead of Stackoverflow.
This error comes up if Java is not able to find the concerned .so / .dll (Library) file. Also, make sure that you have the correct 32 / 64 Bit version of the Library in the location.
That said, in the VM Arguments you could also set :
-Djava.library.path=/location_to_the_libLunaAPI_so_file (possibly, /usr/lunasa/JSP/lib .. or something)
I have solved my problem.
Actual Problem was mismatch between native client library (libLunaAPI.so) and Luna client.
My application was using old library's com.chrysalisits.crypto.* classes to interact with Luna client however my Luna client got updated and functions which it exposed in its native library was not present in current library.
I updated my client application by using com.safenetinc.luna.* classes and latest client library.

Issue with adding a Mapinfo-File using BridjOGRDataStoreFactory in GeoTools

I am very new to Geotools, Maven, and all this Java Stuff.
I am trying to add Mapinfo-File using BridjOGRDataStoreFactory follow the instruction provided by you on link OgrPlugin by using the code that I have following error please look into this:
Sep 27, 2016 6:11:46 PM org.bridj.AbstractBridJRuntime log
SEVERE: Failed to get address of method public static native org.bridj.Pointer org.geotools.data.ogr.bridj.OsrLibrary.OCTProj4Normalize(org.bridj.Pointer)

Physics Body Editor error

I get this error when trying to initialize BodyEditorLoader from this library http://www.aurelienribon.com/blog/projects/physics-body-editor/
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.UnsatisfiedLinkError: com.badlogic.gdx.physics.box2d.PolygonShape.newPolygonShape()J
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:127)
Caused by: java.lang.UnsatisfiedLinkError: com.badlogic.gdx.physics.box2d.PolygonShape.newPolygonShape()J
at com.badlogic.gdx.physics.box2d.PolygonShape.newPolygonShape(Native Method)
at com.badlogic.gdx.physics.box2d.PolygonShape.<init>(PolygonShape.java:29)
at aurelienribon.bodyeditor.BodyEditorLoader.<init>(BodyEditorLoader.java:31)
How can i fix it?
to see the code where it is called, but I venture to say that the problem is the call to your world this must be called before here's an example:
This a example compile good:
oWorld = new World(gravedad, dormir);
loader = new BodyEditorLoaderNewW(
Gdx.files.internal("data/test.json"));
This a example not compile good:
loader = new BodyEditorLoaderNewW(
Gdx.files.internal("data/test.json"));
oWorld = new World(gravedad, dormir);
recive this:
java.lang.UnsatisfiedLinkError:
com.badlogic.gdx.physics.box2d.PolygonShape.newPolygonShape () J
note the difference in the world is called one after so gives:
it is possible that in the future can, need this:
BodyEditorLoader - noSuchMethod
but if this is not the solution you could put some of the code, I hope you help
Based on this https://github.com/libgdx/libgdx/issues/2393 the problem is because natives aren't loaded before creating shape.
There are two solutions:
First is creating World instance before creating any shapes.
Second is calling Box2D.init(); before creating any shapes. This method is preferred because you don't need to create World instance and it's much more obvious.
Use this version https://gist.github.com/grulg/8691e7ee7709367ce165 instead of version from Google Code.

How are custom error pages configured for uncaught exceptions in WebSphere Portal portlets?

Out of the box WebSphere Portal displays a generic "This portlet is temporarily disabled." message for any portlet that throws an uncaught exception.
Does anyone know how how this can be overridden - preferably to provide custom error pages for specific exceptions in the same way error pages can be configured in the web.xml of a standard J2EE app?
Using the web.xml of the portlet to define error pages for exceptions does not work. Can't find any documentation on this anywhere.
Using WebSphere Portal 6.1.5, JSR 286 portlets.
Found out - the message is taken from the inside of the portletRender tag in the skin, e.g:
<portal-skin:portletRender>
<span style="color:#FF0000;"><portal-fmt:problem bundle="nls.problem"/></span>
</portal-skin:portletRender>
So it must be defined in the Theme - not on a per-portlet basis, but as JSP code is supported in the tag body more complex behaviour can be specified.