How to: Calling a java class from asp?
Hello all i have a problem to call a Java class from a asp
Here what I do:
[JavaSays.java]
package JavaCom;
public class JavaSays
public String Hello()
return "Hello world" ;
then
javareg /register /class:JavaCom.JavaSays /progid:JavaCom.JavaSays
md c:\winnt\Java\TrustLib\JavaCom
copy JavaSays.class c:\winnt\Java\TrustLib\JavaCom
--Asp
--TestJavaCom.asp
<html>
<body>
<h1>Simple Test</h1>
<% Set ObjPrueba = Server.CreateObject("JavaCom.JavaSays") %>
<%= ObjPrueba.SimpleFn(5) %>
<hr>
</body>
</html>
when i try to run my asp
it tell me that:
Error type : Server Objetc, ASP 0177 (0x80040111)
ClassFactory can not find the class
any idea???
thanks.
I think the OP wants to use a class file as a COM object. I've never done that, but this URL:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q167941&
seems to indicate that you should have placed the class file into the c:\winnt\Java\TrustLib\ sub directory before you ran the JAvaReg bat file - I would re-run JavaReg and bounce IIS and associated services and see if that works out.
Good Luck
Lee
Similar Messages
-
How to call a Java class from another java class ??
Hi ..... can somebody plz tell me
How to call a Java Class from another Java Class assuming both in the same Package??
I want to call the entire Java Class (not any specific method only........I want all the functionalities of that class)
Please provide me some slotuions!!
Waiting for some fast replies!!
Regards
Smita MohantyHi Smita,
you just need to create an object of that class,thats it. Then you will be able to execute each and every method.
e.g.
you have developed A.java and B.java, both are in same package.
in implementaion of B.java
class B
A obj = new A();
//to access A's methods
A.method();
// to access A's variable
//either
A.variable= value.
//or
A.setvariable() or A.getvariable() -
Hello all i have a problem to call a Java class from a asp
Here what I do:
[JavaSays.java]
package JavaCom;
public class JavaSays
public String Hello()
return "Hello world" ;
then
javareg /register /class:JavaCom.JavaSays /progid:JavaCom.JavaSays
md c:\winnt\Java\TrustLib\JavaCom
copy JavaSays.class c:\winnt\Java\TrustLib\JavaCom
--Asp
--TestJavaCom.asp
<html>
<body>
<h1>Simple Test</h1>
<% Set ObjPrueba = Server.CreateObject("JavaCom.JavaSays") %>
<%= ObjPrueba.SimpleFn(5) %>
<hr>
</body>
</html>
when i try to run my asp
it tell me that:
Error type : Server Objetc, ASP 0177 (0x80040111)
ClassFactory can not find the class
any idea???
thanks.any idea???Yes, you are in the wrong forum, this is a Java forum, you have an ASP question, so i suggest you visit an ASP forum/site
-
How can I call a java class from within my program?
I was wondering if there's a platform independent way to call a java class from my program.
Here's my scenario. I'm working on a platform independent, feature rich, object-oriented command prompt program. The way I'm designing it is that users can drop classes they write into my bin directory and gain access to the class through my program. For example, they drop a class named Network.class in the bin directory. They would type Network network at my command prompt and gain access to all the methods available in that class. They can then type system.echo network.ipaddress() at my prompt and get the system's ip address. I have it designed that there's a server running in the background and the clients connect to my port. Once connected the end-user can enter their user name and password and gain access to the system. When they type a command they actually call another java program which connects to my server using a seperate thread. They can then communicate back and forth. I have it set that everything has a process id and it's used to keep track of who called what program. Once the program is done it disconnects and closes. Rather than getting into the nitty gritty (I didn't want to get into heavy detail, I know how everything will work) I'm really interested in finding out how I can call a java program from my program. I don't want it to be part of the app in any way.
-
How do you call a java class from the main method in another class?
Hi all,
How do you call a java class from the main() method in another class? Assuming the two class are in the same package.
Thanks
SI
Edited by: okun on May 16, 2010 8:40 PM
Edited by: okun on May 16, 2010 8:41 PM
Edited by: okun on May 16, 2010 8:47 PMgeorgemc wrote:
To answer your impending question, either the method you're calling has to be static, or you need an instance of that other class to invoke it against. Prefer the latterAnd to your impending question after that: no, don't use the Singleton pattern. -
Calling a Java Class from PL/SQL
Hai,
I need a technique of calling a class file and invoke its
methods written in Java by PL/SQL for my intranet development.
PLease let me know if you have really experienced and won.
Thanks
JOhnsonFirst, to call a Java class from PL/SQL the class needs to be
deployed to the database. you can check the 8i documentation for
the instructions for loading Java into the database(LoadJava).
The document contains information on how to load the Java and
call it from PL/SQL. The following links should help.
Loading Java:
http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/
java.817/a83728/03write6.htm
Invoking a Java Method in the database:
http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/
java.817/a83728/04jserv2.htm
Gary (JDev Team) -
I want to call External Java class from the PL/SQL
Hi,
I am using Oracle Apps R11i (11.5.7), I wanted to call external Java class from the PL/SQL. This external Java class is residing in another application server.
How do I do this.
I know one way. Develop C routine in Oracle Apps to call external java class and call this C routine from the PL/SQL.
Is there any simple method available? or any other method?
Thanks in advance.
-VenkatFirst of all, this is a Java application you're talking about, right (i.e. it has a main() function)? It's not just a class that you're trying to instantiate is it? If it's an application, you obviously have to start a new virtual machine to run it (rather than using the virtual machine built into the database like stored java). I'm a little leary of your mention of an "application server" as this would more commonly mean that a virtual machine is already over there running with access to this class. In which case, you'd typically interface with SOAP or some other RPC API.
All that aside, as long as you have physical disc access (through NFS or whatever) to the class file, you could use a java wrapper class with a system call to do this. In fact, there is a thread in just the last day or so on this very forum that has the code to do just that (see " Invoking OS Commands from PL/SQL"). However, it's worth noting that the virtual machine will be running on the database server in this case and not the application server. -
Calling my Java class from JSP page
Hello, I am trying to call my Java class from my JSP page passing parameters to it and getting back a collection of result sets. Can someone tell me what I might be doing wrong:
JSP code to call Java class:
<%
String strEssUser = "test";
String strProcessingMonth = "JUL";
String strProcessingYear = "2002";
strQueryList=new ListReturn(strEssUser.toString(), strProcessingMonth.toString(), strProcessingYear.toString());
%>
I get this error when I try to run this JSP page using tomcat:
C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\em\jsp\Test_0005fSummarySBU_0005fscreen$jsp.java:77: Class org.apache.jsp.ListReturn not found.
strQueryList=new ListReturn(strEssUser.toString(), strProcessingMonth.toString(), strProcessingYear.toString());
I'm not sure if this problem is the way I am calling the Java class, or if I have a problem in the Java code itself. Can anyone help?Ok, I get a very strange error now:
org.apache.jasper.JasperException: Unable to compile class for JSPerror: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
What is this??? Anyone? -
Is there an easy way to call a java class from an applet?
Does anyone know of an easy way to call a server based java class from an applet? Has anyone done it or came across it? If yes how/where?
Cheers, Chris.I'm not sure about the issue. Are you talking about "servelets"? "RMI"? Take a look at those issues.
-
How to run a java class from a shell script with passing arguments
hi,
I have a jar with all the required classes. I was using ant to run the classes i needed.
But now i want to use a shell script to run the class, also the class accepts some arguments so when script is run it should accept arguments.
So can any one tell me how to set class paths, jar location and call the required class from shell script or batch file with passing arguments to it.
Thanks in advance.Let's say that the order of arguments is as below
1. Jar file name
2. Classpath
Your shell script would look like this
java -cp $CLASSPATH:$2 -jar $1 I am assuming that your jar file has the required main-class entry in its manifest. Note that $1...$9 represent the arguments to this shell script.
The same goes for a batch file
java -cp %CLASSPATH%;%2 -jar %1 -
Calling Custom Java Class from WCC?
How do I call a custom Java class from WCC when a certain metadata field is set to 'On' and at the time of check-in?
Thank you,
RandyRandy,
You would only use the Intradoc classes if running as a service, service handler, filter or class alias as a component within WebCenter Content. In this case, since it is running inside WebCenter Content, you do not need to bundle the Intradoc classes since they are already on the classpath.
If you are trying to code something that will not run inside WebCenter Content, you want to use RIDC: http://jonathanhult.com/blog/2012/12/ridc-examples/
Jonathan
http://jonathanhult.com -
Calling a java class from a java web service
I have deployed a web service to weblogic 8.1 SP5 and now i want to call a simple java class from that web service.How can i do it.
Hi jazz123,
There's an example in the [*Java Web Services Tutorial*|http://java.sun.com/webservices/docs/2.0/tutorial/doc/] : see Chapter 1: Building Web Services with JAX-WS - A Simple JAX-WS Client. -
How to call a java class in a bat file
Hi
I need to call a Test.java class in a bat files .It refer .DOM.jar
in C:/url; How do i call the java class i need the syntax
Thanks lotassuming lanch.bat, Test.class and DOM.jar are in c:\url
assuming %JAVA_HOME% is defined (else substitue it with your java installation directory)
here is the content of launch.bat:
cd C:/url (or cd c:\url ) (or cd c: followed by cd url)
%JAVA_HOME%\bin java -classpath .;DOM.jar Test
hop that'd help,
marvinrouge -
Problem Calling a Java class from PLSQL function
We are calling a Java class through oracle function as
FUNCTION CalculateAMW (contributorid IN Number,
fromdate IN Date,OHorAnncoverage in Number,
OHAnncoverage in Number,
AppStatus in Number,
Status in Number)
RETURN Number
AS LANGUAGE JAVA
NAME 'AMWCalculations.calculateAMW
(long,java.sql.Timestamp,long,long,long,long) return double';
on execution of this function the sql prompt for the 1st time it is giving the output
but
if reexecute it is throwing and error ORA - 932 : Inconsistent
datatypes.
Recompiling the java class then it works for the 1st time and the next
time
we execute it throws error as explained above.
What could be the problem.
Thanks
Nanda Kishoreany idea???Yes, you are in the wrong forum, this is a Java forum, you have an ASP question, so i suggest you visit an ASP forum/site
-
Calling a java class from abap/bsp
Hello,
I am still learning ABAP. I need to call a java class (a chart drawing library) from ABAP or from a BSP. What is the best way to do that ?
Basically I would create an object, pass data from a database and then get some binary data from that object (an image).
Hope you can help me
Sincerely,
Olivier Matt/people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
check the above link and this forum too
Call Java Class and Methods from ABAP
Maybe you are looking for
-
The file "?" could not be opened because it is empty.
I put about 30 photos on my thumb drive so I could take them with me. I saw them on the drive at one point, now on some of them I am getting the error; "The file "?" could not be opened because it is empty." The file still is large in size, and th
-
How can I remove Yahoo trojan?
Several time an hour, the screen below pops-up, asking for my Yahoo email password. Once, when I did submit my password, a spam email was immediately sent to all of my friends. I changed my password but can't get rid of this popup. I don't know if it
-
Extend or copy configuration from one company code to another - 5 years old
hi friends, we have typical scenario, we are upgrading in next 6 months, in btwn we need urgently an ERP system for factory in another different country, we have an 5years old existing SAP 4.7 system running all modules so can i copy the configurati
-
Hi, new on this forum here. Any help would be appreciated. I have over 1000 audio files in mp3 format at 96 bit. The audio files are normalized at 95.7. These files are preaching sermons at about 2 hours in length a piece (by the same person). They w
-
I'm getting error 5000 while trying to backup my phone before I can run an update
I'm getting error 5000 while trying to backup my phone so I can run an update. I'm getting a message that says my back up is corrupt. What does that mean and how can I fix it?