I have a question regarding calling java class from ColdFusion using Javaloader 1.1.
I attempted to access java class from ColdFusion in a local server, and there was no problem. But when I tried the same thing in office server, I got an error:
"the specified directory
mypath\Javaloader/tmp/AEFACE9B-1C6F-6569-2329 could not be created.
The most Likely cause of this error that mypath \ /
tmp/AEFACE9B-1C6F-6569-2329 already exists on your file system."
And another message
"The error occured in Javaloader.cfc line 269". Javaloader.cfc line
269 is < cfdirectory action="create" directory="#path#" >
what do those error messages mean?
this is my code:
//calling java from coldfusion
<cfscript>
sourcePaths = [expandPath("./src")];
loader = createObject("component", "javaloader.JavaLoader").init(sourceDirectories=sourcePaths);
obj = loader.create("myClass").init();
</cfscript>
I really have no idea. Any solution will be much appreciated. Thank you in advance...
Related
I am trying to update into DCTM through java code, below is the code snippet
IDfDocument communication = (IDfDocument) getDfSession().getObject(DfId.valueOf(communicationId));
communication.setString(ATTR_STATUS, status);
communication.save();
but I am getting the below error
Caused by: DfException:: THREAD: be.ing.ca.xpression.DCTM001P-1; MSG: [DM_OBJ_MGR_E_VERSION_MISMATCH]error: "save of object
090283e589bf689d of type xx_document failed because of version
mismatch: old version was 4"; ERRORCODE: 100; NEXT: null
I thinki am getting this error because there is another process which is trying to modify the object ,and when more than one process try to modify anyobject DCTM throws this exception,
But after lot of searching i dident found any solution which can solve this error
If anyone knows the solution please reply..
Link that i refer
http://www.javablog.fr/?s=version+mismatch
Try calling a fetch() on the object before doing updates.
communication.fetch()
There are some optional parameters AFAIK, but it's been a while since I've been fiddling with DCTM.
Best of luck!
I'm calling PDFBox from Matlab to figure out how many pages there are in a PDF. Everything works great with Matlba 2016b and prior. I can import the library and load a PDF without a problem:
import org.apache.pdfbox.pdmodel.PDDocument;
pdfFile = PDDocument.load(filename);
When I run the same thing in 2017a, I get the following error:
No method 'load' with matching signature found for class
'org.apache.pdfbox.pdmodel.PDDocument'.
I can change the line after the import so that the function signature matches:
jFilename = java.lang.String(filename);
pdfFile = PDDocument.load(jFilename.getBytes());
However, this causes PDFBox to have problems when I call load:
Java exception occurred:
java.io.IOException: Error: End-of-File, expected line
at org.apache.pdfbox.pdfparser.BaseParser.readLine(BaseParser.java:1111)
at org.apache.pdfbox.pdfparser.COSParser.parseHeader(COSParser.java:1874)
at org.apache.pdfbox.pdfparser.COSParser.parsePDFHeader(COSParser.java:1853)
at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:242)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1093)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1071)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1053)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1038)
This error seems to occur regardless of the PDF I'm trying to load. I'm getting the same exception with PDFBox 1.8.10 and 2.0.6.
I'm left with 2 questions:
Did Matlab 2017a change how it passes strings to Java? I didn't see anything in the release notes about this.
What could be causing the PDFBox error? Matlab is still on Java 1.7 in 2017a so I wouldn't think there should be any difference in how PDFBox works.
It seems like the method you are calling is from PDDocument version 1.8.11
In the latest version, PDDocument version 2.0.2 the method signature for accepting a file name no longer exists.
Change your code to the following, and it should work.
pdfFile = PDDocument.load(java.io.File(filename));
I'm trying to do a feature selection using the chi.squared function in FSelector package in R.
My dataset is about 132 variables X 192,000 rows.
chisquared.fs <- chi.squared(fo,df)
where fo contains the class variable: class ~.
I'm getting this error while running the code:
Error in .jcall("weka/filters/Filter", "Lweka/core/Instances;", "useFilter",
:java.lang.OutOfMemoryError: Java heap space
I know it is a Java memory leak error and I have already tried this before calling any libraries:
options( java.parameters = "-Xmx6g")
Any pointers would be really welcome.
Guys update: I had done what #copeg suggested without restarting R. I restarted R and with the options statement at the beginning before calling the libraries and it worked. Thanks for your suggestions.
Hi everyone I'm fairly new to biojava and trying to implement this piece of code:
AtomCache cache = new AtomCache();
cache.setPath("/tmp/");
FileParsingParameters params = cache.getFileParsingParams();
params.setLoadChemCompInfo(true);
StructureIO.setAtomCache(cache);
Structure strucuture = StructureIO.getStructure("4HHB");
after executing these lines im getting the following error message:
Exception in thread "main" java.lang.NoSuchFieldError: lineSplit
at org.biojava.bio.structure.align.util.UserConfiguration.(UserConfiguration.java:87)
at org.biojava.bio.structure.align.util.AtomCache.(AtomCache.java:115)
at protein_structure.main(protein_structure.java:27)
Java Result: 1
I cant figure out the reason for this error, I downloaded the pdb files for the proteins that Im working with (in this case "4HHB" in the /tmp/ directory but still the same error is showing up. can anyone tell me how Atomcache function works? Thanks
I tried setting up a BigQuery project with a JAVA API to access it. But when I run the google BigQueryInstalledAuthDemo class which is here, I get this error :
java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:191)
at com.google.api.client.json.jackson.JacksonFactory.createJsonParser(JacksonFactory.java:70)
at com.google.api.client.json.JsonFactory.fromInputStream(JsonFactory.java:223)
at com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets.load(GoogleClientSecrets.java:167)
at BigQueryLocal.loadClientSecrets(BigQueryLocal.java:99)
at BigQueryLocal.<clinit>(BigQueryLocal.java:31)
Exception in thread "main" java.lang.NullPointerException
at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeRequestUrl. <init>(GoogleAuthorizationCodeRequestUrl.java:111)
at BigQueryLocal.main(BigQueryLocal.java:47)
Which I don't understand, my JSON file is in the same folder than the class (I tried both relative and absolute paths)
My JSON file is like this :
{
"installed": {
"client_id": "XXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com",
"client_secret": "XXXXXXXXXXXXXXXXX",
"redirect_uris": ["urn:ietf:oauth:2.0:oob"],
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token"
}
}
I use the google API library 1.12-beta and java 1.6.
So, I don't understand why I have this error right there :(, so if anyone has an idea...
Thank you :)
Which IDE are you using? This tends to happen when your code can't locate the resource, because it is in the wrong directory, or is in a directory that your app doesn't consider a resource.
There's a lot of info on Stack Overflow about handling this, for example:
Where to put a textfile I want to use in eclipse?