Injecting EntityManager into Interceptor class, naming exception

Hello , I try the code below :
class MyInterceptor {
@PersistenceContext(unitName="Model")
private EntityManager em;
@AroundInvoke
doIntercept....
but I got a naming exception , oc4j told me ....failed to inject the resource.....
Anyone know ,why ?
Anyway I resolved to make a special name into context :
class MySessioBean { // this bean use MyInterceptor
@PersistenceContext(name ="AdminPC",unitName="Model")
private EntityManager em;
and on MyInterceptor :
class MyInterceptor{
@AroundInvoke
public Object doIntercept(InvocationContext ic)throws BusinessException{
try {
InitialContext ctx = new InitialContext();
EntityManager temp = (EntityManager)ctx.lookup("java:comp/env/AdminPC");
em =temp;
} catch (NamingException e) {
// TODO
}

Hi,
Try verifying that all configuration details are set for OC4J.
You may refer the to following end-to-end quickstart enterprise application tutorial that contains the same @PersistenceContext injection on a stateless session ejb bean.
http://wiki.eclipse.org/EclipseLink/Examples/JPA/OC4J_Web_Tutorial
specifically
http://wiki.eclipse.org/EclipseLink/Examples/JPA/OC4J_Web_Tutorial#Perform_a_JPQL_query
and code
http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/org.eclipse.persistence.example.jpa.server.oc4j.enterpriseEJB/ejbModule/org/eclipse/persistence/example/jpa/server/business/ApplicationService.java
If configurations match between both apps, then we can triage further.
thank you
/michael
www.eclipselink.org

Similar Messages

  • Injecting EntityManager

    Hi,
    I tried to get the entity manager injected into my servlet context listener class but with no success.
    I am using JPA with Toplink and deploying on Sun Application Server.
    The servlet is a simple servlet which has a field of type EntityManager and with @PersistenceContext annotation.
    I also tried to get the EntityManagerFactory injected. Even it is null.
    Is it at all possible to inject EntityManager into a normal servlet?
    Please help.
    Thanks in advance.
    Regards,
    Anand.

    Hi,
    Try verifying that all configuration details are set for OC4J.
    You may refer the to following end-to-end quickstart enterprise application tutorial that contains the same @PersistenceContext injection on a stateless session ejb bean.
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/OC4J_Web_Tutorial
    specifically
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/OC4J_Web_Tutorial#Perform_a_JPQL_query
    and code
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/org.eclipse.persistence.example.jpa.server.oc4j.enterpriseEJB/ejbModule/org/eclipse/persistence/example/jpa/server/business/ApplicationService.java
    If configurations match between both apps, then we can triage further.
    thank you
    /michael
    www.eclipselink.org

  • Remote Class cast Exception

    Greetings,
    I took my first steps into the RMI world. I managed to get a tutorial example working. Now I did my own RMI system, but I can`t get rid of this problem.
    - rmiregistry is running OK
    - my RMIServer is running OK
    but my RMIClient Throws: java.lang.ClassCastExceptionI took a closer look at the Object I receive on the client side, and it was:
    DBManager_Stub[RemoteStub [ref: [endpoint:[ ... [/b]
    Here are the code snippets:
    public interface DefaultDBManager extends java.rmi.Remote
    public class DBManager implements DefaultDBManagerIn my RMIServer:
    LocateRegistry.createRegistry(PORT);
    DefaultDBManager DB_MANAGER = new DBManager();
    UnicastRemoteObject.exportObject(((DefaultDBManager)DB_MANAGER));
    Naming.rebind(URL,DB_MANAGER);and in the client code:
    DBManager DB_MANAGER = (DBManager)Naming.lookup(URL);But the client code Throws Class cast Exception.
    What is it I`m not seeing here?
    Help appreciated,
    Eki

    and in the client code:
    DBManager DB_MANAGER = (DBManager)Naming.lookup(URL);You should be casting to the interface not the impl class.
    DefaultDBManager DB_MANAGER = (DefaultDBManager)Naming.lookup(URL);

  • How to store a class-based exception as container element?

    Hello,
    In a BO type method, there are situations where unexpected class-based exceptions can occur, I handle them with TRY ... CATCH ... ENDTRY.
    If such an error occurs, my BO type method also returns a BO type method exception using a return code (as usually).
    1) Now, my question is how can I store the exception instance in the task container ? (so that to get more information about what happened... it is an unexpected error as I said)
    Note that my question may apply to any class instance.
    2) To achieve this, I have an idea but not sure if it's realistic (maybe the question is not realistic too ). I'll create a new BO type ZOOINSTANC with string attribute containing the serialized instance, with a method to display it.
    Example how it could work, in my BO type method (it returns EXCEPTION parameter of type ZOOINSTANC):
    TRY.
      CATCH cx_root INTO lo_exc.
        DATA l_exc TYPE string.
        CALL TRANSFORMATION id
            SOURCE oo = lo_exc
            RESULT XML l_exc.
        DATA l_bor_zooinstanc TYPE swc_object.
        swc_create_object l_bor_zooinstanc 'ZOOINSTANC' ''. "no key
        swc_set_property l_bor_zooinstanc l_exc.
        swc_set_element container 'EXCEPTION' l_exc.
        exit_return 1001 '' '' '' ''.
    ENDTRY.
    One important issue is that I don't know any API to display the instance :-p
    Do you have any ideas, advices, ... ?
    Thx
    sandra

