Create object for a class in jar file
Hi
I am using Oracle JDeveloper 10g. I have created a main application using Swing/JClient technologies. I am facing a problem for the past one week. I let u all people know my problem and I kindly request you to send a solution if known possibly confirmed.
Problem: I have created a main application using swing that class extends JFrame. This main application consists of two parts. One left side panel and one right side panel. Left side panel contains JTree component. Each item in that tree refers to a class file located in a separate jar file.i.e that acts as a separate application. If we are executing separately that jar file class, I am able to see that small application running. If I am selecting an item in JTree during runtime, I should place that small application from the respective jar file in the right side panel of the main application. I can locate the jar file and even I can create object to that particular class file. But I cannot execute the application even separately and also not able to place in the right side panel of the main application.
Note: The small application from the jar file contains one class file containing main method. That class file extends JPanel and implements JUPanel. i.e., with data binding. I am trying to create an object for this class file with data binding from my main application. Navigation bar is used in the main class file.
If possible can any provide me solution at the earliest. Waiting eagerly for the positive reply.
Regards,
s.senthilkumar
Can you sure that there is only a A class in the classpath of Tomcat, I advise you to add
some statements into the A class so that you can be sure which classloader is used
to load the A class.
Similar Messages
-
POWL- Create object for feeder class not found
Hi,
I have developed a Webdynpro application and tried to integrate to POWL, but the application dumps saying cretae object of feeder class is not found.
I am new to POWL, can anybody help me in this regard.
Thanks,
Shailaja Ainala.- in se80 you need this kind of code
AUTHORITY-CHECK OBJECT 'Z:CPRO_RAP'
ID 'ZZ_MARKDIV_test' FIELD record-string+0(3)
ID 'ACTVT' FIELD '02'. "change access
IF sy-subrc <> 0.
AUTHORITY-CHECK OBJECT 'Z:CPRO_RAP'
ID 'ZZ_MARKDIV_test' FIELD record-string+0(3)
ID 'ACTVT' FIELD '03'. "read only access
IF sy-subrc = 0.
is_allowed = abap_true.
ENDIF.
ELSE.
is_allowed = abap_true.
ENDIF.
security team should setup the POWL
http://help.sap.com/saphelp_erp60_sp/helpdata/en/44/36ca0563df660ee10000000a1553f6/content.htm
http://help.sap.com/saphelp_erp60_sp/helpdata/en/42/d6652b755c1630e10000000a1553f7/content.htm
so if you see the code above there is a ID and filed associated with each object. -
TestStand create different object for singleton class
Hi all,
we have a singleton class which has some functions used to do testing a harware.
Our main Exe will create an object for that singleton class(which opens Com1 port and communicate with hardware). so the Exe will do basic communication test with hardware it is working well. We are using Teststand operator interface to do various testing by using sequence files. Main exe will use teststand usercontrols to execute tests when the user clicks Testbutton. after that, teststand try to create an object for that singleton but it returns new object not the existing one which is created by EXE. So it throwing me exeception "Com1 port access denied." (since we created object for signleton class @ very first in EXE)
My question is Since that teststand runs in a separate Appdoamin will the singltonclass create separate object for different appdomain? if so is there any solution to reslove this?
Hope i clearly explained my probs.
Thanks in advance
SriniHi Srini,
How are you calling the executable? From a Call Executable step? Or are you using another means of calling it? Also, why is TestStand trying to recreate the object? As long as you have the correct handle to the object I don't think it matters what app domain you are in.
Regards,
jigg
CTA, CLA
teststandhelp.com
~Will work for kudos and/or BBQ~ -
How to create object by getting class name as input
hi
i need to create object for the existing classes by getting class name as input from the user at run time.
how can i do it.
for exapmle ExpnEvaluation is a class, i will get this class name as input and store it in a string
String classname = "ExpnEvaluation";
now how can i create object for the class ExpnEvaluation by using the string classname in which the class name is storted
Thanks in advancei think we have to cast it, can u help me how to cast
the obj to the classname that i get as inputThat's exactly the point why you shouldn't be doing this. You can't have a dynamic cast at compile time already. It doesn't make sense. Which is also the reason why class.forName().newInstance() is a very nice but also often very useless tool, unless the classes loaded all share a mutual interface. -
Maximum no'of Objects for one class
Hello friends
Please, tell me....Maximum no'of Obects for One Java class.
Thanks & Regards
S.RajakrishnaIs there any limit of creating the objects for One class?Instantiated objects go into the heap. There is only one heap for the whole JVM. There is no correlation between objects in the heap and the individual class files.
100,000 objects may or may not fit into the heap. In general they probably will. If you don't, then yes, you'll get an Out Of Memory exception.
Regardless there is no excuse for loading 100,000 objects just to render a JSP! You don't imagine your user is going read all of them do you? Restrict them to the number of objects that the user is actually going to be able to handle at any given time.
You can do this by putting WHERE clauses on the hibernate query, and/or by setting limits (setFirstResult and setMaxResult) on the Query object before listing it. -
Can I increase heap memory without specify any class or jar file??
Hi,
I tried to increase my heap memory in this way :
java -Xms256m -Xmx256m
but I got an error ... it's seem that I must specify a class java or a .jar file ...
This is the error :
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
can I increase heap memory without specify any class or jar file??
thxchiara wrote:
Hi,
I tried to increase my heap memory in this way :
java -Xms256m -Xmx256m
but I got an error ... it's seem that I must specify a class java or a .jar file ...
This is the error :
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
can I increase heap memory without specify any class or jar file??The job of java.exe is to execute java bytecode.
What is it supposed to do with your request to use 256m of memory for heap
when you are not giving it a class or a jar to run? -
Where to put common classes and jar files
hi,
i want to put some classes and jar files in a common folder so that it can be accessed by other applications is there any way doing that.In tomcat server they have common and shared directories once any classes are into that folder they are being accessed easily ,but i am having problems with sun one .
Regards
Ameem SamiDid you find a solution for this? I'm having the same problem.
Thanks,
Tony -
Create Object of "ObjectName" Class by giving only Domain Name.
Hie,
I want to create Object of "ObjectName" class without specifying its key value properties, but i want to only specify the domain name.
For eg:
ObjectName on=new ObjectName("jboss.ws4ee:*"); here jboss.ws4ee is the domain name and after colon(:) will come the key value properties.. i dont want to specify that because i want the list of all mbeans coming under this domain i.e. jboss.ws4ee
So anyone can plzzz help me..
Regards.Hi,
What were you trying to do with that name?
ObjectName on=new ObjectName("jboss.ws4ee:*");
You cannot create an MBean with such an ObjectName. You can only
use it as first argument to queryNames() and queryMBeans();
If you want to get the attributes of all jboss MBeans then you will need to
do something like that:
final ObjectName pattern=new ObjectName("jboss.ws4ee:*");
for (ObjectName o : server.queryNames(pattern,null)) {
System.out.println("MBean: " + o);
for (MBeanAttributeInfo info : server.getMBeanInfo(o).getAttributes()) {
final String attrname = info.getName();
System.out.println("\t"+attrname+"="+server.getAttribute(o,attrname));
}(disclaimer: this code was eyed-compiled)
hope this helps,
-- daniel
JMX, SNMP, Java, etc...
http://blogs.sun.com/jmxetc -
HI, I'm having problems initializi​ng object for CNiFgen class.
Hello, I'm having problems initializing object for CNiFgen class, I declare a pointer *m_pFgen to the CNiFgen class, then m_pFgen = new CNiFgen(m_driver, true, true) and then it gives me an error message Primary Error: (Hex 0xBFFA000C) Invalid attribute.
Here is how to make a call to initialize a session to niFgen:
//Create a new session on the device
_session = new CNiFgen(m_resourcename);
Also. I'm attaching an example on how to generate standard waveforms with the class interface for Fgen.
Let me know if you have any other questions,
Jack Arnold
Applcation Engineer
National Instruments
Attachments:
niFgen_Function_Generator_Ex.zip 5569 KB -
Ojvmtc reports xy.jar is not a class or jar file
Hi
I am a little bit confuced because ojvmtc reports an error I can not imagine about:
oracle@cikic-desktop:~/Downloads/dom4j-1.6.1$ ojvmtc /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar
/u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar is not a class or jar file
The set is closed
But jce.jar is a jar file and I can inflate it:
oracle@cikic-desktop:/tmp/fo$ jar -xf /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar
oracle@cikic-desktop:/tmp/fo$ ls -l
total 8
drwxr-xr-x 3 oracle oinstall 4096 2010-05-03 19:40 javax
drwxr-xr-x 2 oracle oinstall 4096 2010-05-03 19:40 META-INF
And if I do a ojvm on a class file everything is working like expected:
oracle@cikic-desktop:/tmp/fo$ ojvmtc javax/crypto/Mac.class
The set is not closed
96 classes are missing
So It must be a configuration mistake somewhere ...
Can you please help me out.
Thanks
Christian MaierCoole thanks, this works pretty well!
Chris
oracle@cikic-desktop:~$ cp /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar /tmp/
oracle@cikic-desktop:~$ ojvmtc /tmp/jce.jar
The set is not closed
131 classes are missing -
Location for JCE jurisdiction policy JAR files
I have a simple question is the location for JCE jurisdiction policy JAR files (local_policy.jar and US_export_policy.jar) in
<java-home>/lib/security or
<java-home>/lib/security/jce
I am using JDK 1.6.0_14, these jar files come in a seperate package jce_policy-6.zip
Please let me know.
Thanks
_PeteThanks for the replies.
README says just place them under lib/security. But it doesn't say whether to use the path embedded in the zip file (ie:/jce). So that was causing the confusion.
I think it should lib/security and NOT to use jce. If anyone else have more thoughts on it, please let me know.
_Pete -
I am mac user and want to create Object in VBA macro. when i write "set objwrd=createObject("Word.Application")"… it returns "runtime error "492" can't create object". now what it alternative to create object for word in excel macro???
Any help here...
http://support.microsoft.com/kb/288117
http://www.macworld.com/article/1154785/welcomebackvisualbasic.html -
Create Object for .rep in C#
How to create object for the BO Desktop Intelligence .rep in C#
[Read Before Posting - Where to find Business Objects .NET SDK Resources|Read Before Posting - Where to find Business Objects .NET SDK Resources;
Depending on what you are trying to do you may be able to do it using .NET:
[Samples|http://wiki.sdn.sap.com/wiki/display/BOBJ/NETReportEngineSDKSamples]
or you may have to still use COM:
[Desktop Intelligence Developer Guide|http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_deski_sdk_dg_en.pdf]
[Desktop Intelligence API Reference|http://help.sap.com/businessobject/product_guides/boexir31/en/deskisdk_com_apiref_12_en.zip] -
OC4J: Class not found for class in jar file placed in \j2ee\home\applib\
I have an ADF application which uses external libraries (jars), which works fine when running the application from within JDeveloper (TP4).
However if I deploy the application to the embedded OC4J server it won't find any classes imported in those external libraries at runtime (deploy does work). E.g. one library class imports oracle.jbo.server.DBTransaction. If a method of this class is called I get the following exception:
Unexpected exception caught: java.lang.NoClassDefFoundError, msg=oracle/classloader/util/AnnotatedNoClassDefFoundError
oracle/classloader/util/AnnotatedNoClassDefFoundErrorThe same exception, when using a german locale, explicitely states that it cannot find oracle.jbo.server.DBTransaction.
The jar files are placed in the \j2ee\home\applib\ directory and a <library> element to this path is present in application.xml.
Any further hints what could be wrong?Hi Edwin,
tried your suggestions but without success.
when I add this library to server.xml then following error occures when starting OC4J
17.09.2008 17:10:33 oracle.oc4j.util.SystemLog log
SCHWERWIEGEND: Server start failed processing configuration
java.lang.InstantiationException: Illegal tag, 'library': The library tag has moved from config/server.xml to config/application.xml, please update your configuration manually or reinstall.
at com.evermind.server.XMLApplicationServerConfig.parseDeploymentMainNode(XMLApplicationServerConfig.java:1227)
at com.evermind.xml.XMLConfig.parseRootNode(XMLConfig.java:342)
at com.evermind.xml.XMLConfig.init(XMLConfig.java:222)
at com.evermind.xml.XMLConfig.init(XMLConfig.java:154)
at com.evermind.server.XMLApplicationServerConfig.<init>(XMLApplicationServerConfig.java:237)
at com.evermind.server.ApplicationServer.createConfig(ApplicationServer.java:661)
at oracle.oc4j.server.ServerFactory$Worker.prepareConfig(ApplicationServerFactory.java:225)
at oracle.oc4j.server.ServerFactory$Worker.start(ApplicationServerFactory.java:244)
at oracle.oc4j.server.ServerFactory$Worker.run(ApplicationServerFactory.java:259)
at java.lang.Thread.run(Thread.java:619)
17.09.2008 17:10:33 oracle.oc4j.util.SystemLog logNoStack
SCHWERWIEGEND: Server exiting: ApplicationServer entered state EXITING--> I added this to application.xml
Than I enabled more logging of classloader "-Duser.country=US -Dclass.load.log.level=finest"
Here a snippet of the output at starttime of OC4J:
================================
08/09/18 10:17:07 Initial class loaders created. Uptime: 3156ms.
08/09/18 10:17:07 Loading main class com.evermind.server.OC4JServer...
08/09/18 10:17:07 com.evermind.server.OC4JServerMain class loaded. Uptime: 3344ms.
08/09/18 10:17:07 Transferring to com.evermind.server.OC4JServer.main()...
08/09/18 10:17:15 Ignoring non-existent code source: D:\oracle\jdevstudio1111_preview4_standalone\j2ee\home\config\..\..\..\BC4J\lib\jmxdc.jar(from <code-source> (ignore manifest Class-Path) in /D:/oracle/jdevstudio1111_preview4_standalone/j2ee/home/config/server.xml)
08/09/18 10:17:15 Ignoring <code-source> (ignore manifest Class-Path) in /D:/oracle/jdevstudio1111_preview4_standalone/j2ee/home/config/server.xml entry: code-source /D:/oracle/jdevstudio1111_preview4_standalone/j2ee/home/lib/api-ext/adflogginghandler.jar (from system property api.ext.dirs) is already visible in the search path of adf.oracle.domain:11.1.4949.
08/09/18 10:17:15 Ignoring non-existent code source: D:\oracle\jdevstudio1111_preview4_standalone\j2ee\home\config\..\..\..\BC4J\lib\jmxdc.jar(from <code-source> (ignore manifest Class-Path) in /D:/oracle/jdevstudio1111_preview4_standalone/j2ee/home/config/server.xml)
08/09/18 10:17:15 Import was not resolved for adf.oracle.domain:11.1.4949: shared library "oracle.fabric.runtime" could not be found.
08/09/18 10:17:15 Import was not resolved for adf.generic.domain:11.1.4949: shared library "oracle.fabric.runtime" could not be found.Seems that oracle.fabric.runtime couldn't be found but the jar's are located in D:\oracle\jdevstudio1111_preview4_standalone\lib\java\shared\oracle.fabric.runtime\11.1.1.0.0
It's the same as with my jdeveloper installation where I don't have this problems.
regards
Peter -
Allow to create, only two objects for a class
Hi,
This question is asked in my interview. In singleton concept only one object is created, likewise only two objects are created for a class.
For that i have write a code like this,
public class OnlyTwoObjects {
private static OnlyTwoObjects a1;
private static OnlyTwoObjects a2;
public static int n = 0;
public static OnlyTwoObjects getInstance() {
if (a1 == null) {
a1 = new OnlyTwoObjects();
return a1;
} else if (a2 == null) {
a2 = new OnlyTwoObjects();
return a2;
} else if (n == 1) {
return a1;
} else if (n == 2) {
return a2;
return null;
} But they told this is not good way to do this.
I don't know how to do this, if any body knows kindly let me know.vijay wrote:
But i will explain my code, in that code we are allowed to create only two objects, Maximum. Understood.
suppose both objects are created, then i will ask which object you need first or second, this is decided using the variable n if it is 1 then it will return the first object and it is 2 it will return the second object. sorry i didn't explain this in my previous post.This is your approach. Is this the requirement as well? Is it necessary that the user decide on which instance (first or second) is returned?Even if it was the requirement that the user decides which instance (first or second) is returned, with the original proposed implementation, the user only gets to decide which instance after calling getInstance() twice. If he calls getInstance() with n=2 when a1 is still null, he still gets a1. If he calls getInstance with n=1 when a2 is still null but a1 is non-null, then he gets a2. As is, he always gets a1 on the first call, a2 on the second call, and after that gets null unless he has set n to 1 or 2. (This explanation ignores any multi-threading issues that may come into play. This explanation is for a single thread.)
Maybe you are looking for
-
Dynamic creation of tables and data insertion in BODS
Specific requirement : We need to extract multiple tables from ERP system and stage them in BODS SQL server database. As the need is for lot of tables , we want to come up with a generic Job which can be used for all the tables which have different s
-
Filters Section is not visible in Mobile App???
I added few filters in my report in Power BI Preview Web but its not visible in Mobile App. Anybody has any idea?? Atul,
-
Problème acquisition sur PCI 6032E
Bonjour, je suis actuellement en stage de fin d'étude et il m'ai demandé de réaliser l'aquisition d'un thermocouple. Nous pouvons utiliser qu'une carte PCI 6032E directement et le logiciel labview. Nous avons beaucoup de perturbation et nous ne compr
-
Hi , I am printing a Custom Adobe Form(ZPTRV_EXPENSE_FORM), which is a copy of standard form(PTRV_EXPENSE_FORM), through PR05. The problem here is in the subform for additional trip information, where the comments entered by the user are getting disp
-
I just downloaded the latest version of iTunes. As usual with iTunes, there is another service that starts with the program. This one is for the iPhone. Now, as I do not have an iPhone, nor is one in the immediate future, there is no reason for this