CFObject and java Class
Hi,
I am trying to call a java class using cfobject tag.
I placed my all classes under D:\cfm\ecpay\classes folder .
And add this path to jvm.config file.
I am getting class Not Found Exception while running my page.
Here is the code of cfobject
<cfobject
type = "java"
name = "myObj"
class = "ExcelToDb2"
action = "create">
<cfset ret = myObj.init()>
can some help me out on this.
Thanks
It is pretty straight forward and I think there would be a
problem for "Classpath". Please check it again in your CF admin.
There would be also syntax error.
Restarting the server is also required in case you compile a
new class etc.
Alternatively you can copy your classes into the directory
"cfroot\wwwroot\WEB-INF\classes" and restart the server before
testing them.
Similar Messages
-
(261680070) Q SYNCH-11 How do my web service methods accees EJBs and java classes?
A<SYNCH-11> How do my web service methods accees EJBs and java classes?
A<SYNCH-11> It is simple to use java classes, just do it as you would ordinarily.
The .jws file really contains a simple class so you can program with it in the same
way that you would use a regular Java class.
To use an EJB you can go and access it directly as you would with any EJB remote
client (lookup home stub, create, etc) or if the EJB is deployed to WLS you can use
a control to provide a very simple wrapper to the EJB. We will see this in detail
on Thursday in the ADVC module.Futher information about the possibility of callback:
It may be possible for a synchronous only web service (i.e. MS .net) to even paticipant
in the callback functionality of asynchronous web services. If the client implements
the appropriate methods for the callback but listens for them on a different port
or binding than the SOAP request, then web service may be able to build a response
if the client's "callback URL" is submitted as the beginning part of a conversation.
Watch the BEA developer forum (http://dev2dev.bea.com) for more information about
this approach and other tips and techniques for building web services.
"Adam FitzGerald" <[email protected]> wrote:
>
Q<SYNCH-03> I heard that MS .net only implements synchrnonus method? If
this is true.
Does it means my async methods will only work with J2EE clients?
A<SYNCH-03> I do not know the limitations of .net but let me point out that
is very
difficult to provide asynchronous web service method invocation (this is
different
from an asynchronous web service). HTTP as a general communication protocol
is based
on a request and response paradigm so your client libraries will mostly
likely be
expecting a response even if it is empty (check the asynchronous example
from today
to see that the start method still returns an empty response). You must
distinguish
this from the notion of an asynchronous web service which is a business
operation
that occurs on the server whose return value/result is not directly associated
with
building response to the client. An asynchronous web service can (and generally
will)
be started and stopped with web service operations that are invoked synchronously.
Thus MS .net clients can still be client to WLS hosted web services. -
JSP, Servlet, and Java Classes location in Tomcat
In tomcat, I want to know JSP files, Servlets, and Java classes
should put in different locations:
I put web.xml in the following:
C:\jakarta-tomcat-4.1.30\webapps\proj1\WEB-INF
I put all JSP files in the following:
C:\jakarta-tomcat-4.1.30\webapps\proj1
I put all servlet files in the following:
C:\jakarta-tomcat-4.1.30\webapps\proj1\WEB-INF\classes
I put all Java classes in the following with package proj1:
C:\jakarta-tomcat-4.1.30\webapps\proj1\WEB-INF\classes\proj1
When I execute JSP files, it has HTTP error 404, file not found.
The content of web.xml is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>proj1</display-name>
<description>
proj1
</description>
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
Please advise. thanks!!!<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>Where's the servlet definition that maps to "invoker"? -
Deploying the JSPs, Servlets and Java class files
Hello All,
I'm very new to the Oracle 9i AS. We are using Version 1.0.2.2.
How do we deploy the JSPs, Servlets, and Java class files (simple class files, not EJBs)?
plese give us the procedure and stpes how to deply or the links for the same.
Thanks,
Santhosh.Hi
I guess u r running apache-jserv as servlet engine for your jsp and servlets. If its so, jsp files can be run without any additonal configuration by putting the jsp file under document root or any subdirectory and for running servlets u have to add classpath entries for your servlet in jserv.properties file.
To make sure that your servlet engine is working, try
http://servername:port/servlet/IsItWorking, if u get success msg that means servlet engine is working fine.
Hope this will help
Regards
Kumaran -
Problem with cfobject calling java class
hi there,
i have a small java class that takes 2 arguments in
(fileToRead & fileToWrite) and everything runs fine when i run
the class from the command line...
C:\>java csvParser fileToRead fileToWrite
however when i try to instantiate the class via cfobject like
so :
<cfobject type="Java" action="create" class="csvParser"
name="convert">
<cfset convert.init(#tmpfile#, "text.xml")>
it continuously throws the following error at me :
Unable to find a constructor for class csvParser that accepts
parameters of type ( java.lang.String, java.lang.String ).
any ideas ast to what i may be missing here...startin to
drive me batty.C:\>java csvParser fileToRead fileToWrite
Suggests you passed arguments as args[0] and args[1] to the
method
public static void main(String[] args)
<cfobject type="Java" action="create" class="csvParser"
name="convert">
<cfset convert.init(#tmpfile#, "text.xml")>
Suggests the code for the class CSVParser has the following
constructor definition:
private String s1, s2;
CSVParser (String s1, String s2) {
this.s1=s1;
this.s2=s2;
This seems unlikely, in view of
"everything runs fine when i run the class from the command
line". One possibility is to convert the
public static void main method into, for example, the public
method
doThemFiles(String s1, String s2), not forgetting to include
the return-type in its signature. You could then run
<cfobject type="Java" action="create" class="csvParser"
name="convert">
<cfset convert.doThemFiles("#tmpfile#", "text.xml")> -
Function and java class problem
Hi, i`m trying to develop a function that is using java class in body and return a table. I will show some code for better understanding.
I`m creating TYPE:
CREATE TYPE TYP1 AS OBJECT (
NUMER NUMBER,
NAZWA VARCHAR2(5),
KLOB CLOB,
RESULTS VARCHAR2(255));
CREATE TYPE TYP1_TAB IS TABLE OF TYP1;
Then im creating function
CREATE OR REPLACE FUNCTION GET_TAB(P_CURS SYS_REFCURSOR) RETURN TYP1_TAB PIPELINED IS
OUT_REC TYP1:=TYP1(NULL,NULL,NULL);
BEGIN
LOOP
FETCH P_CURS INTO OUT_REC.NUMER,OUT_REC.NAZWA,OUT_REC.KLOB;
//here i need to pass some parameters to java class stored in my database,
something like:
java_class(numer,nazwa,klob) return RESULTS and fetch them to out_rec.results;
EXIT WHEN P_CURS%NOTFOUND;
PIPE ROW(OUT_REC);
END LOOP;
RETURN;
END;
Please help me..
Best regards
RadekHi this is the Oracle Designer forum. You would be better off asking this question over at the SQL & PL/SQL place
PL/SQL -
Hello,
I have list of java classes. I have one java class which calls only the required functions from the list of java classes. When I try to create a VI on that java class I see all the functions needed but all of them are grayed.
Can anybody please help?
Best regards,
DharmiHas anyone else solved this problem? We too are experiencing the same problem.
We are trying to build a .JWS file from within an ANT build script. The build script compiles the site into a single EAR file that should contain a deployable and usable JWS component, however it obviously does not.
If anyone has a solution, please let us know. We're facing a code freeze on this project by this Friday and really need some help. -
Hi...
My Bpel process accesses some java objects..To keep classes and projects separate I am keepin these classes in a war/ear and deploying it on oc4j...do u think the process can access the java classes in .war file..
I know i can have the java classes along with process source and copy the libs in BPEL-INF/lib but was trying to keep the code separate..
The process when compiled and built is packaged into .jar archive ..If we can drop this jar in an .ear package and deploy it probablythen the process can access the java classes..Can I access samples for the same?..
Thanks
BhupinderI don't believe you can access java objects from a war/ear, at least I wasn't able to get it working.
We have been jar'ing the objects up and placing them in C:\OraBPELPM_1\integration\orabpel\system\appserver\oc4j\j2ee\home\applib where the apps server can find them.
Toby -
Is there a tool that automatic create a java class related to a database? Similar dataset in .NET?
create a database? nyet.
There are relational databases written in Java and there are tools in java with which one can access a DBMS.
Either use a search engine, look at the java.sql and javax.sql packages, or post more information. -
I'm trying to pro-actively solve the timezone issue of
capturing and displaying data in local time for a global audience.
I found the timezone.cfc stuff (which looks like it should do a
great job), but can't seem to get it to initialize.
When it makes the call:
variables.timeZone=loader.loadClass("com.ibm.icu.impl.OlsonTimeZone").newInstance();
I get:
13:07:31.031 - java.lang.ClassNotFoundException - in
D:\Development\Serebra\TESTtimezone\REMOTEicu4jTZ.cfc : line 60
com.ibm.icu.impl.OlsonTimeZone
I'm initializing things with:
tz=createObject("component","REMOTEicu4jTZ").init("D:\path\to\jarfile\TESTTimezone\icu4j- 3_6");
I'm new to calling Java classes as objects, so it's entirely
possible I've screwed something up. Anyone have any pointers, or
even tips on how to ask the right question?1) get & install mark's javaLoader CFC from
http://javaloader.riaforge.org/
2) get the newest timezoneCFC from
http://www.sustainablegis.com/projects/tz/testTZCFC.cfm
3) read the readme file & make the modifications to the
init method to point to
where you put the javaLoader CFC & icu4j jar (it probably
won't be named icu4j.jar). -
I tried importing the data from one schema to another but the Java classes that we use (via Java Stored Procedures) are showing up as invalid. Is there any reason why? We are using Oracle 10g R2. I tried resolving them by running the following sql, but that didn't work either:
ALTER JAVA CLASS "<java_clss>" RESOLVER (("*" <schema_name>)(* PUBLIC)) RESOLVE;
Any thoughts will be appreciated.There are two ways to instantiate a target's data. One is to use a native data loader or utility. In Oracle's case, Oracle Data Pump (not the "data pump" in GG) or SQL*Loader, as an example. The other way is to use GoldenGate's data pump.
You can configure DDL synchronization for Oracle, but you have to turn off the recycle bin. See Chapter 13 in the admin guide. -
GME PLLs, forms and java class files???
Hi,
if we generate forms of GME from adadmin PLLs will also get generated but how to compile java class files of a product GME ?
simply we need to create jar files?
RegardsHi,
if we generate forms of GME from adadmin PLLs will also get generated but how to compile java class files of a product GME ?No.
simply we need to create jar files?What do you mean by "create jar files"? Do you want to compile java classes? If yes, then the correct syntax is as follows:
SQL> ALTER JAVA CLASS "Object Name" RESOLVE;Regards,
Hussein -
How can i run a program outside of Forte? (Forte and java/class files)
im making a program with forte... and i have a bunch of class files, i form file and a java file... how can i put these in one file so poeple without forte can run it...
thanksjmburns wrote:
I am trying to do a silent install of a program I built using LabVIEW 8.5. I also need to call an exe after the installation, so I am using the "run executable after installation" option on the Advanced tab of the installer. I then pass the following command lines to the setup.exe:
/qb /acceptlicenses yes /r
This installs the LabVIEW program successfully, but does not then run the additional exe afterward. If I run the setup.exe normally (with no command line parameters), the additional exe gets run.
Thanks,
Jason
This problem is fixed in a future release of LabVIEW. Here's the CAR ID 67549 for tracking purposes.
Message Edited by Bob P on 07-10-2008 09:10 AM -
Question about main difference between Java bean and Java class in JSP
Hi All,
I am new to Java Bean and wonder what is the main difference to use a Bean or an Object in the jsp. I have search on the forum and find some post also asking the question but still answer my doubt. Indeed, what is the real advantage of using bean in jsp.
Let me give an example to illustrate my question:
<code>
<%@ page errorPage="errorpage.jsp" %>
<%@ page import="ShoppingCart" %>
<!-- Instantiate the Counter bean with an id of "counter" -->
<jsp:useBean id="cart" scope="session" class="ShoppingCart" />
<html>
<head><title>Shopping Cart</title></head>
<body bgcolor="#FFFFFF">
Your cart's ID is: <%=cart.getId()%>.
</body>
<html>
</code>
In the above code, I can also create a object of ShoppingCart by new operator then get the id at the following way.
<code>
<%
ShoppingCart cart = new ShoppingCart();
out.println(cart.getId());
%>
</code>
Now my question is what is the difference between the two method? As in my mind, a normal class can also have it setter and getter methods for its properties. But someone may say that, there is a scope="session", which can be declared in an normal object. It may be a point but it can be easily solved but putting the object in session by "session.setAttribute("cart", cart)".
I have been searching on this issue on the internet for a long time and most of them just say someting like "persistance of state", "bean follow some conventions of naming", "bean must implement ser" and so on. All of above can be solved by other means, for example, a normal class can also follow the convention. I am really get confused with it, and really want to know what is the main point(s) of using the java bean.
Any help will be highly apprecaited. Thanks!!!
Best Regards,
AlexHi All,
I am new to Java Bean and wonder what is the main
difference to use a Bean or an Object in the jsp. The first thing to realize is that JavaBeans are just Plain Old Java Objects (POJOs) that follow a specific set of semantics (get/set methods, etc...). So what is the difference between a Bean and an Object? Nothing.
<jsp:useBean id="cart" scope="session" class="ShoppingCart" />
In the above code, I can also create a object of
ShoppingCart by new operator then get the id at the
following way.
ShoppingCart cart = new ShoppingCart();
out.println(cart.getId());
...Sure you could. And if the Cart was in a package (it has to be) you also need to put an import statement in. Oh, and to make sure the object is accessable in the same scope, you have to put it into the PageContext scope. And to totally equal, you first check to see if that object already exists in scope. So to get the equivalant of this:
<jsp:useBean id="cart" class="my.pack.ShoppingCart"/>Then your scriptlet looks like this:
<%@ page import="my.pack.ShoppingCart %>
<%
ShoppingCart cart = pageContext.getAttribute("cart");
if (cart == null) {
cart = new ShoppingCart();
pageContext.setAttribute("cart", cart);
%>So it is a lot more work.
As in my mind, a normal class can also
have it setter and getter methods for its properties.True ... See below.
But someone may say that, there is a scope="session",
which can be declared in an normal object.As long as the object is serializeable, yes.
It may be
a point but it can be easily solved but putting the
object in session by "session.setAttribute("cart",
cart)".Possible, but if the object isn't serializable it can be unsafe. As the point I mentioned above, the useBean tag allows you to check if the bean exists already, and use that, or make a new one if it does not yet exist in one line. A lot easier than the code you need to use otherwise.
I have been searching on this issue on the internet
for a long time and most of them just say someting
like "persistance of state", "bean follow some
conventions of naming", "bean must implement ser" and
so on. Right, that would go along the lines of the definition of what a JavaBean is.
All of above can be solved by other means, for
example, a normal class can also follow the
convention. And if it does - then it is a JavaBean! A JavaBean is any Object whose class definition would include all of the following:
1) A public, no-argument constructor
2) Implements Serializeable
3) Properties are revealed through public mutator methods (void return type, start with 'set' have a single Object parameter list) and public accessor methods (Object return type, void parameter list, begin with 'get').
4) Contain any necessary event handling methods. Depending on the purpose of the bean, you may include event handlers for when the properties change.
I am really get confused with it, and
really want to know what is the main point(s) of
using the java bean.JavaBeans are normal objects that follow these conventions. Because they do, then you can access them through simplified means. For example, One way of having an object in session that contains data I want to print our might be:
<%@ page import="my.pack.ShoppingCart %>
<%
ShoppingCart cart = session.getAttribute("cart");
if (cart == null) {
cart = new ShoppingCart();
session.setAttribute("cart", cart);
%>Then later where I want to print a total:
<% out.print(cart.getTotal() %>Or, if the cart is a JavaBean I could do this:
<jsp:useBean id="cart" class="my.pack.ShoppingCart" scope="session"/>
Then later on:
<jsp:getProperty name="cart" property="total"/>
Or perhaps I want to set some properties on the object that I get off of the URL's parameter group. I could do this:
<%
ShoppingCart cart = session.getAttribute("cart");
if (cart == null) {
cart = new ShoppingCart();
cart.setCreditCard(request.getParameter("creditCard"));
cart.setFirstName(request.getParameter("firstName"));
cart.setLastName(request.getParameter("lastName"));
cart.setBillingAddress1(request.getParameter("billingAddress1"));
cart.setBillingAddress2(request.getParameter("billingAddress2"));
cart.setZipCode(request.getParameter("zipCode"));
cart.setRegion(request.getParameter("region"));
cart.setCountry(request.getParameter("country"));
pageContext.setAttribute("cart", cart);
session.setAttribute("cart", cart);
}Or you could use:
<jsp:useBean id="cart" class="my.pack.ShoppingCart" scope="session">
<jsp:setProperty name="cart" property="*"/>
</jsp:useBean>The second seems easier to me.
It also allows you to use your objects in more varied cases - for example, JSTL (the standard tag libraries) and EL (expression language) only work with JavaBeans (objects that follow the JavaBeans conventions) because they expect objects to have the no-arg constuctor, and properties accessed/changed via getXXX and setXXX methods.
>
Any help will be highly apprecaited. Thanks!!!
Best Regards,
Alex -
Drop java class and java source
Hi,
When I query user_objects I get some java class and java source objects
select * from user_objects where object_type like 'JAVA %';
How do I drop these java source and java class objects from the database
I tried using the following command
drop java class /4a524d89_AutoTransliteratorPk
drop java source AutoTransliteratorPkg
But I get error ORA-29501: invalid or missing Java source, class, or resource name
Please someone help me in dropping these objects
thanks
saazwas the java source all caps or was it exactly AutoTransliteratorPkg. If its exactly AutoTransliteratorPkg then try this
drop java source "AutoTransliteratorPkg"
Maybe you are looking for
-
Oracle 8.1.5 for NT installation Windows XP proffessional
Oracle 8.1.5 for NT is installed on windows XP Proffessional. Installation time SID = ORCL815. Oracle TNSListner service and oracle webAssistant service are started. But oracle serviceORCL815 status is showing as starting when startup type is Automat
-
AirPrint not working with iOS 5 ...
Prior to upgrading my iPhones and iPads to iOS5 I was able to wirelessly print to my printer which is attached to my iMac (OSX 10.6.8). A while back, someone on this discussion board posted the following script to run on the iMac to enable AirPrint.
-
HT1237 BootCamp/Vista problems
I installed Windows Vista on my macbook via bootcamp. The install went well or so i thought. Now that windows is installed, the computer does not see any wireless networks or when plugged into the router the internet. I also do not see how I switch b
-
Error during iTunes 10 installation - iPod Service failed to start
Hi Everyone, I am getting this error during installation of iTunes 10(Windows XP). +*"Service (iPod Service)failed to start.Verify that you have sufficient priveleges to start system services."*+ *Can any of you please help?* I ignored it first and c
-
In my new mac book pro the lighting of the keyboard doesn't work. It is activated it the pref. pannel but when I click on the F6 orF5 key I get an icon saying I have no access to that. What can I do?