Using JMX to read ejb manifest jar and ejb-jar.xml in ejb jar inside ear

Hello,
I have an ear deployed on weblogic console. I need to check contents of manifest file and ejb-jar.xml of a jar that is present in the deployed ear.
Currently I am using below code to access jar inside ear deployed :
Hashtable env = new Hashtable(5);
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL,
url);
env.put(Context.SECURITY_PRINCIPAL, user);
env.put(Context.SECURITY_CREDENTIALS, password);
Context ctx = new InitialContext(env);
mBeanHome = (MBeanHome)ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
String type = "EJBComponentRuntime";
Set beans = mBeanHome.getMBeansByType(type);
try{
for(Iterator it=beans.iterator();it.hasNext();)
EJBComponentRuntimeMBean rt = (EJBComponentRuntimeMBean)it.next();
if(rt.getParent().getName().equals("xxx")){
System.out.println(rt.getName());
l.add(rt.getName());
Here xxx is the ear. Now I need to get inside the jar (represented) by variable rt and access its manifest file,ejb-jar.xml
Does anyone have an idea how to do this?
regards
Sameer

Isn't it possible to put them there manually? :)

Similar Messages

  • Using servlets to read from text file and insert data

    Hi,
    Can I use a servlet to read from a space delimited text file on the client computer and use that data to insert into a table in my database? I want to make it easy for my users to upload their data without having to have them use SQL*Loader. If so can someone give me a hint as how to get started? I appreciate it.
    Thanks,
    Colby

    Create a page for the user to upload the file to your webserver and send a message (containing the file location) to a server app that will open the file, parse it, and insert it into your database. Make sure you secure the page.
    or
    Have the user paste the file into a simple web form that submits to a servlet that parses the data and inserts it into your db.

  • EJB 3.0 and  creating bean .xml files for DataControl

    In entity beans I haven't parameter updateble in source for column witch represent Id. I generate Id with TableGenerator strategy.
    @TableGenerator(name="TEST_SEQ", initialValue=1, allocationSize=1)
    @Column(nullable = false)
    @GeneratedValue(strategy=GenerationType.TABLE,generator="TEST_SEQ")
    @Id
    private Long id;When I create DataControl why some <entity bean>.xml files have IsUpdateable="0" parameter for attribute witch represent Id (primary key) column in entity bean?
    <Attribute Name="id" Type="java.lang.Long" IsUpdateable="0"/>In some files this parameter have default value (true), that is it does not show in source!
    If I use datacontrol (method findAll for example) with selectOneChoiche component error is:
    The selected target attribute has read-only access.Please select an updatable attributeWhen I modify files and after that refresh or create new DataControl I loss my changes in files.

    Hi Ric,
    This is the test case which describe my problem.
    Test entity:
    @Entity()
    @Table(name="TEST")
    @NamedQueries({
        @NamedQuery(name = "Test.findAll", query = "select o from Test o"),
        @NamedQuery(name = "Test.findById ", query = "select o from Testo where o.id = :id")
    public class Test extends BaseTest implements Serializable {
        @Id
        @TableGenerator(name="TEST_SEQ", initialValue=1, allocationSize=1)
        @Column(name = "ID", nullable = false)
        @GeneratedValue(strategy=GenerationType.TABLE,generator="TEST_SEQ")
        private Long id;
        private String test;
    public String getTest() {
    return test;
    public String setTest(String param) {
    this.test=param;
        public Long getId() {
            return id;
        private void setId(Long id) {
            this.id = id;
       }Base entity:
    @MappedSuperclass
    public abstract class BaseTest implements Serializable {
        @Column(name = "LASTCHANGE")
        private Timestamp lastChange;
        public MasterEntity() {
        public void setLastChange(Timestamp param) {
          this.lastChange = param;
        public Timestamp getLastChange() {
            return lastChange;
    }Main entity:
    @Entity()
    @Table(name="MAIN")
    @NamedQueries({
        @NamedQuery(name = "Test.findAll", query = "select o from Test o"),
        @NamedQuery(name = "Test.findById", query = "select o from Test o where o.id = :id")
    public class Main extends BaseTest implements Serializable {
        @Id
        @TableGenerator(name="MAIN_SEQ", initialValue=1, allocationSize=1)
        @Column(name = "ID", nullable = false)
        @GeneratedValue(strategy=GenerationType.TABLE,generator="MAIN_SEQ")
        private Long id;
        @ManyToOne
        @JoinColumn(name = "IDTEST", referencedColumnName="ID")
        private Test test;
        public Long getId() {
            return id;
        private void setId(Long id) {
            this.id = id;
        public Long getTest() {
            return test;
        private void setTest(Test test) {
            this.test = test;
       }The part code of session bean:
    public Main findById(Long id){
    return em.find(Main.class, id);
    }When I create DataControl from this sessionBean, the Test.xml(ENTITY->Test) file is generated.
    Test.xml:
    <?xml version="1.0" encoding="UTF-8" ?>
    <JavaBean xmlns=" http://xmlns.oracle.com/adfm/beanmodel" version="11.1.1.45.24"
              id="Test" Package="package.test"
              BeanClass="package.test.Test"
              isJavaBased="true">
      <Attribute Name="id" IsUpdateable="0" Type="java.lang.Long"/>
      <ConstructorMethod IsCollection="false" Type="void"
                         id="Test"/>
    </JavaBean>Questions:
    Why attribute "id" have property isUpdatable="0" ?
    I didn't specify "update=false" on my entity 'Test' for that column.
    In witch case propery isUpdateble have value "0", "1", "2", "true", "false"?

  • Difference in File Adapter Read File as attachment and Use File streaming

    Hi all,
    As part of our POC we created a File adapter using the option Read file as attachment and File streaming we observed below things
    1.When we are taking “Attachment” option in file adapter, Its able to archive, but not supporting to write data to different location(using fileadapter’s write operation.)
    2.when WE are taking “ file streaming “ option in the adapter , Its not able to achive, but it writes data to different location(using fileadapter’s write operation.)
    Can anyone know is this is a correct behaviour . If yes what is the reason .
    Thanks
    Phani

    Hi all,
    As part of our POC we created a File adapter using the option Read file as attachment and File streaming we observed below things
    1.When we are taking “Attachment” option in file adapter, Its able to archive, but not supporting to write data to different location(using fileadapter’s write operation.)
    2.when WE are taking “ file streaming “ option in the adapter , Its not able to achive, but it writes data to different location(using fileadapter’s write operation.)
    Can anyone know is this is a correct behaviour . If yes what is the reason .
    Thanks
    Phani

  • Use labview to read an Excel file to some control and add a checkbox for each row

      As the subject say,I need to use labview to read an excel file,and show it in some control,such as mclb;then ,I should add an checkbox for each row,enable me to choose the row i want.What should I do ? Many Thanks.
    Solved!
    Go to Solution.

    Hi,
    to answer your question:
    - read an excel file
    - show it in some control, such as a MCLB
    - add an checkbox for each row
    - choose the row you want
    Hint to make it easier: I wouldn't use checkboxes, as the MCLB already allows to select rows by mouseclick…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Load Jar and access a class in jar at run time

    I need help from you.
    How to load a Jar and access a class in the jar at run time?
    When i try the following code it works fine while running in Java (Jdk1.5).If iam running the same code in servlet,ClassCastException occurs.
    Error Message : ClassCastExcption : jartest1 cannot be cast to Thing
    test.jar contains jartest.class and Thing.class
    jartest1.java
    try{
    File file =new File("test.jar");
    String lcStr ="jartest";
    URL jfile = new URL("jar", "", "file:" + file.getAbsolutePath() +"!/");
    URLClassLoader cl = URLClassLoader.newInstance(new URL[] { jfile });
    Class loadedClass = cl.loadClass(lcStr);
    Thing t=(Thing)loadedClass.newInstance();
    t.execute();
    catch(Exception e)
    System.err.println(e);
    Thing.java
    public interface Thing
    void execute();
    jartest.java
    public class jartest implements Thing
    public void exceute()
    System.out.println("Welcome");
    Thanks and Regards
    V.Senthil Kumar
    Edited by: senthilv_sun on Dec 16, 2008 8:30 PM

    senthilv_sun wrote:
    I need help from you.
    How to load a Jar and access a class in the jar at run time?
    When i try the following code it works fine while running in Java (Jdk1.5).If iam running the same code in servlet,ClassCastException occurs.
    Error Message : ClassCastExcption : jartest1 cannot be cast to ThingPresumably we can only hope that that is a transciption error. It always helps to use copy and past actual errors and code rather than manually typing them.
    test.jar contains jartest.class and Thing.classWrong.
    The interface class and plugable class must not be in the same jar.
    A plugable interface requires two components
    - Interface (generic sense)
    - Functional components.
    The Interface must be independant (own jar) so that it is available to the framework (user of plugin) and to the functional components. And the plugable component must not be on the java class path.
    This also means that we know for certain that the plugable component is also on the system class path. That is a bad idea as well.
    Given that it is pretty pointless to even speculate as to why this error is showing up. Create the correct jar layout. Test using the command line. Then test using servlets. Insure that the plugable jar is NOT on the java classpath for both tests.

  • Can i fix this adobe reader keeps crashing over and over

    im on facebook and it frezzes up then says adobe has crashed

    Check for updates to your plug-ins:
    <br /><br />
    https://www.mozilla.org/en-US/plugincheck/
    Please see the help article [[Using the Adobe Reader plugin with Firefox]], and if it doesn't resolve you problem report back here with the steps you took.

  • What is the differences between Ant build jar and eclipse export jar ?

    I have tried the eclipse export method to generate a jar file, however, it doesn't work with my server. But when I write a ant build file to create jar file. It works!!
    Does any buddies know why?

    Difference betwen JAR AND WAR
    .jar files: These files are with the .jar extension. The .jar files contain the libraries, resources and accessories files like property files.
    .war files: These files are with the .war extension. The war file contains the web application that can be deployed on the any servlet/jsp container. The .war file contains jsp, html, javascript and other files for necessary for the development of web applications.
    Source:
    http://forum.java.sun.com/thread.jspa?threadID=485823&messageID=2273976
    The main difference between a JAR and a WAR is that a JAR is not really a single purpose format, while a WAR is. With a JAR file, you can package lots of different things. Usually you package up Java classes, but you could put pretty much anything into a JAR file, and you can create JARs that have whatever files and directory formats you want. For instance, Oracle (at least in 8.1.x) actually uses JAR files to distribute the Oracle software on the install CDs, and IBM uses them to distribute an installable version of the documentation for WebSphere. Technically you can put JSP pages, HTML pages, servlet classes, etc. in a JAR, but you generally don't -- you use a WAR.
    WAR files are JAR files with a specific format. This format is defined in the servlet spec (which you can look at on the java.sun.com site). Essentially, the WAR file is a standard format for web applications that has specific directories and specific files. This includes a WEB-INF directory, a WEB-INF/web.xml file used to describe the application, a WEB-INF/lib directory for JAR files used by the application, and a WEB-INF/classes directory for class files that aren't distributed in a JAR. You would put the pages (JSPs and HTML) in the WAR as well. Then, you can distribute your application as one file, instead of as a collection of images, HTML pages, and Java classes.
    Source:
    http://www.theserverside.com/discussions/thread.tss?thread_id=10905
    Message was edited by:
    lochdsmile

  • Reading manifest.mf attributes using JMX

    Hi,
    Could you pls let us know if there is any JMX MBean that provides an API to read the manifest.mf file attributes of an EAR?
    We are fine with using weblogic JMX if not available under standard JMX API. I need to read a set of attributes like Classpath, version etc which are present in the
    EAR file deployed in a WL domain ?
    Thanks

    Eclipse does not read manifest classpath entries. You can workaround this problem by setting api.jar and wls-api.jar in your build path. These jars contain all the public api classes that WLS exposes.

  • Deploying EJB JAR and Application EAR, META-INF directory name

    To all:
    I had a problem the last couple of days with deploying an EJB and application.
    I'm new to WebLogic, maybe this is common knowledge, but I researched it and
    didn't find any reference to what I discovered.
    I'm using WebLogic Server 7 Service Pack 2 (7.02), on Windows 2000.
    My problem was that the application that I was trying to deploy would not deploy
    successfully, because a dependent class was not found for the EJB. I tried everything,
    but the only thing I could get to work was placing the dependent jar files in
    the classpath of the WebLogic server, within the start script. I correctly had
    the Class-Path manifest line correct, but the dependent classes were not being
    found.
    Through trial and error I discovered that the META-INF directory within the JAR
    and EAR archives HAS TO BE ALL UPPERCASE for the app server to successfully find
    the manifest.mf file and the application.xml file.
    As soon as I changed the directory name in both the EJB JAR file and the application
    EAR file, the EJB deployed successfully, all dependent classes were then found.
    I'm posting this here to help anybody that might have the same problem. There
    is not any documentation that I could find that had this directory name requirement
    explicitly stated.
    Regards,
    JD

    What does the manual for the OC4J application server have to say about it all?

  • How to use client.jar generated by deploytool for a EJB web service

    Hello!
    Could anyone help me?
    I use Sun Application Server to deploy my EJB module and expose it as a web service. Then I open deploytool tree and select localhost under Server branch. In the right panel it shows a list of web services deployed. I chose recently deployed service and press "Client Jar..." button to get generated client stubs.
    Good.
    Could anyone tell me how I should use this jar file? It does not contain ..._Service_Impl.class that is usually used to get service port and call service methods.
    Please, explain me.
    Thank you much

    try
    jar tf Client.jar and look at what is inside.
    Usually you run the client to connect to the server -- (java -classpath blah pack.age.name.Client)
    Dont know how its being done over there.

  • Signing jar and appending to the original manifest

    I create my jars with a manifest file with some entries
    like Specifiaction and implementation versions
    however when I sign them the manifest is replaced and I lose my manifest entries
    Am I doing something wrong is that what is supposed to happen?
    If that is normal what do I do to keep my original manifest entries
    Thanks

    I could not reproduce with jdk 1.5.0_04, did not use a package though.
    here is the java class:
    import java.applet.*;
    public class test extends Applet {
         public void start() {
              System.out.println("this is start");
         public void init(){
              System.out.println("this is init");
    }The manifest:
    Manifest-Version: 1.0
    Created-By: 1.5.0_04 (Sun Microsystems Inc.)
    Specification-Title: The title
    Specification-Version: 1.2
    Specification-Vendor: the vendor
    Implementation-Title: java.util
    Implementation-Version: build57
    Implementation-Vendor: the vendor
    The batchfiile creating the signed jar:
    del *.cer
    del *.com
    del *.jar
    del *.class
    javac test.java
    keytool -genkey -keystore harm.com -keyalg rsa -dname "CN=Harm Meijer, OU=Technology, O=org, L=Amsterdam, ST=, C=NL" -alias harm -validity 3600 -keypass password -storepass password
    rem keytool -export -alias harm -file exportPublicKey.cer -keystore harm.com -storepass password
    rem jar cfm0 test.jar manifest.txt test.class
    jar cfm0 test.jar manifest.txt test.class
    jarsigner -keystore harm.com -storepass password -keypass password -signedjar sTest.jar test.jar harm
    del *.class
    pause
    Both test.jar and sTest.jar contain the information from manifest.txt.

  • How to read jar and jad file

    hi friends...
    i have download some jar files now i want read this jar file means i want read all classes or files which r using in that project..
    is there any software to which extract that jar file..
    plz anyone know this thing plz help me....
    thks in advance..
    Thanks and Regards
    Prashant

    Just rename the jar to .zip. The jad is just a text file.

  • Problem with "package-info.java" using EJB 3.0 and OC4J

    Hi all.
    I already posted this question on JDeveloper forum, but didn't get any answer,
    so I'll try posting here.
    Anyway, I'm new both to JDeveloper and J2EE,
    so I'm trying out examples for EJB 3.0, and I got stuck at "Use Security Annotations with EJB 3.0"
    (http://www.oracle.com/technology/tech/java/oc4j/ejb3/howtos-ejb3/howtoejb30security/doc/how-to-ejb30-security-ejb.html).
    Example code is working perfectly, if one builds it using Ant, but I'm importing all examples into JDeveloper (or at least I'm trying to :))
    JDeveloper can't build file "package-info.java" containing following code:
    @javax.annotation.security.SecurityRoles(roleNames={"superuser", "user"})
    package oracle.ejb30;I'm getting following output in "Compiler - Log" window:
    Error(2,1): 'class', 'interface', or 'enum' expected.
    Help much appreciated...
    platform used:
    Windows XP SP2
    JDeveloper Studio (Version 10.1.3, Build 3412)
    JDK 1.5_06
    OC4J 10.1.3 developer preview 4 (standalone version)

    Since you're using EJBs, you can use JTA and can skip the getTransaction() calls. If you want to use getTransaction().begin() and commit(), then make sure that your EntityManager is resource-local. The configuration for this is in persistence.xml. Set a transaction-type of RESOURCE_LOCAL rather than JTA.

  • Where do I put the Jakarta files standard.jar and jstl.jar when developing with JSF 2.0 in OEPE using web logic server

    hi everybody, I am wondering what should i do with the standard.jar and jstl.jar files when using we logic. I tried putting both files into
    the directory c:\oracle\middleware\oracle_home\user_projects\domains\base_domain\bin.  I don't know if this is correct.  Thanks in
    in advance for the help.

    Anyways I found this link on www.oracle.com website by the same author of the book I am reading Deepak Vohra - Templating with JSF 2.0 Facelets.
    although here he is using Weblogic 11g although I don't think it makes a difference.  have a look at the Setting up the Environment section
    where he says to download the jstl.jar and standard.jar files.
    http://www.oracle.com/technetwork/articles/java/facelets-454361.html

Maybe you are looking for

  • CreateRow increases memory and cpu. Tomcat+ADF Faces+BC4J in JDev 10.1.3.0

    CreateRow increases memory and cpu. Tomcat+ADF Faces+BC4J in JDev 10.1.3.0.4 My old problem is this Ineffectiveness/Inconsistency BC4J createrow in tomcat, CPU = 100%,Mem=2.2G I have tested my Adf Faces application with jmx in server and, in my machi

  • Mass Creation of Variants

    I have hundreds of products that all have the same variant configurations, and I understandably don't want to pay someone to manually go through the WebTools interface to create all the variants.  After looking through the WebTools database, I am pla

  • Laserjet 5000 (with jetDirect 620n): spooling from Windows 7 too slow

    Hi, i've installed new drivers for Windows 7 (32 and 64 bit) from HP website but however spooling is too slow. I tried all of drivers (PCL 6, PCL5 and PS). Only the PCL5 driver have an adequate standard of quality. What i have to do to increase print

  • ABAP Inbound Proxy Error !

    Hi , I am forwarding Vendor Data from SRM EBP to SUS with the predifined proxies given by SAP, bu t i get below error when it reaches SUS System.Message processing both in SAP EBP and SAP XI is fine.   <?xml version="1.0" encoding="UTF-8" standalone=

  • Fix in 6 steps: iPhone does not sync to iCal

    like a ton of folks, the iCal app on my Macbook stopped syncing w/ my iPhone.  i found a solution through Gmail.  (if you don't have Gmail, sign up and enable Google sync with your iPhone. you may be able to do this through your iPhone settings; if n