Error in MultipartEntity submission while ant build - ant

I am trying to build a executable jar application for ODK client to
download the files from mobile to local system.
I am trying to send HTTP post request with the zip files as a
multipart entity. The execution of jar file give the following error.
java.lang.NoClassDefFoundError: org/apache/http/entity/mime/content/ContentBody
if I am running a standalone application, the HTTP post request works
fine. But an ant build of a swing class calling the HTTP post request
gives the error. I tried to include the required jars too.
Does anyone has encountered something similar.
regards

Where did you put all these referenced jars? They have to be under folder named "libs" in your project. No other places.

Related

"Non HTTP response code: java.io.FileNotFoundException" error in blazemeter when system wants run a file from jmeter

I used relative file type to refer my image file. Used same file on jmeter bin folder where also my test file is on. When i run it on blazemeter, it fails. Who can help ?
Ive treid all file formats still blazemeter is not seeing the file... error message seen after run is Non HTTP response code: java.io.FileNotFoundException

grails3 static picture request get 404

I want to inject angular6.0 to grails 3.3.0,the detail is I have 2 project,the first is angular6.0 project for frontend,and the second is grails3.3.0 for backend provide http service.
angular project have some simple pages,just like
http://localhost:8080/
http://localhost:8080/project-list
http://localhost:8080/download
I get some idea from this article.
when the angular project finished,I run build and get a dist folder,I copy all files and folders under dist to grails under src/main/webapp
enter image description here
then start grails service in IDE.OK I can visit http://localhost:8080/, but all request for static pictures I get 404.
enter image description here
when I run grails war script and run it use 'java -jar',I can visit http://localhost:8080/ and all request for pictures is OK,great.
but if i refresh the page of 'http://localhost:8080/project-list',I get 404 and I know why,but I do't know how to resolve it.
anybody help?thx
some days later,I get some idea,not good but can resolve some problem.
first of all,the angular project should run with #(maybe means hash,sorry I'm not sure)in url,just do this
RouterModule.forRoot(routes, {useHash: true})
it's not enough,if you just do like that,you may get some error when you run your angular project in dev env,just like https://github.com/angular/angular-cli/issues/10582, I have no idea,but if you start the project with -aot just like
ng serve --aot
error is gone.
build the angular project and copy the dist folder in to grails,and start grails project,the static pic is still not ok,no idea. when you execute 'war' and use 'java -jar' to run the war file,when you visit http://localhost:8080,everything is ok.
that's all,if you have some good idea,please tell me,thx before.

native-app-builder ANT task does not update worklight.plist file (MFP v7.0)

Product: MobileFirst Platform v7.0
We are using the native-app-builder ANT task to build an MFP native iOS app. Though this task has the 'worklightserverhost' attribute, after running it, the worklight.plist file is not updated. We are expecting the host, protocol, port, and wlServerContext fields in the plist file to be updated after executing this ANT task.
As a side point, the app-builder ANT task (for hybrid apps) also has the 'worklightserverhost' attribute. Executing this task does work as expected (i.e. the worklight.plist file is updated).
Is this a known problem? Is there a fix?
Note: By the worklight.plist file, we mean the file in the following folder: [MFP project folder]/apps/[MFP iOS native app folder]/worklight.plist
A PMR (support ticket) was opened to investigate and address the issue raised in the question.
The only local workarounds are to either manually enter the server address details and copy the file to the required location, or to not use Ant as the tool to manipulate the file.

Grails 3 - Gradle: Binary file gets corrupted during build on Heroku

I am trying to use the Google Rest API from a Heroku instance. I am having problems with my certificate file, but everything works as expected locally.
The certificate is a PKCS 12 certificate, and the exception I get is:
java.io.IOException: DerInputStream.getLength(): lengthTag=111, too
big.
I finally found the source of this problem. Somewhere along the way the certificate file is modified, locally it is 1732 bytes but on the Heroku instance it is 3024 bytes. But I have no idea when this occurs. I build with the same command locally (./gradlew stage) and execute the resulting jar with the same command.
The file is stored in grails-app/conf, I don't know any better place to put it. I am reading it using this.getClass().getClassLoader().getResourceAsStream(...)
I found similar problems can occur when using Maven with resource filtering. But I haven't found any signs of Grails or Gradle doing the same kind of resource filtering.
Does anyone have any clues about what this can be?

Grails - trying to deploy a nojars application into glassfish 3.0.1

Because of memory constraint i am trying to build a grails app with smaller memory footprint. I build the war with this argument "--nojars". I created a war file without all the jar and when i deploy within the glassfish i encounter this error
Exception while loading the app : java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: org.codehaus.groovy.grails.web.util.Log4jConfigListener
It seems like the application fail to find where is the jar file.
I had already indicates the path to the library before deploying the application in glassfish.
did i miss out somethinng?
It is commonly recommended to use GlassFish's Common Classloader. That means putting the shared JARS into the $domain-dir/lib folder (but not into a subfolder of that).
You're probably trying to use the Application Classloader with the asadmin deploy --libraries command. This is more complicated and error-prone. If you don't need different versions of the same JARs with different web applications, you should definitely go for the Common Classloader as specified above.
Also see The Classloader Hierarchy for a reference.
EDIT Updated as per the questioner's comment:
The domain/domain1/lib folder definitely works (I've tested that). To validate that, put log4j.jar into that folder and add a test.jsp to domain1/applications/$applicationName, that just contains:
<% out.println(
org.apache.log4j.Logger.getLogger(this.getClass())); %>
If that works but your other code does not, there may be another point to consider: Are you using Log4J's Logger.getLogger(..) or Apache Commons' LogFactory.getInstance(..) in your code?
See the article Taxonomy of class loader problems encountered when using Jakarta Commons Logging for related issues. - I'd also like to advise you to post your complete stacktrace.

Resources