I have a java class that I load from CF with code like this:
<cfscript>
InvoiceSet = CreateObject ("java", "edu.cornell.fcs.invoices.InvoiceSet");
InvoiceSet.init(blah);
</cfscript>
Then in my java class, I get a database connection like this:
DataSourceService ds = ServiceFactory.getDataSourceService();
This worked fine under CFMX7 pro version. It stopped working when we upgraded
to Enterprise, and have CFMX running under Jrun 4. Now we get
coldfusion.server.ServiceFactory$ServiceNotAvailab leException: The DataSource
service is not available.
It seems as though the class is loaded in a separate JVM from the CF JVM.
Any ideas on how to get around this? I'd like to be able ...

datasource service factory not available cfmx7

I have a java class that I load from CF with code like this:
<cfscript>
InvoiceSet = CreateObject ("java", "edu.cornell.fcs.invoices.InvoiceSet");
InvoiceSet.init(blah);
</cfscript>
Then in my java class, I get a database connection like this:
DataSourceService ds = ServiceFactory.getDataSourceService();

This worked fine under CFMX7 pro version. It stopped working when we upgraded
to Enterprise, and have CFMX running under Jrun 4. Now we get
coldfusion.server.ServiceFactory$ServiceNotAvailab leException: The DataSource
service is not available.

It seems as though the class is loaded in a separate JVM from the CF JVM.
Any ideas on how to get around this? I'd like to be able to continue to access
the datasources registered in CFMX administrator from within my java code.

Re: datasource service factory not available cfmx7

Re: datasource service factory not available cfmx7

I thought the Administrator API was a bunch of CFC's. I am trying to access the
registered datasources from a java class. How should I go about doing this? Is
there some doentation or examples you can point me to?

Re: datasource service factory not available cfmx7

smandl wrote:

Sorry, I didn't read your post closely enough to see that you were
trying to do that via Java. I think you got another response from
someone else, but in CF 7 Enterprise there is also a proxy so that you
can call CFCs from Java. I have yet to dig into it much but that might
also be a way to go.

Re: datasource service factory not available cfmx7

Well, it turns out this is more fundamental than I origianlly thought. I gave
up on trying to get a connection from the coldfusion datasourceservice, and
created the datasource in a different way. Now I can't return the resultset I
generate, which gets back to my original question. Are java classes loaded in a
different JVM than the CF JVM when using the createobject function?