    Hi Mike, thank you for your answer, and sorry for the delay.
    > I'd rather go with the idea of returning the error details in a structured format that you can view in the container
    Yes, but that's the issue as I don't know which exceptions can be triggered, as I'd like to handle all exceptions.
    > I'd also ask why it's necessary to use BOR for this?
    When a BOR method fails, I want technical support to have all the details of the error, not only a generic error message. It's why I want to store the exception in the workitem container, and be able to display it later.
    > It's obviously your own development, so why not use classes. Subclasses of CX_BO_ERROR are recognised by workflow and you can even  bring a proper message back to the WF log. There's also some info on this in the second edition of the WF book.
    I did a test using demo workflow WS56400159 ("absence"), where I forced CX_BO_ERROR right after SWX_FORMABS_CREATE call in CL_SWF_FORMABSENC / CREATE method, but it seems that only the short text of the exception is kept.
    So, I'm a little disappointed to see that we have a great exception "tool" with class-based exceptions, but only the last text is kept in the system! That would have been great to be able to store the whole information (the attributes, and the whole bunch of cascading exceptions (PREVIOUS attribute), instead of only a simple text).
    sandra

  • Getting class cast exception in Web application.

    I have a web application deployed using standard specs for deployment. I
              have and web-inf directory with a web.xml file set up. All the servlet
              classes are in the classes sub-directory of web-inf.
              If I deploy this application using the Tomcat application server,
              everything works as expected. When I deploy this application using the
              Weblogic software, I can get to the initial page, put once I select a
              link that calls the main servlet, I get a classcast exception. Both the
              Tomcat and Weblogic software point to the same directory for the
              application.
              I double checked and made sure that no other instances of my servlet
              classes exist anywhere else in the class path.
              Any one have any thoughts or suggestions. I am perplexed that this web
              app runs fine under the Tomcat software and yet...
              Thanks.
              Paul Garduno
              

