Ejbs in multiple jar files
Question:
Can ejb in one jar file can call another ejb (available in another jar file)? Second ejb is using local interfaces.
Regards,
Viral
Yes, if both ejb-jars are packaged within the same .ear file. A web component can also access the local interface of an ejb if the two modules are packaged within the same .ear file.
--ken
Kenneth Saks
J2EE SDK Team
SUN Microsystems
Similar Messages
-
Including multiple jar files to applet
In one of my application I am using severla third party apis (JavaHelp, JFreeReport, NanoXml ...) which comes as a seperate jar file each.
Is there is a way that I can include these multiple jar files to be downloaded automaticaly when the applet is starting.
currently I am extracting all the jar files and then re compressing them in to one file and place it in the archive property in the applet tab.
Is there a way I can avoid extraction and recompression and directly use the jar files<param nama="archive" value="myjar.jar, myOtherjar.jar" />
You could try to create an installer that wil put the 3rd party jars in the users lib/ext directory. -
How can I access EJB through executable jar file?
Hello buddies!!
I wonder if anyone could give me an explanation of how accessing EJB through executable jar file?Thanks!!Hi there,
You'll need to install the J2EE SDK on the client and include the <j2ee install dir>\lib\j2ee.jar file in your CLASSPATH along with the Client Jar file that was generated by the deploytool when you deployed the application.
In your client code the Context properties are as follows:
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
p.put(Context.PROVIDER_URL, "iiop://hostname:portnumber");
Context cntx = new InitialContext(p).Hope this helps
Amanda
Developer Technical Support
Sun Microsystems
http://www.sun.com/developers -
Multiple jar files from different locations
Hello,
I am having an applet that access code from two different jar files. Of them one is a common jar file for many applets. So I couldn't place it in the local dir as that of the applet's html. I am not using any web server.
Just to give you a feel of it :
<PARAM NAME = archive VALUE = "DVApplet.jar,DVVP.jar" > are the jar files my applet is dependant on. But DVVP.jar has to be accessed from a dir different from local dir.
Will be glad if someone can throw some light on accessing different jar files from different dirs.
Thanks for your time.
Regards,
Anantha[url=
http://forum.java.sun.com/thread.jsp?forum=421&thread=425724&tstart=0&trange=100
]This question is a bit similar
You can use a class loader to do such things. -
Splash screen with progress bar and multiple jar files to load
Hello,
I have been looking to the new features in java 6 for splash screens. I haven't implemented this never before and i was wondering how i could do the following with java 1.5 or 6:
I would like to see a splash screen with a progress bar that "grows" when every jar file has been read.
At this time i call my application like this from a shell script:
exec "$JAVA_BIN" -Djava.library.path=$LIBRARIES_J3D -classpath xxxx.jar yyyy.jar zzzz.jar ...
where xxx.jar, yyy.jar and zzz.jar are very heavy jars.
So i would like to see in the progress bar 33% 66% and 100% when they are loaded.
I do not know if this is the right forum to ask for this. If no, please point me which would be the ideal one.
Any help will be very useful. Thanks to all!Am 10.07.2015 um 07:17 schrieb Lalit Solanki:
> Hi friend,
>
> I am create pure eclipse E4 application and trying to splash screen with progress bar and message.
>
>
>
>
> but above image in only support eclipse E3 application so pleas help me how to add progress bar and message in eclipse E4 application
>
Hi Lalit,
there's a Bug entry: https://bugs.eclipse.org/bugs/show_bug.cgi?id=382224
Meanwhile you can use this solution:
https://www.eclipse.org/forums/index.php/t/328812/5ceed4bcaa683a94d65efb161bffd217/
Regards,
Ralf. -
How to sign multiple jar files using the same certificate..?
hi,
I want to run my application using Java Web Start.. i am using around 16 different jar files out of which around 13 are 3rd party component jars. I want to sign these jars using the same certifcate..., i am using the follwing code to sign the jars:
(for the jar file ischeduler.jar)
keytool -genkey -alias signFiles91 -keystore dtss -keypass dtss1351 -dname "cn=dtss" -storepass decisioncraft
jarsigner -keystore dtss -storepass decisioncraft -keypass dtss1351 -signedjar signedischeduler.jar ischeduler.jar signFiles91
keytool -export -keystore dtss -storepass decisioncraft -alias signFiles91 -file ischeduler.cer
keytool -import -alias DCA2 -file ischeduler.cer -keystore Impischeduler -storepass ischeduler
(for the jar file ischedulerclient.jar)
keytool -genkey -alias signFiles92 -keystore dtss -keypass dtss1351 -dname "cn=dtss" -storepass decisioncraft
jarsigner -keystore dtss -storepass decisioncraft -keypass dtss1351 -signedjar signedischedulerclient.jar ischedulerclient.jar signFiles92
keytool -export -keystore dtss -storepass decisioncraft -alias signFiles92 -file ischeduler.cer
keytool -import -alias DCA3 -file ischeduler.cer -keystore Impischeduler -storepass ischeduler
but when i use the above signed jars in my application i get an error saying:
"jars not signed by the same certificate"
can someone plz tel me wher is the error....thanx
andyWell for mulitple signing of jar files you can use ANT tool. Its easier and faster.
Regarding the present problem -- hmm.. well it looks like you are using 2 different alias names for signing the jar file. Try using the same alias name and that might solve your problem.
regards
Saby -
Problem: Multiple jar files in Class-Path [ IOException: line too long]
Hello Folks,
I am trying to create a jar file using the following command:
jar -cvfm mygrid.jar MANIFEST.MF -C grid-jar/ .
My MANIFEST.MF file is as following:
Manifest-Version: 1.0
Main-Class: com.gridftp.INSPgridFTP
Class-Path: lib/activation.jar lib/ant.jar lib/antlr.jar lib/axis.jar lib/castor-0.9.3.jar lib/cog-abstraction-common-2.0.jar lib/cog-abstraction-examples-2.1.jar lib/cog-certmanagement-1.0.jar lib/cog-certrequest-1.0.jar lib/cog-grapheditor-0.46.jar lib/cog-gridfaces-1.0.jar lib/cog-gridshell-1.0.jar lib/cog-jglobus-1.2-050621.jar lib/cog-karajan-0.31.jar lib/cog-provider-clref-gt3_0_2.jar lib/cog-provider-clref-gt3_2_0.jar lib/cog-provider-clref-gt3_2_1.jar lib/cog-provider-clref-gt4_0_0.jar lib/cog-provider-condor-2.0.jar lib/cog-provider-gt2-2.0.jar lib/cog-provider-gt2ft-1.0.jar lib/cog-provider-gt3_0_2-2.0.jar lib/cog-provider-gt3_2_0-2.0.jar lib/cog-provider-gt3_2_1-2.0.jar lib/cog-provider-gt4_0_0-2.2.jar lib/cog-provider-local-2.0.jar lib/cog-provider-ssh-2.0.jar lib/cog-provider-webdav-1.0.jar lib/cog-resources-1.0.jar lib/cog-setup-0.91.jar lib/cog-util-0.91.jar lib/commons-discovery.jar lib/commons-httpclient.jar lib/commons-logging.jar lib/concurrent.jar lib/cryptix32.jar lib/cryptix-asn1.jar lib/cryptix.jar lib/j2ssh-common-0.2.2.jar lib/j2ssh-core-0.2.2.jar lib/jaas.jar lib/jakarta-regexp-1.2.jar lib/jakarta-slide-webdavlib-2.0.jar lib/jaxrpc.jar lib/jce-jdk13-125.jar lib/jgss.jar lib/jug-1.0.1.jar lib/junit.jar lib/log4j-1.2.8.jar lib/mail.jar lib/puretls.jar lib/saaj.jar lib/wsdl4j.jar lib/xercesImpl.jar lib/xml4j.jar lib/xml-apis-1.1.jar lib/xmlsec.jar lib/xpp3-1.1.3.4d_b4_min.jar lib/xstream-1.1.1-patched.jar .
The grid-jar directory structure is:
| - com -- all classes are under this dir.
| - lib -- all the required jar files are in this dir.
There are 59 jar files in the lib directory. When I try to create the jar file, I get the following exception:
jar -cvfm mygrid.jar MANIFEST.MF -C grid-jar/ .
java.io.IOException: line too long
at java.util.jar.Attributes.read(Attributes.java:356)
at java.util.jar.Manifest.read(Manifest.java:167)
at java.util.jar.Manifest.<init>(Manifest.java:52)
at sun.tools.jar.Main.run(Main.java:124)
at sun.tools.jar.Main.main(Main.java:904)
Any idea, why do I get this exception? Is there any restriction as to how many jar files (or characters) can be there in the Class-Path value in the MANIFEST.MF file?
Please help.
Thanks,
Anause as the following way to resolve the problem:
(1) use separate lines, to avoid too long a line for java package name lists
(2) type a preceding space before each folloing lines, for example:
Class-Path: ...jar ...jar ...jar
...jar ..jar
...jar ...jar
...jar ...jar
Hello Folks,
I am trying to create a jar file using the following
command:
jar -cvfm mygrid.jar MANIFEST.MF -C grid-jar/ .
My MANIFEST.MF file is as following:
Manifest-Version: 1.0
Main-Class: com.gridftp.INSPgridFTP
Class-Path: lib/activation.jar lib/ant.jar
lib/antlr.jar lib/axis.jar lib/castor-0.9.3.jar
lib/cog-abstraction-common-2.0.jar
lib/cog-abstraction-examples-2.1.jar
lib/cog-certmanagement-1.0.jar
lib/cog-certrequest-1.0.jar
lib/cog-grapheditor-0.46.jar
lib/cog-gridfaces-1.0.jar lib/cog-gridshell-1.0.jar
lib/cog-jglobus-1.2-050621.jar
lib/cog-karajan-0.31.jar
lib/cog-provider-clref-gt3_0_2.jar
lib/cog-provider-clref-gt3_2_0.jar
lib/cog-provider-clref-gt3_2_1.jar
lib/cog-provider-clref-gt4_0_0.jar
lib/cog-provider-condor-2.0.jar
lib/cog-provider-gt2-2.0.jar
lib/cog-provider-gt2ft-1.0.jar
lib/cog-provider-gt3_0_2-2.0.jar
lib/cog-provider-gt3_2_0-2.0.jar
lib/cog-provider-gt3_2_1-2.0.jar
lib/cog-provider-gt4_0_0-2.2.jar
lib/cog-provider-local-2.0.jar
lib/cog-provider-ssh-2.0.jar
lib/cog-provider-webdav-1.0.jar
lib/cog-resources-1.0.jar lib/cog-setup-0.91.jar
lib/cog-util-0.91.jar lib/commons-discovery.jar
lib/commons-httpclient.jar lib/commons-logging.jar
lib/concurrent.jar lib/cryptix32.jar
lib/cryptix-asn1.jar lib/cryptix.jar
lib/j2ssh-common-0.2.2.jar lib/j2ssh-core-0.2.2.jar
lib/jaas.jar lib/jakarta-regexp-1.2.jar
lib/jakarta-slide-webdavlib-2.0.jar lib/jaxrpc.jar
lib/jce-jdk13-125.jar lib/jgss.jar lib/jug-1.0.1.jar
lib/junit.jar lib/log4j-1.2.8.jar lib/mail.jar
lib/puretls.jar lib/saaj.jar lib/wsdl4j.jar
lib/xercesImpl.jar lib/xml4j.jar lib/xml-apis-1.1.jar
lib/xmlsec.jar lib/xpp3-1.1.3.4d_b4_min.jar
lib/xstream-1.1.1-patched.jar .
The grid-jar directory structure is:
| - com -- all classes are under this dir.
| - lib -- all the required jar files are in
e in this dir.
There are 59 jar files in the lib directory. When I
try to create the jar file, I get the following
exception:
jar -cvfm mygrid.jar MANIFEST.MF -C grid-jar/ .
java.io.IOException: line too long
at
at
at
at
java.util.jar.Attributes.read(Attributes.java:356)
at
at
at java.util.jar.Manifest.read(Manifest.java:167)
at
at
at java.util.jar.Manifest.<init>(Manifest.java:52)
at sun.tools.jar.Main.run(Main.java:124)
at sun.tools.jar.Main.main(Main.java:904)
Any idea, why do I get this exception? Is there any
restriction as to how many jar files (or characters)
can be there in the Class-Path value in the
MANIFEST.MF file?
Please help.
Thanks,
Anajust -
Hello,
I have an application that I have been asked to take over and finish. This application has several jar files, but I only need to alter code that resides in one of the jar files. How do I recompile my code that is also dependant on the other jar files? Do I need to unjar everything recompile my code and then jar everything back up OR can I just leave the jars that don't need altered as is and recompile the one jar file by itself? Thanks,
KellyThanks for the help, I'm having a bit of difficulty getting the command correct. Let's say I have:
one.jar
two.jar
three.jar
I unjarred one.jar and made some changes to x.java.
I typed in:
javac -cp /path/two.jar /path/three.jar /path/x.java
but it's not working. Thanks in advance! -
JAR file does not get uploaded to client for my SERVLET generated APPLET
Some help please...
I have a servlet that generates the HTML code that contains an APPLET. This APPLET needs a JAR file that is listed under its ARCHIVE property. The SERVLET is in a JAR file that is in the same directory as the other needed JAR file. If I create a static HTML with the output of the SERVLET it works fine. But if go through Weblogic the needed JAR file does not get uploaded to the client so I get a java.lang.NoClassDefFoundError:and my APPLET does not load.
Q1: I am not sure what to put under the CODEBASE tag. I tried "." and I also tried "http://mymachine" but both did not work. I also tried without the CODEBASE tag. No luck. The SERVLET is bound to http://mymachine/servlet.
Q2: Does anyone have any suggestions on how to do this? Is there a way to force the browser to upload a certain JAR file?
Thanks...It works!!
This is what I did:
The jar file in question was the weblogic.jar. I tried putting it under the lib directory of my war file but I had problems because the weblogic.jar contains other war files inside so when I tried to deploy my war file it also tried to deploy the inner war files which for some reason did not work. So I tried removing the war files from the weblogic.jar and this time I had no problems deploying my war file but I still could not find the classes I needed. So I tried moving the weblogic.jar to the root dir of my war file and it worked!! Now the trick here was: I did not set the CODEBASE AND I had the ARCHIVE paramenter set in TWO places like below:
<APPLET CODE = "marketmap.client.MarketMapApplet"
ARCHIVE = "weblogic.jar"
WIDTH = "657"
HEIGHT = "382"
ALIGN = "BOTTOM"
ALT = "APPLET tag not recognized">
</XMP>
<PARAM NAME = CODE VALUE = "MyApplet" >
<PARAM NAME = "type" VALUE="application/x-java-applet;version=1.2.2">
<PARAM NAME = "scriptable" VALUE="false">
<PARAM NAME = ARCHIVE VALUE="weblogic.jar">
</APPLET>
Actually if you do not place a parameter named ARCHIVE (at the end) it wil NOT work. I tried with multiple jar files listed and it works great too.
Anyway I figure I'd share. Thanks for the help too.
Lastly for people who choose not to upload the jar files to clients, you should look at the bea documentation on applets. It lists a classpath servlet that allows you to provide classes to the clients without having to force them to download the jar file. -
two questions:
1) How can I get access to a nested jar file? That is lets say i have a jar file names "Outer.jar", which includes two jar files. These two inner jar files each have a main method. Example: "Inner1.jar" and "Inner2.jar". How can I run each inner jar file? Is this possible?
That is: "Inner1.jar" works perfectly fine by itself, if it was the only jar file, and it has it's own main method. The same goes for "Inner2.jar". But, How can I put these two into a main jar file, "Outer.jar", and then run each of the two inner jar files?
2) Is it possible to make a jar file that contains two jar files both of which have separate main methods?It makes a great deal of sense to nest jar files. For example, I'm trying to put together a standalone JavaHelp "document". Wouldn't it be great if my customer could double click on a jar file and have a JavaHelp view open up with the documents inside? This requires bundling a JavaHelp jar, a viewer jar, and the document jar containing the docs and helpset. The only thing the customer needs in a JRE. No fuss, no muss, no messy installation.
Another situation is where I want to bundle up multiple jar files as one to simplify distribution and deployment.
--jon
I've never heard of anyone wanting to do this before
but:
1. I think the only way to do this will be to use a
custom classloader. You could have a runnable class in
your Outer.jar that launches a custom classloader.
This custom classloader will load your classes and you
can call your runnable classes in Inner1.jar and
Inner2.jar using seperate threads. You need a custom
classloader because if you launch you .jar from (for
example) "D:\myJar\Outer.jar" and specify the
classpath (in the JAR manifest file) to (for example)
"lib/Inner1.jar" it won't look at the JAR file entry
"lib/Inner1.jar" it will look in
"D:\myJar\lib\Inner1.jar". You're going to have
problems though because you're basically running 3
programs in 1 JVM. Things like static variables and
security are going to be an issue. Basically unless
there is a very good reason to do this, it sounds like
a bad idea.
2. Yes. -
CMR between EJBs in different JARs
Hi,
how could I manage CMR between EJBs in different JAR-files (different deplyoment descriptors as well) ?
THX
TimHi Tim, You should post this question to EJB newsgroup not JNDI.
The answer though is you cannot, please see this documentation,
http://edocs.bea.com/wls/docs81/ejb/entity.html#1188656 -
Local references and EJBs in separate jars
Hi
I have trouble in getting local references when the EJBs are built in separate jar files. I am using the <ejb-link> in the <local-ejb-ref>. But I could not get reference to the EJB's local reference.
Please let me know if there is any documentation that tells about getting local references and having the EJBs in separate jar files.
ThanksGreetings,
Hi
I have trouble in getting local references when the
EJBs are built in separate jar files. I am using theThere are a number of reasons why this may be happening and without more specific information it is difficult to say which you are encountering... In any case, the fact that your beans are in separate jars is not, by itself, the issue. It is worth noting, however, that Local references may only be used when both components (referencer and referencee) are co-located within the same VM instance and perhaps this little fact may shed some light on your problem??
<ejb-link> in the <local-ejb-ref>. But I could not get<ejb-link> should point to the actual JNDI binding name, sans root nomenclature (java:comp/env/), but with full sub-context (ejb/myapp/.../MyLocalBean), of the referenced bean.
reference to the EJB's local reference.Perhaps it goes without saying (but just to be sure :)... of course, your referenced bean must actually have Local interfaces associated with it.
Please let me know if there is any documentation
that tells about getting local references and having
the EJBs in separate jar files.Both the J2EE tutorial and the EJB 2.0 spec. have the relevant information. :) However, I've already listed the requirements above: supplied local interfaces, co-located components, and correct link reference.
I hope this helps.
ThanksRegards,
Tony "Vee Schade" Cook -
Using common jars containing EJBs in multiple ears
I was wondering if there was an easy way to have references to jars that is contained in one ear in another ear. The main question is that if we have some EJBs that are commonly used in multiple ears then is there a way to have those common EJBs in a single ear and have the other ears that need these EJBs reference them in some way without having to copy them into those ears? Thanks ahead of time
If you think about it carefully, one .ear file represents one enterprise application. In other words, a .ear file represents a packaged unit that must be deployable by itself.
If one desires to use some reusable business component in one's enterprise application, all dependencies that that component might be having will need to be included in the deployable unit, i.e. the .ear file, for that application.
On similar lines, the following is an extract from the Enterprise JavaBeans specification 1.1 (pay particular attention to the first paragraph therein)...
The ejb-jar file must also contain the class files for all the classes and interfaces that the enterprise bean
class, and the remote and home interfaces depend on. This includes their superclasses and superinter-faces,
and the classes and interfaces used as method parameters, results, and exceptions.
An ejb-jar file does not have to include the class files of the home and remote interfaces of an enterprise
bean that is referenced by an enterprise bean in the ejb-jar, or other classes needed by the referenced
enterprise bean, if the referenced enterprise bean or needed classes are defined in another jar file that is
named in the Class-Path attribute in the Manifest file of the referencing ejb-jar file, or the transitive clo-sure
of such Class-Path references. Note that this Class-Path mechanism only works with JDK 1.2 and
later.
You can extrapolate a similar notion for enterprise archives also.
I guess, the simplest way to put this is, when deploying one application one cannot assume the existence of another application. -
Problem deploying connector: META-INF/ejb-jar.xml not found in jar file
Has anyone seen this problem:
I built Sun's Blackbox implementation and packaged
it identical to the BlackBoxNoTx.rar included with
Weblogic's 'jconnector' sample (even using the same
ra.xml and weblogic-ra.xml). When I try to deploy
it, the server reports:
java.io.FileNotFoundException:
META-INF/ejb-jar.xml not found in jar file
I have no idea why the server thinks my connector
is an EJB. If I deploy the BlackBoxNoTx.rar included
with the sample, everything works without a hitch.
The only variable that I'm changing in my BlackBoxNoTx.rar
is that I build the Blackbox classes myself--otherwise,
the RAR packagings are identical. Any assistance is
greatly appreciated since I'm banging my head against
a wall...
Thanks,
-jason
I was finally able to resolve this one. On the odd chance that someone else encounters
the same problem, here's what went wrong:
My RAR file had two directories: 'META-INF' and 'meta-inf'. The first was created
by the jar tool and contained the manifest.mf file. The second I created manually
and it contained my ra.xml and weblogic-ra.xml. When I examined the RAR using
any tools or I extracted the contents, it looked like it only contained one directory:
META-INF (because NT is case-insensitive).
"Jason L" <[email protected]> wrote:
>
>Has anyone seen this problem:
>
>I built Sun's Blackbox implementation and packaged
>it identical to the BlackBoxNoTx.rar included with
>Weblogic's 'jconnector' sample (even using the same
>ra.xml and weblogic-ra.xml). When I try to deploy
>it, the server reports:
>
>java.io.FileNotFoundException:
>META-INF/ejb-jar.xml not found in jar file
>
>I have no idea why the server thinks my connector
>is an EJB. If I deploy the BlackBoxNoTx.rar included
>with the sample, everything works without a hitch.
>The only variable that I'm changing in my BlackBoxNoTx.rar
>is that I build the Blackbox classes myself--otherwise,
>the RAR packagings are identical. Any assistance is
>greatly appreciated since I'm banging my head against
>a wall...
>
>Thanks,
>
>-jason
-
How to access additional supporting jar files from EJB JAR?
Hi,
How can we access additional supporting jar files as part of my EJB JAR .
I don't want to keep them in the top level because other EJB JAR files also has
the same jar files(code in the classes in the jar is slightly different)
can I keep the additional jar files in my EJB JAR?
Thanks
NLBInclude the supporting jar files in the Ejb jar file.
Specifiy the jar files in the Ejb jar manifest file.
Manifest-Version: 1.0 [CRLF]
Class-Path: utility.jar [CRLF]
thanks,
Deepak
"NLB" <[email protected]> wrote:
>
Hi,
How can we access additional supporting jar files as part of my EJB JAR
I don't want to keep them in the top level because other EJB JAR files
also has
the same jar files(code in the classes in the jar is slightly different)
can I keep the additional jar files in my EJB JAR?
Thanks
NLB
Maybe you are looking for
-
How to automatically open and close collapsable spry panels?
I designed a collapsable spry panel in DW to open and close automatically, with a 10 sec delay, unless person clicks on tab to close immediately. The spry panel opens automatically, but will only close if i click the tab. Is there a way for the colla
-
How to write Sync service in ABAP
Dear Experts, i m very new to ABAP dev, can anybody help me how to write a sync service in ABAP and how to call a function module in to that sync service. My requirement is i want to upload the data from the clint and dow
-
"Pie chart in pivot view showing only the first column's results" in obiee
Hi, In my pivot view(pie chart view+pivottable),i'm getting only the first column's result in pie chart.. I have added a column named *'A*' in rows and '*moneyspent*' in measuresfield and the '*period*' in the columnsfield in the pivot view.I'm calcu
-
OSB question : passing a user defined transport header to a proxy service
Hi All, I have a proxy service that calls another proxy service. The protocol for the "called proxy service" is set to local. The calling proxy service has a "transport header" action to add a user defined header to the outbound request. I log the ou
-
Error when adding an item to HU using FM ADD_TO_EXISTING_HU
Please I need help, could some tell me what I am doing wrong I keep an error when I try to add an item to a HU, here is the code: FUNCTION zrf_hu_add_pack. ""Local Interface: *" IMPORTING *" VALUE(HU_HEADER) LIKE BAPIHUHDRPROPOSAL STRUCTURE *"