Add native library to Neabeans REST project - java

I am developing a REST service that will work with ACRCloud, and for that I use the native library acrcloud_extr_tool, but when I call the service that will call ACRCloud, I have an error that appears:
(java.lang.UnsatisfiedLinkError) java.lang.UnsatisfiedLinkError: no acrcloud_extr_tool in java.library.path
I am working in the NetBeans IDE 8.2 and the REST service will be deployed on a TomCat server.
I found articles saying to add a link in the options for running the JVM but what I tried does not work ...
Does anyone know how to solve my problem?
Useful links:
How to add native library folder to existing project in Netbeans
giving 'java.library.path' in netbeans for .dll/.so files

I'm not really experienced with ACR but for what I've seen, there is a Java SDK so why not trying to use it instead of the native one?
If you try it, the steps are quiet good described (Eclipse only sorry :/) in the Github Repo (https://github.com/acrcloud/acrcloud_sdk_java).
Pay attention that you will need to install it on your Tomcat Server (as well as the correct version of vcredist) too in order to use it after deploying (unfortunatly I didn't find the package on Maven but maybe I'm wrong)
And maybe the easiest solution, if you don't need to many uncommon features, would be to call the webservice directly through HTTP request ? (https://www.acrcloud.com/docs/acrcloud/demos/web-api/)

Related

Getting error on running the Tomcat server

I am learning about servlets and JSP files and following the tutorial in link to have at least a basic understanding. But I am stuck at the beginning of the tutorial when servlet has to be run on Tomcat. I am getting the following error:
Can anyone please tell if there is something I need to do to run Tomcat without this error?
I think you have not set up your environment correctly. I would suggest to use NetBeans IDE (with required services). While installing the IDE you will find option to install tomcat or glassfish server. After installing create a Java Web->Java Web Application project. All things should go perfect if you just run the project.

Eclipse Jetty appears to be unusable

I have installed the Eclipse Jetty plugin version 3.9.0 into Eclipse Mars. Unfortunately, while it shows as installed, I do not see any Jetty- related functions appearing in my IDE! It is as if the plugin is dead weight!
I have looked through Eclipse and Jetty tutorials trying to find something that tells me how to access the Jetty plugin in Eclipse. I am finding some nice Jetty tutorials, but nothing about how to access and use the actual plugin. In fact, Jetty as a container doesn't even appear in the list of Servlet containers that are available to Eclipse.
Could someone please either tell me how to use this plugin or point me to somewhere where I can learn? Thank you...
If you're talking about Eclipse Jetty Integration, all the documentation you need to use it is right there.

How to create an enterprise application client with Netbeans 7.4 and JBoss 7?

I try to create an enterprise application client with JBoss by following this official tutorial (based on Glassfish):
https://netbeans.org/kb/docs/javaee/entappclient.html
but I get this error message: Error: Unable to access jarfile C:\EntAppClient\${client.jar}
As far as I know, Netbeans IDE supports JBoss 7 since its version 7.3 RC1 and I use Netbeans 7.4. This feature seemed already broken for a long time according to this thread:
http://forums.netbeans.org/topic40270.html
It is expected to work as Netbeans is intended to support other application servers. However, some Glassfish specific properties are hardcoded inside the Ant build scripts and the property client.jar is set if and only if j2ee.clientName isn't set which isn't my case (it's set to EntAppClient.jar).
When I set client.jar to ${dist.dir}/${j2ee.clientName}, I go a bit further but Netbeans doesn't find the JAR of the remote interface and the Glassfish specific agent class loader org.glassfish.appclient.client.acc.agent.ACCAgentClassLoader.
How can I make it work? I'm going to try to fix build-impl.xml to use the correct classpath and I hope to find a smarter solution.

Create android native feature using Bayeux Protocol

I am trying to create an Android project and get the Bayeux Java Client library
working for it. I have the cometd library imported in my eclipse and I also added
the projects to the build path of my project.
My project builds fine, but on execution, I keep getting the NoClassDefFound error.
I am not sure, how to set my project up.
Are there any examples that I can refer to?
Any help is greatly appreciated.
Thanks,
I do the same thing and musst add some Other third party libraries. Check the NoClassDef Exception which class is needed and wasn't found. I Google the required class and add it to my libs folder. If i remember right it were some jetty client libs (3 or 4).

How to install play2War plugin (Play Framework 2.1.1.)

I'd be very grateful if someone could provide me the basic steps to install the Play2War Plugin. Like where to put the plugin files?, and which files?
I'm pretty new with Play Framework (Java, I'm not a Scala developer, ...yet), just created my first application, and want to deploy it on my server, with is a CentOS with Tomcat/ Glassfish installed, but unfortunately I found out that the 2.x version didn't have the built in war command anymore. I scoured the documentation and found the links Configuration, Usage and Deployment, but what I want to know are the steps until get there.
I started looking for sbt building tool ('cause Play2War Plugin uses it), until I realize that Play Framework 2.1.1. already have it installed (at least that is what I believe. See: *PLAY_HOME/framework/sbt/sbt-launch.jar* and *PLAY_HOME/framework/build*). Am I correct?
Thanks in advance,
As Play 2.1.1 already has SBT its as simple as doing the following:
Within plugins.sbt add:
addSbtPlugin("com.github.play2war" % "play2-war-plugin" % "1.0")
Then within the Build.scala file add:
import com.github.play2war.plugin._
...
val main = play.Project(appName, appVersion, appDependencies)
.settings(Play2WarPlugin.play2WarSettings: _*)
.settings(Play2WarKeys.servletVersion := "X.X")
The X.X needs to be changed to the required Java Servlet version (usually 3.0 or 2.5 depending on your container)
If you have a working play application, you are already using SBT tools to build. Yes, SBT comes with play.
The play2war plugin tutorial provides a step-by-step instruction. Simply follow the tutorial, you should be fine.
To answer your question, where to put the plugin file?
As the tutorial suggests, you need to modify files like APP_HOME/project/plugins.sbt, APP_HOME/project/Build.scala. You should already have these files, you simply need to add those lines to these existing files.
If you have a specific problem, please provide the error message.

Categories

Resources