    Thanks for your reply. I am not using any EJBs. From what I have
              gathered since writing my message, this may be the "dreaded" class cast
              exception (although I don't know why since it runs under Tomcat).
              Basically, the initial page is displayed. When you select the SEARCH
              button (for example), the request goes to a servlet which puts a vector
              of custom classes into a session parameter. The request is then
              forwarded to the JSP page which uses the information in the classes to
              help build some information on the page. The first line in the JSP is
              processed (a simple output line to the system console) and then the
              classcast exception occurs.
              According to the info that I have seen, this shouldn't happen since I am
              not changing either the servlet or JSP files which would mean that
              nothing should be re-compiled.
              I have a call into tech support. I will post their answer and copy you
              on the message.
              Thanks.
              Paul
              Cameron Purdy wrote:
              >
              > Are you using EJBs hosted on the same instance of WebLogic? If so, delete
              > the home/remote interfaces from your web deployment. Otherwise, post the
              > exception listing ....
              >
              > Cameron Purdy, LiveWater
              >
              > "Paul Garduno" <[email protected]> wrote in message
              > news:[email protected]...
              > > I have a web application deployed using standard specs for deployment. I
              > > have and web-inf directory with a web.xml file set up. All the servlet
              > > classes are in the classes sub-directory of web-inf.
              > >
              > > If I deploy this application using the Tomcat application server,
              > > everything works as expected. When I deploy this application using the
              > > Weblogic software, I can get to the initial page, put once I select a
              > > link that calls the main servlet, I get a classcast exception. Both the
              > > Tomcat and Weblogic software point to the same directory for the
              > > application.
              > >
              > > I double checked and made sure that no other instances of my servlet
              > > classes exist anywhere else in the class path.
              > >
              > > Any one have any thoughts or suggestions. I am perplexed that this web
              > > app runs fine under the Tomcat software and yet...
              > >
              > > Thanks.
              > >
              > > Paul Garduno
              

  • Class cast exception in Process Control

    Hello,
    I am trying to use a SubProcess through a Process Control from a ParentProcess in another Workshop application.
    They are both deployed in the same domain.
    The SubProcess Control is packaged in a Control Project whose jar is imported in the other ParentProcess Workshop application.
    The data that is passed is in form of XML documents described as schemas. And both applications use the same Schema.jar.
    The call from the ParentProcess looks like it is OK.
    But when the reply comes back it looks like the transform fails. I get a "class cast exception"
    The feeling I get is that the returning xml document variable can't be cast into the local xml document variable. Even though they are of the exact same type...
    All help is very much appreciated!!!
    Unhandled Process Exception:
    java.lang.ClassCastException
    at se.telia.object.kund.control.sokKundPControl.clientRequest(Unknown Source)
    at se.telia.tab.regae.process.Untitled.sokKundPctrlClientRequest(Untitled.jpd:101)
    -------------

    I'm having some problems with a transformation and I'm getting a cast exception so maybe it's the same thing.
    The problem is when the source schema has some element with minOccurs="0". If the element is not present in the xml document that is received, the transformation seems to be trying to cast it anyway.

  • Class Cast exception in ArrayDescriptor.createDescriptor(

    I want to pass an array into a an Oracle procedure called using a callableSatement.
    When I create the array descriptor i get an class cast exception. I believe this error occurs when the sun.jdbc.odbc.JdbcOdbcConnection
    or the weblogic.jdbc.wrapper.PoolConnection_weblogic_jdbc_oci_Connection connection object is being cast to oracle.jdbc.driver.OracleConnection by createDescriptor method how can i overcome this run time error????

    Welcome to the forum!
    >
    am trying to pass ArrayList to Oracle procedure
    but when i am excuting the code i got the following error
    java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc.WSJdbcConnection incompatible with oracle.jdbc.OracleConnection
    Can anybody help me to resolve this problem.
    >
    Not if you don't provide the code you are using so we can see what it is doing. Also post your 4 digit Oracle version, Java version, JDBC jar file name/version and the procedure signature that shows the language, parameters and types.
    An ArrayList is a Java object so are you using a Java stored procedure?
    Or are you using WebSphere? If WebSphere see this IBM link which appears to apply to the problem you are describing.
    http://www-01.ibm.com/support/docview.wss?uid=swg21409335

  • Class Cast Exception in JSP of the component

    Hi,
      I am trying to call a web service from the JSP of the component.I have written the java code as a scriplets in the JSP. The problem i am facing is Class Cast Exception. The code is as follows
    String strKey = "wsclients/proxies/sap.com/CCMSContentBroker/com.sap.ccmscontentbroker.CCMSContentProxy";
    java.lang.Object obj ;
    obj = context.lookup(strKey);
    str1 = obj.getClass().getName();
    ContentBroker objCB= null; 
    objCB = (ContentBroker)obj; // getting error here
    ContentBroker is an web service interface. The same code is working if i write it in the component but not in the scriplet of the JSP.
    Can't we do the type cast in the JSP ?
    Cant we call the web services in the JSP?
    How to eliminate this Class cast Exception in my code?
    Thanks and Regards,
    Saravanan

    Hi Harini,
             Thanks for your reply. I have checked all the import statements in the JSP.The problem is in the Type casting of object <b>obj</b> to ContentBroker variable <b>objCB</b>.
    Are u saying typr casting is not possible in JSP or organising imports in the JSP.
    These are my imports statements in the JSP
    <%@ page import = "java.util.ResourceBundle" %>
    <%@ page import = "com.sapportals.htmlb.*" %>
    <%@ page import = "com.intel.ccmt.ccmscontentbroker.* "%>
    <%@ page import = "com.intel.ccmt.ccmscontentbroker.types.* "%>
    <%@ page import = "com.sapportals.portal.prt.contentconversion.XSLConverter" %>
    <%@ page import = "com.sapportals.portal.prt.component.IPortalComponentRequest" %>
    <%@ page import="java.io.File" %>
    <%@ page import="javax.naming.Context" %>
    <%@ page import="javax.naming.InitialContext" %>
    <%@ page import="javax.naming.NamingException" %>
    <%@ page import="java.util.StringTokenizer"%>
    Can u help me on rectifying this class cast Exception ?
    Thanks and Regards,
    Saravanan

  • Class Cast Exception in Portable Remote Object

    Hai guys,
    I am new to jsp.I have made a simple j2ee application in which i am getting class cast exception in PortableRemoteObject.narrow function.
    The exception is:
    org.apache.jasper.JasperException
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:585)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
    java.security.AccessController.doPrivileged(Native Method)
    javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    The root cause is :
    java.lang.ClassCastException
         com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
    javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
    org.apache.jsp.registration_jsp._jspService(registration_jsp.java:59)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:585)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
    java.security.AccessController.doPrivileged(Native Method)
    javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    The code of the file is :
    <%@ page language="java" import="java.sql.*,pkg.*,javax.ejb.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.rmi.RemoteException" %>
    <html>
    <head>
    <title></title>
    </head>
    <body bgcolor="CCCCFF">
    <h1><center>Welcome to MyBank</center></h1>
    <%
    InitialContext initial = new InitialContext();
    Object objref = initial.lookup("bankDSN");
    pkg.mybankHome vi = (pkg.mybankHome)PortableRemoteObject.narrow(objref,pkg.mybankHome.class);
    %>
    </body>
    </html>
    I have many threads but i was not able to solve this problem.
    It has been 2 to 3 weeks that i am struck in this error.
    Plz help me with this.
    Thanks in advance.
    Edited by: vishal29 on Jul 13, 2008 10:04 PM

