Infobus applet and BC4J
Hi All,
I have developed a few applets using infoswing components. Right now I am deploying them using the local mode. Now I'd like to deploy the business components in the middle tier. Can I deploy them as EJB in OAS or in 8i. What is the most suitable method for deploying an application of this kind.
Thanks in advance for any help.
Susan
null
Hi All,
I have developed a few applets using infoswing components. Right now I am deploying them using the local mode. Now I'd like to deploy the business components in the middle tier. Can I deploy them as EJB in OAS or in 8i. What is the most suitable method for deploying an application of this kind.
Thanks in advance for any help.
Susan
null
Similar Messages
-
Infobus applet and temporary files
Hi,
I have made an infobus applet and deploy it with the OAS407.
Now I have seen, that each time I load the applet from the
OAS407 the applet create 15 files in my temp-folder with the
prefix jar_cache (for example: jar_cache40989.tmp).
There is no problem with creating but there is a problem with
deleting because there is no mechanism for automatic deleting.
So I have to delete these files manually but I think that this
is unuseable for end-user.
Does anybody know how to bypass this problem ?
Thanks.
Nils
null<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Nils Buering ([email protected]):
I ran into the same problem when I built an applet that uses DAC and runs the app module in the downloaded applet. The Java plugin 1.2.2 is creating these files in TEMP and these files are equal in size to the support jar and zip files downloaded to the browser. You can easily verify this by comparing file sizes (use the Properties facility when you right click a Windows file sname to see its exact size in bytes). The plugin does not delete these files when you exit the browser and thus re-creates them every time you restart the browser and access the applet from the web server potentially filling the user's disk.
SUN has fixed this problem with the 1.3 plugin. Ater downloading and installing the 1.3 plugin, you must edit the applet's HTML file to add two new PARAM options: "cache_option" and "cache_archive". See http://java.sun.com/j2se/1.3/docs/guide/misc/appletcaching.html for instructions (a document titled "Applet caching in Java Plug-in") on doing this. This basically tells the plugin to use its own caching, instead of the browser's and doing this, the jar files created in the user's TEMP directory are deleted when you kill the browser.
However, since Jdeveloper is not certified with Java 2 v1.3, I ran into problems with code that works under the 1.2.2 plugin. The applet no longer runs once its been downloaded: I get a permissions error in jbo.logging.show and jbo.logging.trace; to wit: (java.lang.ExceptionInInitializerError: java.security.AccessControlException: access denied (java.sql.SQLPermission setLog). So switching to the 1.3 plugin will fix the buildup of jar files in TEMP problem; but your applets may no longer work! Best to wait until Jdeveloper is certified with 1.3 then you can run the 1.3 plugin successfully.
Hi,
I have made an infobus applet and deploy it with the OAS407.
Now I have seen, that each time I load the applet from the
OAS407 the applet create 15 files in my temp-folder with the
prefix jar_cache (for example: jar_cache40989.tmp).
There is no problem with creating but there is a problem with
deleting because there is no mechanism for automatic deleting.
So I have to delete these files manually but I think that this
is unuseable for end-user.
Does anybody know how to bypass this problem ?
Thanks.
Nils<HR></BLOCKQUOTE>
null -
Loading A Blank InfoBus Applet
I have created an InfoBus Applet and am wondering if there is any way to load it blank(no data on sreen). By default, it executes the master query and brings the results to screen when the applet loads. Is there a property on the master rowset that needs to be set? What functions are available to rowset or sessionInfo which will allow the applet to load blank, and only execute the master query when the user queries via find dialog? Any help would be greatly appreciated.
Hi,
This could be a combination of numerous things, check the following
- Flash Player version used
- Internet Explorer (IE) version
- How big is the flash file you trying to load. Try using a smaller version and see if it works. That way we can elimiate flash memory related.
Make sure all are in the supported platform for Xcelsius 2008 (What Service Pack are you on?).
Regards,
Ken -
Help. How do you TAB from HTML component to applet (and back) ?
How can one tab between applets in a browser, and from an applet to an HTML component?
For example, I have the following in my page in decending order:
an HTML text field,
an applet containing two components,
and another HTML text field.
When focus is on the first HTML text field pressing TAB should shift focus to the first component of the applet, the next TAB press shifts focus to the second component of the applet, and the next TAB press shifts focus to the other HTML text field. Then another TAB press cycles back to the first TEXT field.
I can handle the tabbing within the applet using the FocusManager, but how can I get the applet to receive focus on a TAB from the browser, and once the applet has focus, how can I give focus back to the browser when a TAB occurs from my last applet sub-component?
At the moment a user has to click on the applet before he can tab in it, and then click outside it to tab in the html again.
Any help appreciated, as I cant find any reference to how to do this apart from other people asking the same but getting no replies.
Thanks,
MennoI see what you are saying. Either use javascript with LiveConnect or go all applets.
What we are actually doing at the moment is trying to componentise using small applets passing data via InfoBus. So I guess we could use only applets as you suggest. Either with getAppletContext, or we could have a data item on the InfoBus which contains the name of the required in-focus applet, and all applets listen to see if it is their name, and if so request focus.
I'm suprised applets are not tab-able between by default. I would have thought this was a common requirement.
I'll look into LiveConnect as well, and let you know how we get on.
Cheers,
Menno -
Deploy infobus applet--"Invalidating certificate principals"
Hi, lots of questions about deploying infobus applet had been
posted previously, but none of them is my case.
After finishing generating "package1.jar", I copy every *.jar,
*.zip file into my deploy directory "c:\temp" as well as the
package1.applet1.html. But while I open this html file in
Netscape 4.7, no applet appear. In the java console, the
following error message appear..
Invalidating certificate principals in [file:/C|/temp/try/,]
Can the applet be invoked without webserver?
I had tried to transfer the whole directory to the website(sun
webserver), the same error message appear( only change is the
path now is [155.69.60.117:88])
Can anyone tell me why?
thx
nullThis is hardly an Advanced Language Topic, nor is it Java-related. And who uses Netscape? I'm just playing with you. No but seriously, nobody is gonna answer that here. This is a JAVA forum.
-
Problems deploying a simple Infobus Applet
Hi,
I am testing the infrastructure required to build an Infobus
Applet for our Web-based application using the Business Component
Framework in JDeveloper 3.0.
I have created a simple project based on the Scott schema, which
uses the Java Business Object framework to define Entity Objects,
Views, etc. for the Dept and Emp tables.
I have then created, using the Wizard, an Infobus Data Form to
create a master-detail Applet to display Employees within a
Department based on the above mentioned View Object. This works
fine when running within JDeveloper3.
However, when I try to deploy the applet to our Oracle
Application Server as a simple HTML file and JAR file (not using
EJB, etc. as we currently only have OAS 4.0.7.1 - waiting for OAS
4.0.8 to be available for download), the applet fails to start.
I have installed the Java Plug-in 1.2.2 from Sun as documented as
I'm using Swing controls.
After much frustration with the online 'Help', I managed to
create a deployment profile which included the appropriate
archives (See Packaging Source and Deployment Files in Help -
still refers to 'Rules' and 'Sources' pages ala JDeveloper 2 NOT
3.0).
Using the Console feature of the Java Plug-in, I was able to see
the progress of the Applets classes being loaded. It gets to the
point where it's trying to load the ResTable classes in
dacf.zip as found in the path:
oracle\dacf\control\swing\find
At this point, it just stops and nothing else happens.
Do I need to explicitly localize my Infobus Applet because I'm in
the United Kingdom and my PC has that as it's Regional Setting?
That is, do I need to define a ResTable_en_GB version of this
class?
Also, in attempting to create a localized version, I had errors
with JDeveloper stating that the text for the FIND_HELP_MESSAGE
exceeds the limit of JDeveloper (meaning that it's too long and I
needed to replace it with a shorter string). Could this be the
problem in the first place?
I have not been able to get the Applet to get beyond this point,
although I'm still trying the localization to Great Britain.
I know this is already a LONG email, but here is an extract from
the Java Console after which nothing else happens:
CacheHandler file name: null
Opening
http://dell_server.wsp.co.uk:4005/oracle/dacf/control/swing/find/
ResTable_en.properties no proxy
Opening
http://dell_server.wsp.co.uk:4005/oracle/dacf/control/swing/find/
ResTable_en.properties with cookie
"SITESERVER=ID=8e93834f82ef0710b78e5a4b087d6eed".
Regards
Gene Schneider
nullParameter passing in EJB must implement Serializable. One way to solve this is:
1. Define a new class which implements
Serializable.
2. Place whatever you want to pass inside
this class.
3. Now use the new class as your parameter.
eg.
public class Params implements java.io.Serializable {
String p1;
XmlDocmuent xdoc;,
etc, etc
Your program now have to use the class Params for parameter passing.
Hope this helps.
Tam
null -
Sealing violation deploying Infobus Applet
Hi:
I'm trying to deploy an Infobus Applet. The database I'm using
is Oracle 8.0.5, and I've installed the Java plug-in 1.2
The connection dialog appears fine, but when I click the open
button I get this exception
405: sealing violation...
I've read about sealing, and it seems to be a property in the
manifest file generated in the JAR. But when I open the JAR I
can't see the property referred in the documentation
Any idea about what could be the problem?
Thanks in advance
Jose Luis
nullThis is the whole text of the exception I get
Jose Luis
java.lang.SecurityException: sealing violation
at java.net.URLClassLoader.defineClass(Compiled Code)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Compiled Code)
at sun.applet.AppletClassLoader.findClass(Compiled Code)
at java.lang.ClassLoader.loadClass(Compiled Code)
at sun.applet.AppletClassLoader.loadClass(Compiled Code)
at java.lang.ClassLoader.loadClass(Compiled Code)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Compiled Code)
at
oracle.jbo.rt.jndi.JboInitialContextFactory.getInitialContext
(JboInitialContextF
actory.java:52)
at javax.naming.spi.NamingManager.getInitialContext
(NamingManager.java:783)
at javax.naming.InitialContext.getDefaultInitCtx
(InitialContext.java:165)
at javax.naming.InitialContext.<init>
(InitialContext.java:142)
at oracle.dacf.dataset.SessionInfo._createAppModule
(SessionInfo.java:1476)
at oracle.dacf.dataset.SessionInfo.connect
(SessionInfo.java:1186)
at oracle.dacf.dataset.DbAccessImpl.connect(Compiled Code)
at oracle.dacf.control.swing.LoginDlg._connectToDB
(LoginDlg.java:1641)
at oracle.dacf.control.swing.LoginDlg._okButtonClicked
(LoginDlg.java:1550)
at oracle.dacf.control.swing.LoginDlg.actionPerformed
(LoginDlg.java:1632)
at javax.swing.AbstractButton.fireActionPerformed(Compiled
Code)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed
(AbstractButton.ja
va:1101)
at javax.swing.DefaultButtonModel.fireActionPerformed
(Compiled Code)
at javax.swing.DefaultButtonModel.setPressed
(DefaultButtonModel.java:250)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased
(BasicButtonListener.jav
a:217)
at java.awt.Component.processMouseEvent(Component.java:3126)
at java.awt.Component.processEvent(Compiled Code)
at java.awt.Container.processEvent(Compiled Code)
at java.awt.Component.dispatchEventImpl(Compiled Code)
at java.awt.Container.dispatchEventImpl(Compiled Code)
at java.awt.Component.dispatchEvent(Compiled Code)
at java.awt.LightweightDispatcher.retargetMouseEvent
(Compiled Code)
at java.awt.LightweightDispatcher.processMouseEvent(Compiled
Code)
at java.awt.LightweightDispatcher.dispatchEvent(Compiled
Code)
at java.awt.Container.dispatchEventImpl(Compiled Code)
at java.awt.Window.dispatchEventImpl(Compiled Code)
at java.awt.Component.dispatchEvent(Compiled Code)
at java.awt.EventQueue.dispatchEvent(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)
null -
FYI: Deploying Infobus Applet
This is a response to multiple posts on problems with deploying
the Infobus Applet tutorial.
When you create your applet.jar file, here are some explicit
steps to follow when using the Deployment wizard, followed by
some general notes on deploying applets:
1. Select Project->Deploy->New Profile from the menu.
2. Click Next to get past the Welcome page, then accept the
default 'Deploy to Simple Archive' and click Next.
3. On the Rules page, click << to shuttle all the rules back to
the left. We won't use the rules, but will explictly select
which source files to include from our project on the next page.
Click Next.
4. On the Sources page, select your HTML file, XML file, and
Applet java file and click > to shuttle them over to the right.
Click Next.
5. Here is where things get tricky in the deployment phase. For
this specific tutorial. You do NOT want to include dependency
classes in your archive since you will deploy those separately.
Therefore, you want to ADD the oracle.dacf, oracle.jbo and javax
packages to the list of packages to EXCLUDE from the archive:
a. Click the Exclude button to display a list of packages.
b. Expand the oracle node and select the dacf subnode.
c. Click OK. Notice that oracle.dacf is added to the list of
packages to exclude from your archive.
d. Repeate a-c for oracle.jbo and javax.
e. The exclusions list on the Dependencies page should now
include oracle.dacf, oracle.jbo and javax (in addition to the
original default values)
f. Click the Preview button to show what will be included in
your archive. It should ONLY show your .class, .xml and .html
files from your project, a connection.properties file and the
manifest.
6. Click Next.
7. Enter a name for your archive jar file and click Finish to
generate it. Click Yes when prompted if you want to deploy now.
Copy the .jar file and each of the .jar/zip files listed in the
tutorial to your webserver. If the .jars will reside in a
different directory than the HTML file that calls the applet,
then you need to set the CODEBASE tag accordingly (relative path
from the HTML file to the archives).
Most of the archives you need to deploy are in the redist
directory. The classes111.zip file you deploy depends on which
driver you used, but by default will be in jdbc/lib/oracle8.1.5.
Basically, you want your applet archive file to contain ONLY the
class and xml files for your applet, and you want to deploy all
other 'referenced' archives separately (and list each of them in
the ARCHIVE tag of your applet's HTML file). This provides a few
benefits:
* your applet archive is much smaller because it doesn't
include all referenced class files
* if you have multiple Infobus applets, you only have to deploy
the commonly referenced archives once, not package them with each
applet and deploy them over and over which takes up space on the
server
As a side affect of the above deployment strategy, you have to
explictly tell the deployment wizard to EXCLUDE these referenced
packages that it would normally try to include in your archive.
That is accomplished on the Dependencies page of the wizard as
described above.
The Preview button will show you what is included. From there,
you can determine which packages to Exlcude. Keep checking the
Preview list to make sure you have stripped it down to the bare
minimum.
Hope this helps some.
L
nullHong,
Are you using an internationalized operating system and/or
Browser? This appears to be related to a Resource file which
contains translated strings.
L
Hong (guest) wrote:
: Hi,
: I did the same way as you mention below. I get this following
: error message. I guess it couldn't find this class. I don't
even
: know where I can find this class.
: Thanks
: Hong
: These are the error message:
: Opening
http://web/java/oracle/dacf/dataset/ResTable_en_US.class
: no proxy
: java.lang.ClassFormatError: oracle/dacf/dataset/ResTable_en_US
: (Bad magic number)
: at java.lang.ClassLoader.defineClass0(Native Method)
: at java.lang.ClassLoader.defineClass
: (ClassLoader.java:403)
: at java.security.SecureClassLoader.defineClass
: (SecureClassLoader.java:101)
: at sun.applet.AppletClassLoader.findClass
: (AppletClassLoader.java:144)
: at java.lang.ClassLoader.loadClass(Compiled Code)
: at sun.applet.AppletClassLoader.loadClass(Compiled Code)
: at java.lang.ClassLoader.loadClass(Compiled Code)
: at java.util.ResourceBundle.findBundle(Compiled Code)
: at java.util.ResourceBundle.getBundle(Compiled Code)
: at java.util.ResourceBundle.getBundle
: (ResourceBundle.java:334)
: at oracle.dacf.dataset.Res.<clinit>(Res.java:16)
: at oracle.dacf.dataset.SessionInfo.<clinit>
: (SessionInfo.java:59)
: at package1.Applet1.<init>(Applet1.java:207)
: at java.lang.Class.newInstance0(Native Method)
: at java.lang.Class.newInstance(Compiled Code)
: at sun.applet.AppletPanel.createApplet
: (AppletPanel.java:532)
: at sun.plugin.AppletViewer.createApplet
: (AppletViewer.java:759)
: at sun.applet.AppletPanel.runLoader(AppletPanel.java:468)
: at sun.applet.AppletPanel.run(Compiled Code)
: at java.lang.Thread.run(Thread.java:479)
: JDeveloper Team (guest) wrote:
: : This is a response to multiple posts on problems with
: deploying
: : the Infobus Applet tutorial.
: : When you create your applet.jar file, here are some explicit
: : steps to follow when using the Deployment wizard, followed by
: : some general notes on deploying applets:
: : 1. Select Project->Deploy->New Profile from the menu.
: : 2. Click Next to get past the Welcome page, then accept the
: : default 'Deploy to Simple Archive' and click Next.
: : 3. On the Rules page, click << to shuttle all the rules back
: to
: : the left. We won't use the rules, but will explictly select
: : which source files to include from our project on the next
: page.
: : Click Next.
: : 4. On the Sources page, select your HTML file, XML file, and
: : Applet java file and click > to shuttle them over to the
: right.
: : Click Next.
: : 5. Here is where things get tricky in the deployment phase.
: For
: : this specific tutorial. You do NOT want to include
dependency
: : classes in your archive since you will deploy those
: separately.
: : Therefore, you want to ADD the oracle.dacf, oracle.jbo and
: javax
: : packages to the list of packages to EXCLUDE from the archive:
: : a. Click the Exclude button to display a list of packages.
: : b. Expand the oracle node and select the dacf subnode.
: : c. Click OK. Notice that oracle.dacf is added to the list
: of
: : packages to exclude from your archive.
: : d. Repeate a-c for oracle.jbo and javax.
: : e. The exclusions list on the Dependencies page should now
: : include oracle.dacf, oracle.jbo and javax (in addition to the
: : original default values)
: : f. Click the Preview button to show what will be included
in
: : your archive. It should ONLY show your .class, .xml and
.html
: : files from your project, a connection.properties file and the
: : manifest.
: : 6. Click Next.
: : 7. Enter a name for your archive jar file and click Finish to
: : generate it. Click Yes when prompted if you want to deploy
: now.
: : Copy the .jar file and each of the .jar/zip files listed in
: the
: : tutorial to your webserver. If the .jars will reside in a
: : different directory than the HTML file that calls the applet,
: : then you need to set the CODEBASE tag accordingly (relative
: path
: : from the HTML file to the archives).
: : Most of the archives you need to deploy are in the redist
: : directory. The classes111.zip file you deploy depends on
: which
: : driver you used, but by default will be in
: jdbc/lib/oracle8.1.5.
: : Basically, you want your applet archive file to contain ONLY
: the
: : class and xml files for your applet, and you want to deploy
: all
: : other 'referenced' archives separately (and list each of them
: in
: : the ARCHIVE tag of your applet's HTML file). This provides a
: few
: : benefits:
: : * your applet archive is much smaller because it doesn't
: : include all referenced class files
: : * if you have multiple Infobus applets, you only have to
: deploy
: : the commonly referenced archives once, not package them with
: each
: : applet and deploy them over and over which takes up space on
: the
: : server
: : As a side affect of the above deployment strategy, you have
to
: : explictly tell the deployment wizard to EXCLUDE these
: referenced
: : packages that it would normally try to include in your
: archive.
: : That is accomplished on the Dependencies page of the wizard
as
: : described above.
: : The Preview button will show you what is included. From
: there,
: : you can determine which packages to Exlcude. Keep checking
: the
: : Preview list to make sure you have stripped it down to the
: bare
: : minimum.
: : Hope this helps some.
: : L
null -
InfoBus applet deployment steps
It seemed that some "users" have had success with the deployment
of the InfoBus applet, can someone be kind enough to post the
steps / process, ie to share their success stories
thanks in advance
nullMake sure below :
1.Only contain the application's class files,XML file,and
connection.properties file in your .jar file.
2.Distribute .jar file with runtime libaries for Infobus applet:
class111.zip,connectionmanager.zip,dacf.zip,infobus.jar,
javax_ejb.zip,jbomt.zip,jboremote.zip,jndi.jar,
jdev-rt.zip,swingall.jar,xmlparser.jar
3.Try your applet with IE browser.
null -
Difference Between Applet and Swing
Difference Between Applet and Swing
The advantages and disadvantages of both applets and Swing are the small fluffy elephants you get inside of every box. They're quite well trained and can skeletonize your neighbors' annoying pets upon command.
-
IIS, Javascript, Signed Applet and ASP Blank Page Problem
Hi,
I'm having a problem using a Signed Applet in a site that runs in a IIS (Windows Server 2003).
My aspx web page uses the applet to read my smart card and get information from it.
This applet uses an auxiliar dll (stored in a second Signed Jar file) in order to read the information from my smart card.
The way the solution is design:
1) Aspx page is asked from server
2) Internet Explorer recieve the page and asks the server for it content (images, applet, javascripts, etc)
3) After this the JVM runs (console opens)
4) After the Aspx page render fully a javascript register onload fires and call an applet method
5) Applet receive the call and run the logic of the method:
- reads the smart card;
- calls Javascript function in order to fill aspx fields with information from smart card
- calls Javascript function the simulates a click in a botton of aspx page (in order to call server side part sending data readed from smart card to server)
5) The server makes some logic with the information receive and responds to client registering in aspx page a call to another Javascrit function
6) The client received the asnwer from server and runs the Javascript function registered on step 5)
This Javascript calls another method from applet and runs the following logic:
- reads more information from smart card;
- call javascript function in order to fill more fields of aspx page with the information readed
- calls Javascript function the simulates a click in a botton of aspx page (in order to call server side part sending data readed from smart card to server)
7) The server makes some logic and call another pages with no Applets
8) Client asks for a second page with the same applet and we start with another logic express on steps 1);2);3),4);5) and then 7).
This is all ok, until sometimes the server stop responding correcly for requests regarding this two pages with the Applet.
When this happens the server just responds with a blank page.
- with fiddler I can seer the request for the aspx page (that uses the applet)
- but server responds with a blank html page
The JVM doesn't fire.
The IIS log don't show errors.
The eventviewer doesn't show errors.
The problem is solved with an IIS reset or a Application Pool reset.
After a while the problem returns.
This problem occours for other user in another machine, the server just stops responding correcly to request regarding pages with applets, the other pages still continue to work.
If we disable Java Control Panel->Advanced->Java Plug-in->Enable the next-generation Java Plug-in the problem seend to stop, but we can't force all clients to disable this option right?
Or there is a way to force the Applet to run with this option disabled?
As anyone experience similar problem?
Regards,
OFThis is all ok, until sometimes the server stop responding correcly for requests regarding this two pages with the Applet.
When this happens the server just responds with a blank page.
- with fiddler I can seer the request for the aspx page (that uses the applet)
- but server responds with a blank html pageWell, if http requests look identical in case of success and failure (pay attention to cookies, etc) then it has to be something on the server side.
It could be that server gets into this wrong state because of previous requests made by applet but it is hard to tell.
I am not clear how old/new plugin can make a difference unless your applets run in the legacy mode (i.e. you are actually trying to reuse SAME instance of the applet when
it is loaded next time).
I'd start with
1) carefully comparing good/bad sessions
2) checking whether server will serve correct response to another client when it serves "bad" page for current client
3) add debug statements to aspx - it is scripted page, may be some condition is not met and then it returns blank?
4) record all http requests in one session until you get to "error" state and then use any http server testing tool to "replay" this set of requests.
You should be able to get server into the same state without use of applet. Then you can try to tweak set of requests to see what makes a difference. -
I need help with Applets and Multithreading
[hello all. first time poster. big fan of java.]
now to the important matter: Applets and Threads
=======================================
1) I have an applet with that implements the runnable interface, and has one thread (and a simple animation). If I try to view this applet in the applet viewer with JGrasp, it spits an insane error telling me
"java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)"
but, if I run the applet through a web browser, by putting it in an html document, it runs correctly, without error
What on earth is wrong, and how do I fix it?!?
2) I want to put 2 threads in my applet?
If I implement the Runnable interface, I can only have one Run() method in my applet, right?
So how do I define behaviour for 2 threads when I only have one run method in which to define the behaviour? Can I use two threads with the runnable interface, or do I have to make objects of my own defined thread classes?
3) I tried to make 2 threads in my applet by creating my own thread classes, and instantiating them in my applet (instead of implementing the runnable interface).
I still get the same insane error as I mentioned in my first point (which I expected), except now, the applet won't work even when viewed through a web browser!!
Please please help me. I am frustrated beyond belief (at what is probably a very simple problem)
I have searched and searched all over and found no answers on thisIf I try to view this applet in the applet viewer with JGrasp, it spits an insane error telling me
"java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)"Don't know anything about JGrasp, but it runs with pretty tight security - thats what this insane error is all about. Use the appletviewer or a browser.
If I implement the Runnable interface, I can only have one Run() method in my applet, right?Correct
So how do I define behaviour for 2 threads when I only have one run method in which to define the behaviour?
Can I use two threads with the runnable interface, or do I have to make objects of my own defined thread classes?You can create two Runnable implementations (classes) in your applet.
example (missing code)
class MyApplet extends Applet {
void doSomething() {
void doSomethingElse() {
void startThreads() {
Thread t = new Thread(new Runnable() { public void run() { doSomething();}});
t.start();
t = new Thread(new Runnable2());
t.start();
class Runnable2 implements Runnable {
public void run() {
doSomethingElse();
}If the above seems confusing, read up on anonymous and inner classes.
3) I tried to make 2 threads in my applet by creating my own thread classesTry not subclassing thread - this causes a security check -
Socket communication failure between Java applet and C++ application
I have a java applet that connects to a C++ application via Java's ServerSocket and Socket objects. THe C++ application is using the Winsock 2 API. The applet and application are running on an NT workstation (SP 6) and using IE (5.5) For a very simple C++ test applications the communictions work fine. Once more code gets added to the C++ application the portion of the socket that C++ listens to seems to close. Upon performing a recv call the return value is a zero. Microsoft insists this is a sign the Java side has shut down the socket. The Java applet can still receive messages from the C++ app but C++ cannot receive responses from the Java side. Java throws no exceptions and an explicit check of the socket shows no errors. Again, what puzzles me is that it works for simple C++ applications. Are there any known conflicts between Java and C++ in this regard?
I have inlcuded the basic java code segments below.
/ run Method.
* This method is called by the Thread.start() method. This
* method is required for the implementation of the Runnable interface
* This method sets up the server side socket communication and
* contiuously loops looking for requests from a external
* socket.
* @author Chris Duke
public void run(){
// create socket connections
boolean success = false;
try {
cServerSocket = new ServerSocket(cPortID);
System.out.println("Waiting for client to connect...");
cClientSocket = cServerSocket.accept();
System.out.println("Client connected");
// Create a stream to read from the client
cInStream = new BufferedReader(new InputStreamReader(
cClientSocket.getInputStream()));
// Create a stream to write to the client
cOutStream = new PrintWriter(
cClientSocket.getOutputStream(), true);
success = true;
}catch (IOException e) {
System.out.println("CommSocket:Run - Socket Exception(1) " + e);
success = false;
// if the socket was successfully created, keep the thread running
while (success){
try{
// check socket to see if it is still available for reading
if (cInStream != null && cInStream.ready()){
// check for an incoming message
String message = ReceiveMessage();
// Send message to listeners
Event(message);
if (cInStream == null){
success = false;
System.out.println("CommSocket:Run - shutdown");
}catch (IOException e){
System.out.println("CommSocket:Run - Socket not ready exception");
break;
// SendMessage method -
* Sends a text message to a connected listener through port specified by portID
* @author Chris Duke
* @param String message - This will be the message sent out through the server
* socket's port specified by portID.
public void SendMessage(String message){
cOutStream.println(message);
if (cOutStream.checkError() == true)
System.out.println("SendMessage : Flush = Error");
else{
System.out.println("SendMessage : Flush - No Error");
}a very simple C++ test applications the communictions work fine. Once more code gets added to the C++ application the portion of the socket that C++ listens to seems to close.
This quite strongly implicates the extra code in the C++ App. The firstly thing I would try would be telnet. Try connecting to both versions of the C++ Application and manually reproducing a proper exchange.
a recv call the return value is a zero. Microsoft insists this is a sign the Java side has shut down the socket.
A correct implementation of recv should return the number of bytes received, or -1 for an error. A zero return indicates no bytes received not a socket closed/error. This sounds like FUD to me.
Are there any known conflicts between Java and C++ in this regard?
I can see no obvious faults, though the code is incomplete, I don't think it's an sockets implementation issue, at either end, it sounds more likely to be a protocol/handshaking bug in the C++ App. -
Security issues with applets and windows Vista when printing to file
Hi, everyone
I am currently developing an application that prints out the result of some calculations.
from a Javascript file, the output finally ends up in a java applet that should print the file in a special printer.
For debugging purposes I have created a File printer that creates a file from the output comming to the printer; this way I can debug what commands the printer is receiving.
This worked well on Windows Xp; Vista always asks for permissions for the applet, and altough I guarantee these permissions, printer is not allowed to create the output file and reports an error writing
after a little research, I have found that java applets have all permissions when certificated as trusted applications; all but file creating permissions
anyone has any idea of how could I fix this problem?
Thanks in advanceHI,
Have you actually signed your applet? If the signers certificate is the trusted key store for Java it should treat your applet as trusted. You can use a self signed certificate for testing as long as the cert is in the trusted key store.
Some links that might help:
[http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/keytool.html]
[http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/rsa_signing.html]
Cheers,
Shane -
I'm crazy!Applet and JNA Error:Library 'jnidispatch' was not found!
Hi all,
sorry to bother you, I really have no idea how to do JNA and Applet. I'm hardly mazy, man.
Every time it will throw an error to me :
Exception in thread "thread applet-JNAApplet-1" java.lang.UnsatisfiedLinkError: Library 'jnidispatch' was not found by class loader sun.plugin2.applet.JNLP2ClassLoader@291aff
at com.sun.jna.Native.getWebStartLibraryPath(Native.java:858)
at com.sun.jna.NativeLibrary.<clinit>(NativeLibrary.java:576)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:372)
at com.sun.jna.Native.loadLibrary(Native.java:357)
at JNAApplet.init(JNAApplet.java:15)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)My program is so easy, I just want use Applet to revoke JNA and use the JNA to load a native lib.
here is the structure of my program:
Applet code :
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JPanel;
import com.sun.jna.Native;
public class JNAApplet extends JApplet {
public static Kernel32 kernel32 = null;
@Override
public void init() {
createGUI();
kernel32 = (Kernel32)Native.loadLibrary("Kernel32", Kernel32.class);
if (kernel32 == null) {
System.out.println("load kernel32 fail!");
} else {
System.out.println("load kernel32 success!");
private void createGUI() {
JPanel panelCenter = new JPanel();
JButton butTest = new JButton("Test");
panelCenter.add(butTest);
setContentPane(panelCenter);
}When I run it on debug mode, it is ok! but when I deploy it , it will throw above error message to me.
My Applet html:
<html>
<head>
<title>JNA Applet</title>
</head>
<body>
<script src="deployJava.js"></script>
<script>
var attributes = { code:'JNAApplet', width:300, height:300} ;
var parameters = {jnlp_href: 'JNAApplet.jnlp'} ;
deployJava.runApplet(attributes, parameters, '1.5');
</script>
</body>
</html>File 'JNAApplet.jnlp':
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
<information>
<title>JNA Applet</title>
<vendor>Steven</vendor>
</information>
<resources>
<j2se version="1.5+"
href="http://java.sun.com/products/autodl/j2se" />
<jar href="JNAApplet.jar" main="true" />
</resources>
<applet-desc
name="JNA Applet"
main-class="JNAApplet"
width="300"
height="300">
</applet-desc>
<update check="background"/>
</jnlp> I really have no idea. and I can't search any usefull infomation from Google and officer site.
Can any one help me? Thank you very much!!!!Hi AndrewThompson64:
Did you mean the JNA project? Or are you refering to JNI, or ..something else?Yes, I mean is that I wanna jna.jar to replace JNI to code with Applet. I want Applet can run native library(.dll files).
That reads like so much nonsense to me.Sorry fo that.
Was there any 'caused by' part that you trimmed? I expected to see something to do with 'Security' or 'AccessControl'.Sorry, I can't saw any 'cause by' subsentence there. This message is just gain from Applet Console.(Is there any method to gain more message?)
About 'Security' and 'AccessControl' I just modify my java.policy file to allpermission. Subsequently, I signed all jar files.
For now I have 3 jar files(all have been signed ):
--example.jar : for this little program.(code include applet and application entry)
--jna.jar
--win32-x86.jar : include kernel32.dll and jnidispatch.dll for win32 and x86.
and 2 JNLP files:
--JNAApplet.jnlp the entry is JNAApplet.class (this jnlp does not work)
--JNAApp.jnlp the entry is JNAApp.class (this jnlp works)
And for now new error message show like this:
Exception in thread "thread applet-JNAApplet-1" java.lang.UnsatisfiedLinkError: Library 'Kernel32' was not found by class loader sun.plugin2.applet.JNLP2ClassLoader@4aeb52
at com.sun.jna.Native.getWebStartLibraryPath(Native.java:858)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:97)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:228)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:372)
at com.sun.jna.Native.loadLibrary(Native.java:357)
at JNAApplet.init(JNAApplet.java:12)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Did you mean invoke?
Revoke: To annul by withdrawing.
Invoke: To call on.Yes, you got it. Thank you.
The JNLP file is invalid. ..I was about to put my 'standard' text here, but I'm sick of saying it. Search the forum for my posts - 50% of them, at least, mention validation and how to go about it.
Also, the applet-desc requires a documentbase.Thank you, I really think I have some invalid section. But I can't find it, and you said 'Search the forum for my posts - 50% of them...' , I can read the JNLP structure on site of sun and I can to read you post too(I'm doing like this).*I only want to know about how to load "native lib like *.dll" properly*.
What 'officer site'?I mean jna project site. Sorry for ambiguity.
Please fix that sticky '!' key. One '!' indicates astonishment, while two or more typically indicates a bozo. Thanks for your advice. Because I tried to find solution do my best lasting two days. I got nothing. I'm sadness.
here post my new files:
import javax.swing.JFrame;
import com.sun.jna.Native;
public class JNAApp {
public static Kernel32 kernel32 = null;
public static void main(String[] args) {
// TODO Auto-generated method stub
kernel32 = (Kernel32)Native.loadLibrary("Kernel32", Kernel32.class);
JFrame frame = new JFrame();
frame.setSize(500, 500);
frame.setVisible(true);
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JPanel;
import com.sun.jna.Native;
public class JNAApplet extends JApplet {
public static Kernel32 kernel32 = null;
public void init() {
createGUI();
kernel32 = (Kernel32)Native.loadLibrary("Kernel32", Kernel32.class);
private void createGUI() {
JPanel panelCenter = new JPanel();
JButton butTest = new JButton("Test");
panelCenter.add(butTest);
setContentPane(panelCenter);
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
<information>
<title>JNA Applet</title>
<vendor>Steven</vendor>
</information>
<resources>
<j2se version="1.5+"
href="http://java.sun.com/products/autodl/j2se" />
<jar href="JNAApplet.jar" main="true"/>
<jar href="jna.jar"/>
</resources>
<resources os="Windows" arch="x86">
<nativelib href="win32-x86.jar"/>
<nativelib href="kernel32.jar"/>
</resources>
<applet-desc
documentBase=""
name = "success"
main-class="JNAApplet" width = "200" height = "200">
</applet-desc>
<update check="background"/>
<security>
<all-permissions/>
</security>
</jnlp>
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
<information>
<title>JNA Applet</title>
<vendor>Steven</vendor>
</information>
<resources>
<j2se version="1.5+"
href="http://java.sun.com/products/autodl/j2se" />
<jar href="JNAApplet.jar" main="true"/>
<jar href="jna.jar"/>
</resources>
<resources os="Windows" arch="x86">
<nativelib href="win32-x86.jar"/>
<nativelib href="kernel32.jar"/>
</resources>
<application-desc
main-class="JNAApp">
</application-desc>
<update check="background"/>
<security>
<all-permissions/>
</security>
</jnlp> Thanks & Best Regards,
Su Heng
Maybe you are looking for
-
Weird gnome-shell/gdm issue
This is the first time using arch, though I have been using Ubuntu for a while. I have it installed in 64-bit virtualbox inside an ubuntu host. I just installed gdm and gnome-shell, but a weird issue happens when drawing some text. This happens on th
-
Why Censor Our Forum Topics? Embarrassment?
Hi folks, Some of you may be experiencing a problem listening to radio streams in Safari. In a nutshell, after you initiate a live feed, if you then switch tabs or minimize the window, Safari stops playing the stream. It's not related to video, it's
-
Adobe CS4 Silent installation/Uninstallation
Hi, <br /><br />We are trying to install/uninstall Adobe CS4 silently. We are using below URL as a reference. <br /><br />http://www.adobe.com/aboutadobe/openoptions/pdfs/manualenterprisedeployment_cs4_help.pd f <br /><br />Our problem lies in that,
-
Just setting up FCE and have question
This is probably a stupid question but when I set up FCE and select my external drive as my scratch drive, where will the project folder be created? Is it on the external drive with the clips etc. I import or will it be located in the documents folde
-
Hallo liebe Community, es gestaltet sich leider etwas schwierig eine älter version der CS serie zu bekommen. Wie in der Überschrift steht suche ich nach einem funktionierenden downloadlink von der CS5 Version. Der Link von Adobe funktioniert leider n