Can't get MEJB with J2EE1.4 Ref Impl

Hello,
I'm trying to obtain the Management EJB with the J2EE 1.4 Reference Implementation but I am receiving a ClassCastException. Is this not implemented to JSR 77 spec yet? Here is my code snippet:
String MEJB = "ejb/mgmt/MEJB";
ManagementHome managementHome = null;
Context context = new InitialContext();
Object obj = context.lookup(MEJB);
// this next line causes the Exception -- I investigated and the 'obj' is a sun CORBA object WHY?
managementHome = (ManagementHome)PortableRemoteObject.narrow(obj,ManagementHome.class);
Thanks
Mark Lepak

OK here is the info for accessing MEJB using a jsp thru j2ee web module.
01. create index.jsp
<%@ page import='javax.naming.*' %>
<%@ page import='javax.rmi.PortableRemoteObject' %>
<%@ page import='javax.management.j2ee.ManagementHome' %>
<%@ page import='javax.management.j2ee.Management' %>
<%@ page import='javax.management.*' %>
<%= "start mejbJsp <br>" %>
<%
Management mejb = null;
try {
InitialContext ic = new InitialContext();
out.println("in mejbJSP: obtained ic ...<br>");
Object objRef = ic.lookup("ejb/mgmt/MEJB");
out.println("in mejbJSP: objRef = " + objRef + " <br>");
ManagementHome home =
(ManagementHome)PortableRemoteObject.narrow(objRef,
ManagementHome.class);
out.println("in mejbJSP: home = " + home + " <br>");
mejb = home.create();
out.println("in mejbJSP: MEJB default domain = " +
mejb.getDefaultDomain() + " <br>");
} catch (Exception ex) {
out.println(ex.getMessage());
%>
<%= "end mejbJsp <br>" %>
02. Since MEJB is secured we need to provide the corresponding security info in the descriptors . Following are the sample descriptor entries which include security and basic authentication.
02.01. web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<description>no description</description>
<display-name>mejbJsp</display-name>
<servlet>
<description>mejb jsp example</description>
<display-name>mejbJsp</display-name>
<servlet-name>mejbJsp</servlet-name>
<jsp-file>/index.jsp</jsp-file>
</servlet>
<ejb-ref>
<ejb-ref-name>ejbs/mejb</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>javax.management.j2ee.ManagementHome</home>
<remote>javax.management.j2ee.Management</remote>
<ejb-link>MEjbBean</ejb-link>
</ejb-ref>
<security-constraint>
<web-resource-collection>
<web-resource-name>Basic Realm</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin-role</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Basic Realm</realm-name>
</login-config>
<security-role>
<description>The admin role</description>
<role-name>admin-role</role-name>
</security-role>
</web-app>
02.02. sun-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 8.0 Servlet 2.4//EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-web-app_2_4-0.dtd">
<sun-web-app>
<context-root>mejbjsp</context-root>
<class-loader delegate='true'/>
<ejb-ref>
<ejb-ref-name>ejbs/mejb</ejb-ref-name>
<jndi-name>ejb/mgmt/MEJB</jndi-name>
</ejb-ref>
<security-role-mapping>
<role-name>admin-role</role-name>
<group-name>asadmin</group-name>
</security-role-mapping>
</sun-web-app>
03. Package the above into a war module and deploy it.
asadmin> deploy mejb_jsp.war
04. Invoke the jsp using a web browser, say http://<host-name>:<port>/mejbjsp
When login window pops up, you may enter user name and password which has asadmin role.

Similar Messages

  • Trying to activate newly installed Acrobat 11 but can't access internet thru program - can otherwise get online with no probs

    trying to activate newly installed Acrobat 11 but can't access internet thru program - can otherwise get online with no probs. any suggestions?

    Hey Marina Hannwacker,
    I would recommend you to Refer this link - Offline Activation and let me know if it works for you.
    Regards,
    Rahul Tyagi

  • Hi, I've recently bought an iPad2 and can't get connected with AppStore or iTunes, when I tap on these icons a grey page pops up saying is loading but never opens the page, no failure message is displayed, it just keep saying is loading. Apparently it is

    Hi, I’ve recently bought an iPad2 and can’t get connected with AppStore or iTunes, when I tap on these icons a grey page pops up saying is loading but never opens the page, no failure message is displayed, it just keep saying is loading.
    Apparently it is not an issue with wifi since Safari, You Tube and Maps work well, I’ve tried some of the tips, e.g. log off/on my Id, change password but no one worked.
    Your help will be highly appreciated.
    Thank you.
    Luis.

    Try a reset. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo. Ignore the red slider.

  • Can I get help with podcasts?  When I try to open the podcasts, itunes crashes, says "itunes has detected a problem and must close", or the spanish equivalent since my xp is in spanish.  everything else works fine, it even downloads podcasts and syncs.

    Can I get help with podcasts?  When I try to open the podcasts tab, itunes crashes, says "itunes has detected a problem and must close", or the spanish equivalent since my xp is in spanish.  everything else works fine, it even downloads podcasts and syncs.

    The only other thing I can suggest is to use the Repair option for iTunes.
    Download the iTunes programme (do not uninstall your current iTunes) and then "install" the new copy. At some stage you should see an option to "install" or "Repair". Take the Repair option.
    Once you've done that, if you still have a problem, I don't know what else to suggest, except to search through the discussions to see if anyone else has had the problem and managed to fix it.

  • Since I installed Lion, I can't get online with ichat - shows ichat as offline or disconnected when I open the app.

    Since I installed Lion, I can't get online with ichat - shows ichat as offline or disconnected when I open the app.

    Hi,
    Also try turning Off Face Time
    Open Face Time
    Go to the Preferences
    Set it to Off.
    Also make sure your router has the Time and Date/Time Zone set as this upsets Face Time which in turn upsets IChat
    9:28 PM      Tuesday; August 16, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • I have problem with my iphone 4s my battery is not keeping charge. how can I get help with this one. it is less than a year that I purchased this cell.

    I have problem with my iphone 4s my battery is not keeping charge. how can I get help with this one? it is less than a year that I purchased this cell.

    I would like to know the answer to that one.  I realized this was happening just after upgradeing my iOS to 6.  Then when I looked up my purchase date, I was about 5 days past my one year warranty.  So I'm dead in the water.  Apple will replace the battery, but it will be about $80+.  I took it to the Apple store, and they checked a bunch of stuff, but said that it seemed ok.  I'm debating getting a battery for a more reasonable price off of ebay.  But if it's the iOS thats draining the battery, then I'm not going to be able to help it.  I wish I knew a better way to tell if its the battery, the phone, or the iOS.

  • How can I get help with pending songs that have taken over 12 hours to fully download?

    How can I get help with pending songs that have taken over 12 hours to fully download?

    You can only suspend service for 3 months at a time (with or without payment) and only twice a year.

  • How. Can I get help with illegal iTunes charges on my credit card,for things I did not order. Chuck

    How can I get help with illegal iTunes charges on my credit card for things I did not order. chuck

    Same answer as last times you asked the same question:
    iTunes adding charges to my credit card fog things I did not order. What can I do about it. Chuck

  • How can i get apps with out using credit card info because i do not have a card ?

    how can i get apps with out using credit card info because i do not have a card ?

    Yo Chris. I've been following your answers to different threads and quite frankly, you're very keen in answering everybody regarding this stupidity that Apple has brought upon its customers. Kudos to you. But the problem is, most of the time, in some devices, your solution doesn't work because the NONE option is not there. The same goes for me.
    Meanwhile, I found a temporary workaround for the iPhone 4s, iPad 2 and iPod Touch 4th Gen.
    Register a free Apple ID from the iCloud Settings.
    Go to Settings>iCloud>Account>Tap Payment Information on the Storage Plan Category.
    Fill in the other boxes and choose "None" on Credit Card Information.
    That's it! Hope I helped those who still couldn't find the "None" Option.
    Must be running IOS 5.0.1 though, else there would be no iCloud.

  • Can I get away with 150ppi?

    Hi,
    Im designing a poster (A3). As I know 300ppi is the acceptable standard for high quality printing but Its not a simple task to find materials in that resolution. What you think…can I get away with 150 ppi instead? This poster is for educational proposes only.
    Thank
    S

    150 ppi will not hold < 12 pt type very well. Of course a raster doc won't hold it well at all if you're printing to a low linescreen.
    All answers depend on your exact printing process.
    But if you can keep the elements in your design that should be vector (traditionally logos and type) as vector, then cheating to 150 ppi will be OK.
    I would create your document at the highest image resolution and upsample files. No sense in throwing away info on the files that have it. Of course I don't have to upsample much as I never steal from the internet and retch high-quality images. So someone else might be able to speak to the advantage/disadvantage of this.
    J

  • I don't have a good good disc for the mac box set can i get it with it my serial no.

    I don't have a good good disc for the mac box set can i get it with it my box number?

    If this is a new box you just bought ad the disk is bad, Apple will replace it for you.  OTOH, if you have lost the disk or it has become damaged over time, that is your responsibility, and though I don't speak for Apple, I'd be very surprised if you had any option other than buying another copy.

  • What kind of video intro can I get away with?

    I would like to have a video of about the size and quality of this apple Final Cut Studio NAB video.
    http://www.apple.com/finalcutstudio/action/?movie=nab
    Only not nearly as long. Well under a minute for sure! Can I get away with this in iweb with autoload setup for the initial splash screen of my website. I'll be using a .mac account.
    Is there a way to make it have some type of loading indicator and a skip past intro thing? Will it take 3 days to load? Advise? Thanks!

    Hello John,
    The biggest factor on whether people will watch your movie intro is dependent on their connection speed. If all your viewers have cable/dsl then it probably isn't a problem, if you are getting lots of low speed visitors then they won't take the time to let it load—probably.
    If you don't already have Statcounter ( http://www.statcounter.com/ ) and or Goggle Analytics ( http://www.google.com/analytics/ ) you should get both. This will allow you to monitor your visitor demographic, giving you the ability to design your site to the needs of the majority.... plus it is fun to see hits come in from across the country and around the world.
    Any how, I degress. Even if all your users have fast connection speeds you will probably have better luck with a flash movie which yields a higher quality to lower size ratio then the Quicktime format. Plus, more people have flash installed on their computers then Quicktime. If you don't have a flash converter you can get a resonably priced conveter at http://www.verticalmoon.com/products/video2swf/video2swf.htm
    The only problem with using flash (I currently still use Quicktime) is that you will have to add your movies in post publish. Hope that helps.
    Kind Regards,
    —Eric
    Ash Films
    http://web.mac.com/ekashley
    G4   Mac OS X (10.4.9)  

  • HT204088 My credit card was charge with out my approval, how can I get support with the issue?

    My credit card was charge with out my approval, how can I get support with the issue?

    If it's a purchase that appears on your purchase history (and not a temporary store holding charge which is made each time that you add or change your credit card details) and nobody else has access to your account and/or devices, then you can either try the 'report a problem' link from your purchase history to contact iTunes Support : http://reportaproblem.apple.com
    Or you can try contacting iTunes Support via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • Can you get iCloud with out up grading to iOS

    can you get icloud with out up grading to ios

    iCloud for IOS devices is only supported on IOS 5.0 and above.

  • Boot Camp what Windows disk can i get away with?

    looking to put boot camp on our i-mac, also want to upgrade our windows laptop to windows 7.
    Do i have to buy the Ultimate or Professional (windows 7) version or can i get away with Windows 7 Home Premium?
    Thanks

    Chart here:
    http://www.winsupersite.com/win7/win7skuscompare.asp
    The number of physical processors (sockets) is limited to only one with Home Premium. Professional or Ultimate allow for 2.
    You could have Mac Pro 2006-7 with two dual-core processors and need Professional x64 to use both and to use more than 2GB.

Maybe you are looking for

  • Downloading file in Background mode?

    Hi gurus, When I run the program in Fore ground and Back ground (Immediately when press F9, without schedule) I am getting same result, I can able to download file in a local file. Please I like to know whether it is correct or not? If it is not corr

  • Cannot updgrade to Itunes 10.5

    My Itunes won't update to 10.5 (or the latest version), so I can't use my Ipod with it, I've tried reinstalling, and the download link the apple site doesn't work, help would be appreciated, thanks

  • Videos Freezes but the sound still continues.

    Hi all, I don't know what my problem is, I've uninstalled and reinstalled many times, I"ve deleted all history and cookies, it affects all browsers. I need help. My problem is that the screen would freeze but the sound and the indicator on the bottom

  • Set User preferences in oracle portal’s database in portal environment

    Hi All, I need to set User preferences in oracle portal’s database in portal environment. I need to get some oracle PL/SQL API for the said purpose. In user preferences I need to save Preference name and preference value. Can any one have idea? Regar

  • Confirmation of QM order

    Hi, by assigning the a/c assignment in po, the system genereated qm order upon compltion of migo. please advise can we do confirmation like in prod orders (with co11n) for qm orders? please advise t-code to do confirmation for qm orders (without ente