Wraping a Java bean in a COM object!
Hello
I am trying to make a Java applet run inside Powerpoint as an ActiveX component.
I am using JavaBeans ActiveX Bridge to convert the applet to a ActiveX component.
However the applet wont work good or not at all inside powerpoint.
I am told that I should write a legal Bean program with the Bridge... I dont know to much about what makes a bean legal.
What I need help with is this and in general. How do I get a java applet inside Office runing and beeing happy
Thanks
//Woodiz
Can anyone help me with the following requirements?
Did you have any idea to call COM component from Java application? Here I have the same problem which is I want to call COM (.dll) component from EJB
(Enterprise Java Bean) Component. So could you help me out or any idea Welcomes.
Thanks in Advance.
[email protected]
Similar Messages
-
Call Java (Beans) from VisualBasic/COM?
Is this ActiveX Bridge (that come with the Java Plugin) suitable for Visual Basic programmers to call Java classes/beans/applications?
yes.
i have developed some tutorials etc. that use VBA that you can see here
http://www.reallyusefulcomputing.com/java/
i am also using the Bridge for a client server app with RMI where the
client is VB and the server is Java. -
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 -
Unix: Any support for creating com objects?
I'm looking into migrating a CF 8 server from Windows to
Unix. I see in the documentation for CreateObject that com objects
are not supported on Unix, "Note: On UNIX, this function does not
support COM objects."
Obviously, this won't work on Unix: Note:
<cfset image = CreateObject( 'com', 'ImageStoreCom.Image'
)>
But what about this, can I create a remote com object?:
<!-- assume '172.0.0.1' is a windows machine with a
registered com object on it -->
<cfset image = CreateObject( 'com',
'ImageStoreCom.Image', 'remote', '172.0.0.1' )
Finally, if the example above is out of the question, are
then any techniques for exposing a com object to CF on a Unix box?
I'm wondering if maybe I could write a Java wrapper for the com
object and expose it that way?
Thanks for your help,
DJ<ShotInTheDark>You might try wrapping your COM object
in a .NET class then accessing your .NET class
remotely.</ShotInTheDark>
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=dotNet_02.html#1160020 -
Using JNI to connect to a COM object
Hi,
I need to write an application in Java which uses a COM object. Has anyone tried to connect to/ use the functionality of a COM object by using the JNI (Java Native Interface)?
I would highly appreciate any tips on how to go about it.
Thnks,
anila1.create a java file which is having one native function which calls the COM function.
2.In static block put
static{
System.loadlibrary("WrapperDll");
3.Compile the java file(example sample.java)
4.Create the header file using the command
javah -jni sample
4.Create a wrapper dll in VC++.
5.After creating wrapper dll in VC++ , keep the dll in the class path.
6. Run the program
See this link http://java.sun.com/docs/books/tutorial/native1.1/index.html
Bye,
nrs -
How do communicate with COM DLL(microsoft COM object written in VC++)
How do i communicate with a COM DLL(written in VC++ or VB) with a java program. The COM object has a method called dispPrint(String arg).
Or if you are like me, use a product like Jawin which simplifies things like this (no need to a intermediate dll).
http://staff.develop.com/halloway/code/jawin.html -
hi..
Can we create a java bean object in workbench and set properties in it through process? If yes, please provide, pointers to it.
Thanks and Regards
Ambika MittalTo get one of your own objects into a LiveCycle process (so you can create a process variable of your type) you will need to create a custom component. Custom components allow you to create both services and java objects that can be accessed by LiveCycle.
In this case you would wrap your java object in a jar file that includes a component.xml file (this tells LC how to use your code). If you include a <data-type> entry for your objects then you will be able to create variables of your objects type.
I wrote a couple of articles on creating custom components that may help: http://www.adobe.com/devnet/livecycle/articles/dsc_development_pt2.html -
How to Use COM Component in a Java Bean
Dear Sir,
How can I use a COM Component in a Java-Bean . I am having a COM Component for reading Weighment Reading on a Serial Port and want to use this Component in a Java-Bean . I would also like to call the methods of this COM Component inside my Java-Bean . COM Component is a dll file .
Please guide me how to go ahead . If possible kindly provide some sample code for the same .
With Thanks and Regards
B V MittalYou need a Java to COM bridge like Jacob. Try searching this forum for more information, I've answered this question several times before.
Dom. -
Exception in thread main java.lang.NoClassDefFoundError: com/object/msg/SmsService
caused by: java.lang.NotFoundException: com.object.msg.SmsService
at java.net........................
at java.security.......
I'm trying to send SMS using this code and it gives above Exception during Runtime.
import java.io.File;
import com.objectxp.msg.*;
public class SendSMS
public static void main(String[] args)
SmsService service = null;
try {
// Configuration
File config = new File("jsms.conf");
// create service object.
service = new GsmSmsService();
service.init(config);
// create a new Message.
Message msg = new Message();
msg.setRecipient("7894561");
msg.setMessage("jSMS is cool!");
// Connect to the device
service.connect();
// send the Message
service.sendMessage(msg);
System.out.println("Message sent successfully, ID is ");
} catch (Exception ex) {
System.err.println("Message could not be sent: "+ex.getMessage());
ex.printStackTrace();
} finally {
if (service != null) {
try {
service.disconnect();
} catch( Exception unknown ) {}
service.destroy();
}run this one in command prompt and then convert the applet using converter tool
JC_HOME = C:\java_card_kit-2_2_2\bin\
set CLASSES=%JCHOME%\lib\apduio.jar;%JC_HOME%\lib\apdutool.jar;%JC_HOME%\lib\jcwde.jar;%JC_HOME%\lib\converter.jar;%JC_HOME%\lib\scriptgen.jar;%JC_HOME%\lib\offcardverifier.jar;%JC_HOME%\lib\api.jar;%JC_HOME%\lib\installer.jar;%JC_HOME%\lib\capdump.jar;
D:\NareshPalle\jcardRE\Smart\src>java -classpath %_CLASSES% com.sun.javacard.con
verter.Converter -out EXP JCA CAP -exportpath .\exp -applet 0x0a:0x00:0x00:0x00:0x0e:0x01:0x02:
0x03:0x04:0x05:0x06 PackageName appletName 0x01:0x02:0x03:0x04:0x05:0x0
6:0x07:0x08 1.0
or
go to following directory and run the converter tool in command prompt
step 1: cd C:\java_card_kit-2_2_2\bin\
then run this command under the above directory
step 2:converter -classdir E:\Pathof Your applet class file -out EXP JCA CAP -exportpath E:\path of exp files folder -applet AID PackageName AppletName PackAID major.minor no
For more doubts mail me....
*[removed by moderator]*
Thanks and Regards
NareshPalle
Edited by: EJP on 31/03/2012 20:09: removed your email address. Unless you like spam and unless you think these forums are provided for your personal benefit only, posting an email address here serves no useful purpose whatsoever. -
Java and COM Object out parameters
I have a COM object written in C++ that can't be modified. It has several methods with output parameters.
Can java create an instance of the COM object and pass a reference to a Variant in this case or any objects to be filled by the COM object? My output parameter keeps coming back null, but I know that the COM object is working.
BillYou didn't say anything about how you are bridging java <-> COM.
If it's via JNI, one way you could deal with this is to write a "wrapper" dll that can speak COM, but which can turn the output data into something more palatable to java - say an object that the wrapper can return. -
How to convert csv files into java bean objects?
Hi,
I have a CSV file, I want to store the data availabale in that csv file into java bean, I am new to this csv files how can I convert CSV files into java beans.
Please help me.
Adavanced Thanks,
MahendraYou can use the java.io API to read (and write) files. Use BufferedReader to read the CSV file line by line. Use String#split() to split each line into an array of parts which were separated by comma (or semicolon). If necessary run some escaping of quotes. Finally collect all parts in a two-dimensional List of Strings or a List of Javabeans.
java.io API: [http://www.google.com/search?q=java.io+javase+api+site:sun.com]
java.io tutorial: [http://www.google.com/search?q=java.io+tutorial+site:sun.com]
Basic CSV parser/formatter example: [http://balusc.blogspot.com/2006/06/parse-csv-upload.html] -
Java Bean object in Developer 6
Hi
When i create a java bean object in developer 6.0 the object is
not visiable in the canvas, but the object is created in the
object navigator. Can some one give a solution to this.
bye
sanjay
nullDear,
Your path & class_path has not been set in the control panel.
Go to system, then environment set your required path. It will
work.
Adil
Sanjay Subramanyam (guest) wrote:
: Hi
: When i create a java bean object in developer 6.0 the object
is
: not visiable in the canvas, but the object is created in the
: object navigator. Can some one give a solution to this.
: bye
: sanjay
null -
How register COM object from java?
Hi!
In my user home directory I have myCOM.dll. My sign applet use this myCOM.dll. But before use this dll I must register it (by use regsvr32).When myCOM.dll will be success register my applet can work. The problem is that I can not get answer from regsvr3 (is myCOM.dll are successed registered or not, or is user has a grants to register COM object and so on.)
Again, my java applet can work ONLY when myCOM.dll is registered.
How I can register myCOM.dll from java applet and if registered is not success exit from java applet?I must not have been clear. I am not asking how to access a COM object using Java, we already have tools to do that.
The question is whether there is a way to define a COM interface using Java. I want to code my COM object in Java. Right now we are using PowerBuilder to code COM objects. I would rather use Java. -
Using COM object library & components in Java
I've built an application that allows a PC (connected to a mobile phone by cable) to send & receive SMS from another mobile phones, using VB & Nokia PC Connectivity SDK. I want to rewrite the application in Java.
As I have read in the documentation, Nokia PC Connectivity libraries are implemented as COM libraries. That is why I am asking if can I use COM object libraries & components in Java???
And does Java environment supports object libraries as VB or C++ does???
I am a VB programmer, but I am migrating now to Java which is why I have little knowledge about it. Please be kind enough to help me with this & with my learning about Java. Any help & suggestions are very well accepted.
Thanks a lotI suggest that if you have a COM library dependency and lock-in, then Java is not the natural choice of platform. If you can re-write the Nokia connectivity app in Java, then that would be best. If you are just doing this to learn Java, then leave it and learn Java on a diff project!
When you talk of object libraries, I am guessing you are just talking about software components (as COM objects could be classed)... in which case - of course Java supports components. Take a look at JavaBeans.
HTH -
Instantiating COM objects from within the java code in WLS
is there a way to use COM objects from servlets or ejb's,
with JVM, not with JView.
thanks,
ali.Sun has released a beta product - its a COM bridge that you can use
to connect a Java2 JVM to a COM object with. I havent tried it yet
but I probably will soon.
Brad
"Michael Girdley" <[email protected]> wrote in message news:39b86deb$[email protected]..
>
>
No, at the current time we only support COM integration when using the
Microsoft JVM. The Jintegra product from Linar is good.
Thanks,
Michael
Michael Girdley
BEA Systems Inc
"Ali Ozgun" <[email protected]> wrote in message
news:[email protected]..
is there a way to use COM objects from servlets or ejb's,
with JVM, not with JView.
thanks,
ali.
Maybe you are looking for
-
Downloaded a 17 MB pdf to iPad; where did it go?
Can't find it in iBooks or Pages. I watched the progress bar fill up as it downloaded, so I am reasonably sure it is on my iPad somewhere. I emailed this doc to myself and then downloaded from Mail. iPad 2 OS 5.1
-
Superscript & Subscript in Contribute
Just wondering how you would apply add sub & super script formatting... in html you would simple put <sub>2</sub>, but in contribute you can't edit in html - thought it may be via 'Insert Special Characters' but there is nothing there. Anyone know? T
-
Deleting all itunes backup files to remove backup encryption
Alright, I need to reset my encrypted backup password on itunes, i forgot the password. I have all the data on my phone still so i am not trying to restore, i just want to remove the encryption so i don't mind deleting the backup files on my computer
-
Missing Photo Albums, Books, & Apps after latest update to 6.0
Just loaded the latest update to my i-phone thru i-tunes & lost all my music, playlists, books, e-mails, etc. How do I get these back? Thanks.
-
S10 642327A | internal upgrades (part 2): cooling - a tropical perspective
My S10 came configured with only a rear case fan. When the AC isn't running it gets darned hot in my studio - 33-35C at times (91-95F) and the hotter it is in here the hotter my machine runs. Bear in mind I am long out of warranty here... Now, I know