    Hai DigitalDreamer,
    Thanks for giving your valuable time to my question.
    I have tried the code you gave me.
    The answer for :
    out.println(objref.getClass().getName());
    that i got is :
    javax.naming.Reference
    And the answer for :
    out.println(objref.getClass().getInterfaces());
    that i got is :
    [Ljava.lang.Class;@213b6e
    Could you please tell me how this can help.
    Actually i am new to jsp.
    Thanks in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Type problem - Class Cast Exception - trying to understand

    hello,
    i get a Class cast exception in the following code.
    interface Foo {}
    class Alpha implements Foo {}
    class Beta extends Alpha {}
    class Delta extends Beta {
    public static void main( String[] args ) {
    Beta x = new Beta();
    Beta b = (Beta)(Alpha)x; //fine
    Foo f = (Delta)x; //CCE
    Object ob = new Object();
    String s = new String();
    ob = s; //fine, no need of case
    s = (String)ob; //needs a castI was just thinking, implicitly Delta and Beta both of them IS-A Foo, and assigning x to a type foo shouldnt be a problem(while making it refer to the Delta class) so, what could cause the CCE ?
    I would appreciate if someone could please help me understand this.
    Rgds

    Hi.
    Assigning your "x" to a variable typed Foo is not a problem. The problem is that you are trying to cast an instance of Beta ("x") into type Delta which is not possible. Every Delta is a Beta, but not every Beta will be a Delta!
    Simple as that.
    Bye.

  • WL 10 Upgrade Class Cast Exception

    Hi, we are upgrading from WL 8.1 to 10.3 and are recieving the following exception when invoking the test of our web service. Any ideas?
    ...Ed
    java.lang.ClassCastException: weblogic.xml.saaj.DetailImpl cannot be cast to weblogic.xml.xmlnode.XMLNode
    <bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">
    java.lang.ClassCastException: weblogic.xml.saaj.DetailImpl cannot be cast to weblogic.xml.xmlnode.XMLNode
         at weblogic.webservice.core.soap.SOAPElementImpl.addChildElement(SOAPElementImpl.java:136)
         at weblogic.webservice.core.soap.SOAPFaultImpl.setDetail(SOAPFaultImpl.java:52)
         at weblogic.webservice.util.FaultUtil.fillFault(FaultUtil.java:129)
         at weblogic.webservice.util.FaultUtil.exception2Fault(FaultUtil.java:190)
         at weblogic.webservice.core.handler.InvokeHandler.serializeFault(InvokeHandler.java:203)
         at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.java:159)
         at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:144)
         at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:551)
         at weblogic.webservice.server.Dispatcher.process(Dispatcher.java:204)
         at weblogic.webservice.server.Dispatcher.doDispatch(Dispatcher.java:175)
         at weblogic.webservice.server.Dispatcher.dispatch(Dispatcher.java:97)
         at weblogic.webservice.server.WebServiceManager.dispatch(WebServiceManager.java:101)
         at weblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke(WebServiceServlet.java:321)
         at weblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.java:453)
         at weblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServiceServlet.java:292)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    </bea_fault:stacktrace>

    "Andrew Gilbert" <[email protected]> writes:
    What protocol are you using? If t3 you might want to try explicitly
    turning off iiop to prevent it loading its own PRO classes.
    -Dweblogic.system.enableIIOP=false
    andy
    Having a problem while trying to upgrade from WL 5.1/Tomcat 3.3 to WL 7.01
    and Tomcat 4.1.12. Using JDK 1.3.1 on Win2K. Interop between Tomcat and WL
    is always more an adventure than it should be! Here are the specifics:
    Placed weblogic.jar into "shared" classloader in Tomcat distribution. This
    sits above the Web Application class loaders. Placed our code, including EJB
    Home and Remote classes into Web-Inf/lib. There are two web applications.
    WebApp "A" successfully finds Home and works fine, until at some point we
    try to reference the same Home from within the other WebApp "B". At that
    point we get a class cast exception.
    java.lang.ClassCastException
    at
    com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemo
    teObject.java:296)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
    at COM.soundbite.ejb.EJBHomes.getAccountHome(EJBHomes.java:444)
    at COM.soundbite.ejb.EJBHomes.forAccount(EJBHomes.java:163)
    The Home class in the web app is loaded by a WEB-INF level class loader and
    the chain looks clean. The Home implementation stub gets loaded by
    weblogic.utils.classloaders.GenericClassLoader, whose parent appears to be a
    WEB-INF level class loader. This chain also looks clean.
    Any ideas?

  • Wrap a file into one class

    Hello,
    I want to wrap a file into one classe, how can I do that?
    For example:
    class fileWrapper {
    one buffer for file content(what kind of buffer here?)
    Thanks a lot
    Grace

    The following is not a buffer but I hope it could be of some use.
    import java.io.*;
    public class FileWrapper {
        java.io.File file;
        FileWrapper(java.io.File f) throws java.io.IOException{
           this.file =f;
        FileWrapper(java.lang.String fname) throws java.io.IOException{
          this(new java.io.File(fname));
        // .. next is an example of a method ... You can define other useful methods
        public String readLines() throws java.io.IOException{//read all lines as a String object
           java.io.BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(this.file),"UTF8"));
           StringBuffer buffer = new StringBuffer();
           String temp=null,newLine=System.getProperty("line.separator");
           while((temp=reader.readLine())!=null){
               buffer.append(temp).append(newLine);
           reader.close();
           return String.valueOf(buffer);
    /*public static void main(String[] args) throws java.lang.Exception{
      FileWrapper fw = new FileWrapper("test.txt");
      String str = fw.readLines();
      System.out.println(str);
    }

  • Where-used list for class-based exception texts

    G'Day,
    With traditional exceptions, one can look at a message, go to SE91 and do a where-used for that particular message. This is not possible with ZCX classes, a where-used can be done for the entire class but there doesn't seem to be a way to find where individual exception texts are raised.
    Now whilst exception classes do offer the possiblity of a far better structuerd approach that reduces the need for a where-used in first place, this is still a shortcoming of exception classes... or is it? (or am I missing some other way to search for it?)
    Cheers,
    Mike

    D'Oh! That one was so obvious that I was blinded by it  
    (Believe it or not I've been using ex. classes for some time!)
    However it still leaves another issue (which was actually the one that sparked this debate here in the office): In the old message concept it was far easier to navigate from an error to find the offending code. One could click on a message, see the message class/ID, drop into SE91 and (provided the where used is small enough) go straight to the offending code via a where-used.
    Unless class-based exceptions are caught and re-raised as an old MESSAGE statement with a message number, this is not so simple anymore. Or is it?
    Thanks,
    Mike

  • Help!:  local class incompatible exception

    Hi!, im new in the ejb tech, I'm using jboss 3.2.3, windows 2000, j2ee 1.4 and jdk 1.4.1.
    I already deploy the ejb in the app server, but at the Context.lookup statement from the client i get a local class incompatible exception!!, could anyone help me with this??? the client and the ejb are running in different machines, but the classes are the same ( I map the network drive and put it in my classpath to ensure im using the same classes with the same serial uid).
    Thanks a lot!!!
    The complete Stack trace is
    javax.naming.CommunicationException. Root exception is java.io.InvalidClassException: org.jboss.proxy.ejb.GenericEJBInterceptor; local class incompatible: stream classdesc serialVersionUID = 3844706474734439975, local class serialVersionUID = 4582256576523491346
    at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:459)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    at org.jboss.proxy.ClientContainer.readExternal(ClientContainer.java:104)

    Sorry, i already found the problem!!! . I was running the client within the forte 4 ee ide, and it seems that forte assigns the objects their own serial uid. When I execute the client from a terminal, it executes ok =)

  • Tracing into java.rmi.naming

    Hi all!
    When debugging, I cannot trace into java.rmi.Naming
    in objc = (MyInterface)Naming.lookup(AnObjectAddr);
    I have no classes or sources excluded in Project Properties | Run/Debug
    What on earth could be wrong?
    I have installed the new JDev, which has reverted my settings to default JDK1.2.2 (was JDK1.3) - I was hoping that this might solve the problem, but it does not.
    Best regards and thanks in advance,
    Christian Loft

    Hi all!
    When debugging, I cannot trace into java.rmi.Naming
    in objc = (MyInterface)Naming.lookup(AnObjectAddr);
    I have no classes or sources excluded in Project Properties | Run/Debug
    What on earth could be wrong?
    I have installed the new JDev, which has reverted my settings to default JDK1.2.2 (was JDK1.3) - I was hoping that this might solve the problem, but it does not.
    Best regards and thanks in advance,
    Christian Loft

Maybe you are looking for

  • Problems with extended features.  I can no longer fill out my documents in the fields provided.  The

    Problems with extended features.  I can no longer fill out my documents in the fields provided.  The error message I get is "This document enabled extended features in Adobe Reader.  The document has been changed since it was created and use of exten

  • Seeburger AS2: Proxy Error 407

    Hi All, I am facing the following error while sending message to receiver through AS2  Could not deliver as2 message to partner: 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy

  • Merging XML and XDP files

    Hello! I must build this POC for a client and the idea is merge XML and XPD files to feed a LiveCycle Output process and create PDF files. I've built the XDP files and the XML to start things, now I need to figure out how to create the process to mer

  • Need Help to create access-list based on traffic logs

    Hello, We didn't have any Firewall in our network, we recently implemented  Cisco ASA (Context) firewall in our network with any  any permit rule . Our intension is to collect the source, destination, protocol & ports based on the traffic logs and th

  • IPod Touch iOS4 update - some features not working

    While I was updating my iPod Touch with the new software, and error came up in the middle of it but it was at the part where it was resyncing all applications, music, and movies. I am able to use some of the new features including the app folders and