Java ME: Problem creating an Image. IOException - java-me

I'm trying to make this chunk of code work:
try {
Image jeton = Image.createImage("bleu.gif");
}
catch(Exception e) {
system.out.println("exception : "+e)
}
An IOException is caught but I don't understand why. Everything seems to be okay with the file ... it's in the src folder with the other .java files. It's also in the build folder with all the other .class files (I'm using netbeans 7.0)
Also, right after the exception is caught, I get this strange message when I run the program:
[rms] javacall_file_open: _wopen failed for C:\Users\Abdelhamid\javame-sdk\3.0\work\0\appdb\_delete_notify.dat
[rms] javacall_file_open: _wopen failed for C:\Users\Abdelhamid\javame-sdk\3.0\work\0\appdb\00000002bleu-6gif.tmp
Can anybody give me a hand please?

Don't forget to put the slash before image name!
Image.createImage("/bleu.gif")
Also, PNG format is better.

Related

Linux:load error:No such file or directory

I am deploying a web server, and after I finish compiling.There are the executing documents;
01client.c client epoll_server.c server
Then I try to run server
./server
There is an error which I cant fix it. I have search ways for solving but still can't fix it.
load error: No such file or directory
Maybe some one can help me,please!
Thanks a lot!!!!
System utilities print the program generating the error at the beginning of the line followed by other useful information such as the name of the missing file, so this is probably an error from a user program. I can duplicate the error as follows:
errno = 2;
perror("load error");
which prints:
load error: No such file or directory
Look for the perror line in the server code. If it isn't clear what file it can't find, print the string from the failed command it is reporting.

Got the following error while building a gradle project

What went wrong:
Execution failed for task ':nodeSetup'.
Could not resolve all files for configuration ':detachedConfiguration1'.
Could not find org.nodejs:win-x64/node:8.13.0.
Searched in the following locations:
https://nodejs.org/dist/v8.13.0/ivy.xml
Required by:
project :
I've had a similar issue but it is asking for a node.exe file. I solved the missing ivy.xml file using this code in the build.gradle:
repositories.whenObjectAdded {
if (it instanceof IvyArtifactRepository) {
metadataSources {
artifact()
}
}
}

AWS Lambda permission denied when trying to use ffmpeg

I want to write a handler that responds to S3 put events to convert any avi files that are uploaded to mp4. I doing it in Java, in Eclipse, with the AWS toolkit plugin. For video conversion, I am using ffmpeg with ffmpeg-cli-wrapper, and I have provided a static (linux) binary of ffmpeg in the source tree.
I have found that when I upload the function, the binary gets put in /var/task, but when I try to use the test function I've written, I get a "permission denied" error.
import net.bramp.ffmpeg.FFmpeg;
public class LambdaFunctionHandler implements RequestHandler<S3Event, String> {
private static final String FFMPEG = "/var/task/ffmpeg";
public String handleRequest(S3Event event, Context context) {
try {
FFmpeg ff = new FFmpeg(FFMPEG);
System.out.println(ff.version());
} catch (Exception e) {
e.printStackTrace();
}
return "foo";
}
}
And the first line of the stacktrace: java.io.IOException: Cannot run program "/var/task/ffmpeg": error=13, Permission denied.
How do I execute this binary? I have done as others have suggested and chmod 755 the binary before uploading, but it hasn't made a difference.
AWS Lambda runs on Amazon Linux. It is a known issue. Try building (with static enabled) and check if it works on Amazon Linux and upload that binary. You do not have the privileges to chmod the files in /var/task/. Or try this solution that works:
Move ffmpeg to /tmp
chmod 755 /tmp/ffmpeg
Call /tmp/ffmpeg
See this discussion for more info.
I ran into this issue recently, and after messing with various manual solutions, what really solved the issue was:
Create a Lambda Layer, with only the ffmpeg binary inside a bin/ folder
Create a Lambda Function to implement said layer, and in the python code run /opt/bin/ffmpeg
See https://aws.amazon.com/blogs/media/processing-user-generated-content-using-aws-lambda-and-ffmpeg/
As helloV mentioned, you might have to include a static ffmpeg binary and copy it to a location and execute from there.
A detailed answer, (node.js code) is given here

Copy and .# in file name

I faced with one gradle issue (or may be groovy related)
When I trying to copy file with .# in its name nothing is happened.
Example:
task c(type: Copy) {
from (".#webclasspath#")
into "destdir"
}
Please, could you provide way how to process such files?
seems that there is a bug in gradle, ant works just fine
task c_ant << {
ant.copy(file : '.#webclasspath#', todir : 'destdir')
}

eclipse : impossible to import git project

I got a problem with my eclipse, on debian.
When I try to import a git project from github, using egit I got a
Couldn't create temporary repository.
error after having set my project properties.
However, I works ok when using running eclipse with sudo.
I think it would be related to wrong permissions somewhere, but cannot figure out where :s
I would appreciate some help.
Thanks by advance !
Considering the source of org.eclipse.egit.ui.internal.clone.SourceBranchPage.java mentions /tmp, it should be related with some permission issue around /tmp.
try {
final URIish uri = newRepoSelection.getURI();
final Repository db = new Repository(new File("/tmp"));
listRemoteOp = new ListRemoteOperation(db, uri);
getContainer().run(true, true, listRemoteOp);
} catch (IOException e) {
transportError(UIText.SourceBranchPage_cannotCreateTemp);
return;
}
The OP jlengrand actually reports in the comments:
The problem was simple in fact, but quite handy to track down:
My .gitconfig file had been corrupted during my debian upgrade, which caused egit to crash.

Resources