"Java-Bean: True" missing after being packed in jar file

Hi All
X86, Windows XP Professional, J2SDK 1.4.2
I complied a section of code ", which is from << Thinking In Java>>(3rd).
Created a manifest file "BangBean.tmp"
<<
Name: bangbean/BangBean.class
Java-Bean: True
>>
And then packed class files into "BangBean.jar" with command
"jar cfm BangBean.jar Bang BangBean.tmp bangbean".
It's puzzling that "Java-Bean: Ture" was missing in the "BangBean.jar/META-INF/MENIFEST.MF" .
<<
Manifest-Version: 1.0
Created-By: 1.4.2 (Sun Microsystems Inc.)
Name: bangbean/BangBean.class
>>
What's more, after altering the"BangBean.tmp" into this
<<
Java-Bean: True
Name: bangbean/BangBean.class
>>
and had a another try.
I got a jar file with such MENIFEST.MF.
<<
Manifest-Version: 1.0
Created-By: 1.4.2 (Sun Microsystems Inc.)
Java-Bean: True
Name: bangbean/BangBean.class
>>
This jar file worked well in BDK's beanbox.
I've test it with JSDK 1.5.0, the same thing happened.
And I didn't encounter such problem in other bean programs.
I've searched " 'Java-Bean: True' missing " with google, but didn't get proper answers.
Is there anybody who can give a prompt about why this happend?
Thanks a lot for your help!
code
//: bangbean:BangBean.java
// A graphical Bean.
package bangbean;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import com.bruceeckel.swing.*;
public class
BangBean extends JPanel implements Serializable {
private int xm, ym;
private int cSize = 20; // Circle size
private String text = "Bang!";
private int fontSize = 48;
private Color tColor = Color.RED;
private ActionListener actionListener;
public BangBean() {
addMouseListener(new ML());
addMouseMotionListener(new MML());
public int getCircleSize() { return cSize; }
public void setCircleSize(int newSize) {
cSize = newSize;
public String getBangText() { return text; }
public void setBangText(String newText) {
text = newText;
public int getFontSize() { return fontSize; }
public void setFontSize(int newSize) {
fontSize = newSize;
public Color getTextColor() { return tColor; }
public void setTextColor(Color newColor) {
tColor = newColor;
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.BLACK);
g.drawOval(xm - cSize/2, ym - cSize/2, cSize, cSize);
// This is a unicast listener, which is
// the simplest form of listener management:
public void addActionListener(ActionListener l)
throws TooManyListenersException {
if(actionListener != null)
throw new TooManyListenersException();
actionListener = l;
public void removeActionListener(ActionListener l) {
actionListener = null;
class ML extends MouseAdapter {
public void mousePressed(MouseEvent e) {
Graphics g = getGraphics();
g.setColor(tColor);
g.setFont(
new Font("TimesRoman", Font.BOLD, fontSize));
int width = g.getFontMetrics().stringWidth(text);
g.drawString(text, (getSize().width - width) /2,
getSize().height/2);
g.dispose();
// Call the listener's method:
if(actionListener != null)
actionListener.actionPerformed(
new ActionEvent(BangBean.this,
ActionEvent.ACTION_PERFORMED, null));
class MML extends MouseMotionAdapter {
public void mouseMoved(MouseEvent e) {
xm = e.getX();
ym = e.getY();
repaint();
public Dimension getPreferredSize() {
return new Dimension(200, 200);
} ///:~
************************************************

Since you didn't use code-formatting tags ([ code ] and [ /code ] without the spaces) it's kinda hard to look at it. But I'm sure it DID execute much more than just the return statement - maybe you're not closing a file or db connection, or maybe you're seeing a cached page, so it actually isn't executing ANYTHING on the server (is your browser set to never check for newer pages so it (almost) always returns from cache, for example?)

Similar Messages

  • ServiceBus java callout - how to pack the JAR file with libraries?

    Hello
    I want to use a Java Callout from a Service Bus flow.
    What is the correct way to pack the JAR file with its nessecary libraries?
    I tried different methods to pack my JAR, but yet, as though the Java runs perfectly from the Workshop (Eclipse) , when I am trying to use the exported Jar on the ServiceBus flow, it fails with an ClassNotFoundException.
    I would really appreciate your advice here.
    Thanks
    Koby

    Well.. Looking inside my exported JAR file, I got all of the files there inside, including the jar file containing the library.
    What I'm trying to do is run a simple java program that connect through SSH and therefore use an SSH library.
    On the workshop I got it as an imported library JAR. And it works perfectly there.
    Any idea?
    Here's the complete error I get:
    <BEA-382515> <Callout to java method "public static java.lang.String sshpackage.SshProg.remoteScriptInvoke(java.lang.String,java.lang.String,java.lang.String,java.lang.String)" resulted in exception: null
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at stages.transform.runtime.JavaCalloutRuntimeStep$1.run(JavaCalloutRuntimeStep.java:158)
    Truncated. see log file for complete stacktrace
    java.lang.NoClassDefFoundError: ch/ethz/ssh2/Connection
    at sshpackage.SshProg.remoteScriptInvoke(SshProg.java:29)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: ch.ethz.ssh2.Connection
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at com.bea.wli.sb.resources.archive.HookedJarClassLoader.loadClass(HookedJarClassLoader.java:251)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    Truncated. see log file for complete stacktrace
    Edited by: kobyssh on 04:12 01/02/2010

  • DI custom SQLs were missing after importing a good ATL file

    The customer had a strange issue recently - lots of custom SQL statements were missing when they imported a good ATL file into a brand new repository. This hasn't happened before. And they are sure that the DI repository versions are the same between the one it was exported and imported. I did some troubleshooting for them and found out:
    1) The custom SQLs are intact when I opened the ATL file in a text editor. And the ATL file can be imported without any issue into other repositories.
    2) Most custom SQLs are missing but not all. Some are imported OK.
    3) When I opened the SQL tranform for those with missing SQLs, the textbox area for the SQL statement was blank. This caused errors in validating the job.
    4) Sometimes the issue was resolved when the developer re-initialized the repository and imported the ATL again. But sometimes this strategy doesn't work - the SQL statements are still missing after the repository has been re-initialized a couple of times.
    The DI version is 11.5.3 on HPUX with repository version 11.5.1.5. The repository database is either Oracle 9i or 10g.
    Thanks,
    Larry

    The issue was resolved. The error occurred because of the database version mismatching. When the job was exported from the dev repository, datastores were excluded. The datastores in dev point to Oracle 9i sources. However, when datastores were recreated in test, some of them point to Oracle 10g sources (same database structure, just version upgrade). Therefore, when the job was exported from the test, although the datastores were still excluded, the version number "10g" were embeded in the SQL transform. This caused the SQL text to be excluded when importing ATL into the dev repository.
    The action taken is to 1) delete datastores with version 10g; 2) create one with version 9i; 3) then exported the job into a new ATL. The new ATL can be imported into the dev repository without any issue.
    Thanks,
    Larry

  • Custom Fault Policy java class is not able to access mediator.jar file

    Hi,
    I am trying to implement the custom java class for mediator fault handling. However when this class is invoked its not able to access the "oracle.tip.mediator.common.error.recovery.MediatorRecoveryContext" class during run time (which exists in mediator.jar). However its able to access all the other imported class files which exists in other library files.
    Do we need to add mediator.jar to the weblogic classpath manually or should we place that jar file in some location in the server ?? Its currently residing in the path -- /app/oracle/product/soastg/11.1.0/SOA/soa/modules/oracle.soa.mediator_11.1.1/mediator.jar. I tried to copy the same jar into domain lib and admin lib path but there was no luck.
    Any input on this will be helpful.
    Thanks,
    Ramesh

    Hi Ramesh,
    Try out the following
    1) Copy mediator.jar from SOA_HOME>/soa/modules/oracle.soa.mediator_11.1.1 to <MW_HOME>//soa/modules/oracle.soa.ext_11.1.1/classes
    2) Goto <MW_HOME>//soa/modules/oracle.soa.ext_11.1.1/classes and run the following command:
    a. jar -xvf mediator.jar
    3) Now remove the jar file, i.e., mediator.jar from classes folder.
    4) Restart the server.
    Regards,
    Srijith

  • Missing com.sap.engine.lib jar file?

    Hi all,
    Please send the com.sap.engine.lib.jar file to me, It's missing in the installation.
    Regards,
    CSP

    Hi Pradeep,
    I think, you can download this from sap service market place.
    Regards
    Kapil

  • Call to java bean but code not being executed.

    Making a call to my javabean class called ch06_03.java from a jsp program shown below:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Using a java package.</title>
    </head>
    <body>
    <% beans.ch06_03 messager = new beans.ch06_03(); %>
    The message is: <%= messager.msg() %>
    </body>
    </html>
    The call from jsp to javabean program is only returning the hello from java and NOT EXECUTING ANY OF THE CODE in the msg() method. I am checking my table landings_hold and nothing is there, my log file shows nothing. Why is the code not being executed except for the return statement?
    My javabean program is shown below:
    package beans;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    import java.sql.*;
    public class ch06_03 {
    StringTokenizer st1;
              String val1, val3, val4, val5, val9, val10, val11, val12, val13, val14, val16;
              String val2, val6, val7, val8, val15, val17, val18, val19, val20;
              int cnt;
              String filetext = "Starting RIFIS Upload";
              java.util.Date d = new java.util.Date();
              SimpleDateFormat form = new SimpleDateFormat("dd/MMM/yyyy hh:mm:ss");
              String dateString = form.format(d);
    public String msg() throws Exception {
         try {
         Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@xxxxx.xxxx.xxx:1521:xx","xxxxxx","xxxx");
              Statement st = conn.createStatement();
         File f = new File("C://upload");
              FileWriter outFile = new FileWriter("C://RIFIS/log/logfile.txt", true);
              outFile.write(System.getProperty("line.separator"));
              outFile.write(filetext+" - "+dateString);
              if (f.isDirectory())
              { String [] s = f.list();
              for (int i=0; i<s.length; i++)
              { outFile.write(System.getProperty("line.separator"));
                   outFile.write("Found file - "+f+"/"+s);
              FileReader file = new FileReader(f+"/"+s[i]);
                   File inputFile = new File(f+"/"+s[i]);
                        File outputFile = new File("C://RIFIS/archive/"+s[i]);
                   BufferedReader buff = new BufferedReader(file);
                   boolean eof = false;
                   String val0="";
                   ResultSet rec = st.executeQuery("SELECT landings_hold_batch_seq.nextval FROM dual");
                        while(rec.next())
                        { val0 = rec.getString(1); }
                        cnt=0;
                        while (!eof)
                        { String line = buff.readLine();
                        if (line == null)
                        { eof = true; }
                             else
                             { cnt = cnt+1;
                                  st1 = new StringTokenizer(line,",");
                                  val1 = st1.nextToken();
                                  val2 = st1.nextToken();
                                  val3 = st1.nextToken();
                                  val4 = st1.nextToken();
                                  val5 = st1.nextToken();
                                  val6 = st1.nextToken();
                                  val7 = st1.nextToken();
                                  val8 = st1.nextToken();
                                  val9 = st1.nextToken();
                                  val10 = st1.nextToken();
                                  val11 = st1.nextToken();
                                  val12 = st1.nextToken();
                                  val13 = st1.nextToken();
                                  val14 = st1.nextToken();
                                  val15 = st1.nextToken();
                                  val16 = st1.nextToken();
                                  val17 = st1.nextToken();
                                  val18 = st1.nextToken();
                                  val19 = st1.nextToken();
                                  val20 = st1.nextToken();
                                  st.executeUpdate("INSERT INTO LANDINGS_HOLD (lh_id, lh_batch, supplier_dr_id, supplier_unique_id, supplier_dealer_id, supplier_cf_id, supplier_vessel_id, unload_year, unload_month, unload_day, state_code, county_code, port_code, itis_code, market, grade, reported_quantity, unit_measure, dollars, lh_loaddt, lh_loadlive, purch_year, purch_month, purch_day)" +
                        "VALUES (0,'"+val0+"','"+val1+"',"+val2+",'"+val3+"','"+val4+"','"+val5+"',"+val6+","+val7+","+val8+",'"+val9+"','"+val10+"','"+val11+"','"+val12+"','"+val13+"','"+val14+"',"+val15+",'"+val16+"',"+val17+",SYSDATE,NULL,"+val18+","+val19+","+val20+")");
                             } // while else end
                        } // parent while end
                        FileReader in = new FileReader(inputFile);
                        FileWriter out = new FileWriter(outputFile);
    int c;
                        while ((c = in.read()) != -1)
                        { out.write((char)c); }
                        in.close();
                        out.close();
                        outFile.write(System.getProperty("line.separator"));
                        outFile.write("Number of records inserted - "+cnt);
                        outFile.write(System.getProperty("line.separator"));
                        outFile.write("Copied upload file to archive directory");
                        outFile.write(System.getProperty("line.separator"));
                        outFile.write(f+"/"+s[i]+" - Has been removed from upload directory");
                        buff.close();
                        inputFile.delete();
                   } // for end
                   outFile.write(System.getProperty("line.separator"));
                   outFile.write("Upload Complete...NO ERRORS");
                   outFile.write(System.getProperty("line.separator"));
                   outFile.write("*************************************************************");
                   outFile.write(System.getProperty("line.separator"));
                   conn.close();
              } // if end
              else
              { outFile.write("No files to process"); }
              outFile.flush();
              outFile.close();
              } // try end.
              catch(Exception e)
              { FileWriter errFile = new FileWriter("C://RIFIS/log/errfile.txt", true);
              errFile.write(System.getProperty("line.separator"));
              errFile.write("ALERT....ALERT....ALERT");
              errFile.write(System.getProperty("line.separator"));
              errFile.write("Error Occurred in ReadSource.java - RIFIS Upload");
              errFile.write(System.getProperty("line.separator"));
              errFile.write("My Error: " + e);
              errFile.write(System.getProperty("line.separator"));
              errFile.write("*************************************************************");
                   errFile.flush();
                   errFile.close();
              } // catch exception end.
         return "Hello from java";
         } //public msg block
         public ch06_03()

    Since you didn't use code-formatting tags ([ code ] and [ /code ] without the spaces) it's kinda hard to look at it. But I'm sure it DID execute much more than just the return statement - maybe you're not closing a file or db connection, or maybe you're seeing a cached page, so it actually isn't executing ANYTHING on the server (is your browser set to never check for newer pages so it (almost) always returns from cache, for example?)

  • Physical adapters go missing after being applied to Logical Switch

    I have an existing VMM 2012 environment that has been working without trouble for quite some time. We're doing a domain migration, so I created a cluster on the new domain and added it to my old VMM environment to make the transfer of guests easier.
    I an having trouble with creating Virtual Switches on the two new hosts in the new cluster. Essentially, I create a new logical switch using the configuration set up for the other existing servers and add two physical adapters to it. It's configured identically
    to my other two clusters. After I apply the changes, the switch is created and the NICs are teamed (verified in nic teaming console) but the physical adapters disappear both from the just-configured switch but also the hardware tab. Trying to connect a VM
    to this results in "not specified" being displayed in the connectivity field (browsing yields nothing).
    I'm hoping I simply missed something since it's been ages since I had to build a new cluster but a side by side comparison seems to indicate the old/new clusters are configured similarly.
    Thanks.
    Tim

    why reinvent the wheel use rman deletion?Will you please clear that how RMAN will identify the applied logs?
    Are you talking about archive deletion policy?
    If this the solution, then this didn't work fine for me (10.2.0.4), you may check this out for 11.1.0.7.
    Regards,
    S.K.
    Edited by: Santosh Kumar on Aug 23, 2009 8:56 PM

  • Config.xml file missing after using pack/unpack (WebLogic 12c)

    Hi,
    When I use the utilities pack/unpack to "copy" a domain from one physical server to another one, I end up with the config directory where there is no config.xml file while on the source physical there is of course this file.
    If I use the scp command (I work under Linux) to "copy" the domain I do not encounter problem and I can start the Node Manager and the WebLogic server.
    Did someone faced this situation?
    How did you solved it? Or, is there something that I am missing?
    Kind Regards.

    Hi all!
    I am having the same problem with WebLogic Workshop 8.1 SP4.
    Any idea?
    Thanks in advance.

  • View, dm_os_volume_stats, missing after Service Pack 2 install

    I installed Service Pack 2 for SQL Server 2008 R2 Standard Edition.  No errors were encountered.  However I expected to find a new view called, dm_os_volume_stats.  I do not see this view.  I have patched 4 instances and none of those
    instances have this view.  Please advise.

    Have you verified the @@VERSION on all these servers? Do you have VIEW SERVER STATE permission?
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • MISSING AIX 5.2 rt.jar file

    I installed JDK/JRE 1.4 on AIX 5.2; however, I can't find file rt.jar. Does this
    file exist for JDK/JRE 14 for AIX 5.2?

    Check if you have sufficient space on file system, than check your limits:
    oracosma@rs11a05c:/pcosma_u01/app/oracle> ulimit -a
    time(seconds) unlimited<br>
    file(blocks) unlimited<br>
    <b>data(kbytes) unlimited</b>
    stack(kbytes) unlimited<br>
    memory(kbytes) 32768<br>
    coredump(blocks) unlimited<br>
    nofiles(descriptors) 2000<br>
    Best Regards
    Krystian Zieja / mob

  • Implementation of java bean

    hi
    every body...i am trying to implement a java bean, i have created the java class and it runs successfuly in jdeveloper envoirnment and after its deployment as jar file i implement it as bean in a bean area in my oracle form and it gives frm-92100
    error!!!!! any help???????
    zulfiqar

    thanks Degrelle for replying my post....
    but i could not get you.....as i have created a bean area on my canvas and it is visible as well and i have given my java class name in its implementation class property. what else it needs. i run that class from jdk and it runs successfully and even the other classes in the same jar file are being implented successfuly but this one is not... any further guidlines.......??
    best regards
    zulfiqar

  • Java beans question

    I am trying to write a simple bean and run it in the beanbox in the bdk1.1
    I have written a jar file (SimpleBean.jar) that contains the files SimpleBean.class and manifest.tmp.
    The manifest is :
    Name: SimpleBean.class
    Java-Bean: True
    When i try to add the jar to the beanbox i get the following error:
    "jar file d:\JavaBean\SimpleBean.jar didn't have any beans!
    Each jar file needs to contain a manifest file describing which entries are beans. You can should provide a suitable manifest when you create the jar."
    Could somone please tell me what i am doing wrong.Thanx

    The manifest file name is MANIFEST.MF (not .tmp).
    Have a look at {your jdk home}/docs/guide/jar/jar.html
    JCG

  • How to use Java Beans in Oracle Forms 11g at 64 bit windows7

    Hello Experts,
                  I am using Oracle forms 11.1.2.2.0 with weblogic 10.3.6 generic at windows 7 64 bit.
    My java version is jdk1.7.0_51.
    Now I have a htmlbutton.jar (which is for bean item in oracle form and this jar file works well for oracle forms 11g 32 bit windows 7 environment).
    I have takken steps:
    1:-Put jar file in home\java folder.
    2:-add this jar file into archive in formsweb.cfg.
    3:-Add this this jar file(which is in my home- java folder) in form_class path in registry.
    Now when I try to locate this jar file in my oracle form.There is no such jar file.what are the steps to use this jar file in oracle forms bean item.
    Please told me what is wrong here.
    thank you
    regards
    aaditya.

    It is unclear where you are having a problem.  Is your issue at runtime (when the form runs in the browser) or when working in the Builder on the form?
    Also be aware that you will need to sign your jar and include some new manifest entries.  Refer to the Java 7u51 documentation and blogs that discuss the changes.
    https://blogs.oracle.com/java-platform-group/entry/new_security_requirements_for_rias
    http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html

  • Top menu bar is missing after upgrading to yosemite

    Top menu bar is missing after upgrading to yosemite

    The Library file  has been hidden for some time now. So not surprised you are confused upgrading from Snow leopard.
    The easiest way to view this folder is to use the Go menu and press the alt key. This exposes the folder in the list.
    Hope this helps.
    PJRS

  • Add jar file to forms application standard java library

    Overall Problem
    I created a jar file using JDeveloper to be loaded as a bean in forms builder. But the jar file ended up being really large because I had to add some standard libraries that JDeveloper knew about but Forms didn't to this jar file, it takes forever to load in my forms application.
    Background
    Jdeveloper has a drop down list of standard libraries that aren't commonly used that a developer can have included/referenced into their java project.
    Oracle Forms Library
    One of the standard libraries in JDeveloper that can be referenced when compiling a project is the Oracle Forms library. I have to reference this library in my compilation of my java project in JDeveloper because some of the java code in this project requires the Oracle Forms library. When the jar file is created in JDeveloper the Oracle Forms Library isn't actuaally physically located anywhere in the jar file that is produced for deployment. But the jar file runs perfectly in my forms application. Forms builder and the forms application server seems to already know about the Oracle Forms library.
    Java Media Framework Library
    There is another standard library listed in JDevelopers drop down list that I recently chose to use in my Java Application, the Java Media Framework library. But my forms application couldn't find any of the Java Media Framework classes when it launched the jar file that was deployed from JDeveloper. Obviously the classes wern't physically located in the jar file I created, because I figured that the forms application server/forms builder would already know about about this standard library that JDeveloper knew about.
    Not very effective Solution
    So I physically put/included the whole Java Media Framework Library into my jar file and then my form launched fine. But it now takes forever to load. How can I add the Java Media Frame work library jar files as one of the standard libraries that the forms builder and application server already sees (Like the Oracle Forms Library) without having to put the library in the forms/java folder and wait for the this jar file to download to the user's cache?
    Side note: The Java Media Framework Library is allowing the ability to launch video from my form. Very useful tool!!! So it would be good if forms had this already added as a standard library like it is in JDeveloper. But I only see the ability to reference this library in DS 10gR2 for JDeveloper.
    Thanks,
    Michelle

    Yes I have successfully been able to run a javabean application that uses the Java Media Framework methods within a forms module. The video seems to play and interact normally in the forms environment (launched from a DS or the AS).
    Basic Requirements
    Develop the java application functionality look and feel, including adding funtionality calls to the JMF library where needed.
    Develop an Oracle Forms Interface wrapper that will be the initial class called from the bean area, to hande any communication between the bean and the form.
    Configure the deployment of the jar to physically include all the needed classes from the JMF library.
    Sign the jar file and make sure it is placed in the forms/java folder and referenced in the appropriate forms configuration files.
    Depending on the type of video that the will be played certain .dll files might need to be added to the users system folder. Using H264 (.mov) should work fine without any extra .dlls.
    Thanks,
    Michelle
    Message was edited by:
    mpoore

Maybe you are looking for