Help Needed: Accessing Weblogic EJB in Tomcat

Hi all, I'm trying to access some EJB residing in weblogic7.0 server. Does anyone have any information/idea on how to do a JNDI connection to Weblogic Server and what are the necessary configuration on the Tomcat Server?
Thank you.
Celte

Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://"+appSrvIp+":7001");
ht.put(Context.SECURITY_PRINCIPAL, "user");
ht.put(Context.SECURITY_CREDENTIALS, "passsword");
initCtx = new InitialContext(ht);
You will need weblogic.jar in your Tomcat classpath

Similar Messages

  • Accessing WebLogic EJBs from Tomcat 3.2

    Has anyone out there tried to access EJBs in a WebLogic 5.10 SP6 app
    server from a servlet in Tomcat 3.2? I'm operating under Win2K. When I
    try to create the initial naming context, the following exception is
    thrown:
    java.lang.NoClassDefFoundError: COM/rsa/jsafe/JSAFE_InvalidUseException
    at weblogic.security.WLMessageDigest.getInstance
    (WLMessageDigest.java:52)
    at weblogic.security.MD5RandomBitsSource.seed
    (MD5RandomBitsSource.java:56)
    at weblogic.rjvm.LocalRJVM.<init>(LocalRJVM.java:108)
    at weblogic.rjvm.LocalRJVM.getLocalRJVM(LocalRJVM.java:85)
    at weblogic.rjvm.RJVMManager.getLocalRJVM(RJVMManager.java:89)
    at weblogic.rjvm.RJVMManager.initialize(RJVMManager.java:78)
    at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:137)
    at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:182)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(
    WLInitialContextFactoryDelegate.java, Compiled Code)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(
    WLInitialContextFactoryDelegate.java:148)
    at weblogic.jndi.WLInitialContextFactory.getInitialContext(
    WLInitialContextFactory.java:123)
    at javax.naming.spi.NamingManager.getInitialContext(
    NamingManager.java:771)
    at javax.naming.InitialContext.getDefaultInitCtx(
    InitialContext.java:169)
    at javax.naming.InitialContext.<init>(InitialContext.java:146)
    From poking around in the WebLogic server directories, in appears that
    the RSA-related classes are implemented as native methods in jsafe.dll.
    Should I be trying to install this dll in Tomcat somehow? If so, where
    should I be looking for information on how to do this?
    -- Erik

    "Erik Horstkotte" <[email protected]> wrote in message news:[email protected]...
    Has anyone out there tried to access EJBs in a WebLogic 5.10 SP6 app
    server from a servlet in Tomcat 3.2? I'm operating under Win2K. When I
    try to create the initial naming context, the following exception is
    thrown:[Sigh. I know it's bad form to follow up your own posts, but...]
    Ignore the exact problem description above. I wasn't including
    \weblogic\classes and \weblogic\lib\weblogicaux.jar in Tomcat's
    classpath. Now the same code connects to the app server:
    Connected successfully using http to JIMBO/172.16.1.4:7001
    But immediately after connecting, I get a new exception:
    java.lang.NoSuchMethodError: java.lang.NoSuchMethodException:
    getNameInNamespace
    at weblogic.jndi.toolkit.BasicWLContext_WLStub.ensureInitialized
    (BasicWLContext_WLStub.java:127)
    at weblogic.jndi.toolkit.BasicWLContext_WLStub.<init>
    (BasicWLContext_WLStub.java:146)
    at java.lang.reflect.Constructor.newInstance(Native Method)
    at weblogic.common.internal.ClassTableEntry.newInstance
    (ClassTableEntry.java:86)
    at weblogic.common.internal.WLObjectInputStreamBase.readLeftover
    (WLObjectInputStreamBase.java:248)
    at weblogic.common.internal.WLObjectInputStreamBase
    .readObjectBody (WLObjectInputStreamBase.java:202)
    at weblogic.common.internal.WLObjectInputStreamBase.readObject
    (WLObjectInputStreamBase.java:949)
    at weblogic.common.internal.WLObjectInputStreamBase.readObjectWL
    (WLObjectInputStreamBase.java:308)
    at weblogic.jndi.toolkit.WLContextStub.readExternal
    (WLContextStub.java:79)
    at weblogic.common.internal.WLObjectInputStreamBase
    .readPublicSerializable(WLObjectInputStreamBase.java:269)
    at weblogic.common.internal.WLObjectInputStreamBase.readLeftover
    (WLObjectInputStreamBase.java:254)
    at weblogic.common.internal.WLObjectInputStreamBase.readObjectBody
    (WLObjectInputStreamBase.java:202)
    at weblogic.common.internal.WLObjectInputStreamBase.readObject
    (WLObjectInputStreamBase.java:949)
    at weblogic.common.internal.WLObjectInputStreamBase.readObjectWL
    (WLObjectInputStreamBase.java:308)
    at weblogic.rmi.extensions.AbstractInputStream2.readObject
    (AbstractInputStream2.java:25)
    at weblogic.jndi.internal.RemoteContextFactoryImpl_WLStub
    .getContext(RemoteContextFactoryImpl_WLStub.java:99)
    at weblogic.jndi.WLInitialContextFactoryDelegate
    .newRemoteContext(WLInitialContextFactoryDelegate.java:316)
    at weblogic.jndi.WLInitialContextFactoryDelegate.newContext
    (WLInitialContextFactoryDelegate.java:242)
    at weblogic.jndi.WLInitialContextFactoryDelegate
    .getInitialContext(WLInitialContextFactoryDelegate.java, Compiled
    Code)
    at weblogic.jndi.WLInitialContextFactoryDelegate
    .getInitialContext(WLInitialContextFactoryDelegate.java:148)
    at weblogic.jndi.WLInitialContextFactory.getInitialContext
    (WLInitialContextFactory.java:123)
    at javax.naming.spi.NamingManager.getInitialContext
    (NamingManager.java:771)
    at javax.naming.InitialContext.getDefaultInitCtx
    (InitialContext.java:169)
    at javax.naming.InitialContext.<init>(InitialContext.java:146)
    getNameInNamespace isn't a method in any of my EJB's (that I wrote, at
    least - it could be generated by weblogic.ejbc), and it's not a method
    I'm calling directly. Presumably, something in the remote session bean
    creation is calling this method (of what class?)
    Am still I missing classpath entries in Tomcat? If so, which ones?
    If you've successfully referenced EJBs in a WebLogic Server from a
    Tomcat servlet, what setup changes did you have to make to Tomcat and
    WLS to make it fly?
    -- Erik

  • Exception looking up weblogic ejb from tomcat

    i have a servlet in tomcat 4.0 doing a remote lookup on an ejb in
    weblogic 6.1. the code works from a standalone client, but not in tomcat.
    so i assume it is something to do with jaas. do i have to configure jaas
    differently? and how?? i do not need to do anything with a standalone
    client to work.
    the code is
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL, "t3://192.168.254.3:7001");
    p.put(Context.SECURITY_PRINCIPAL, "user");
    p.put(Context.SECURITY_CREDENTIALS, "password");
    InitialContext ctx = new InitialContext(p);
    the exception is
    javax.servlet.ServletException: javax.naming.AuthenticationException
    [Root exception is java.lang.SecurityException: attempting to add an
    object which is not an instance of java.security.Principal to a
    Subject's Principal Set]
         at
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:457)
         at
    org.apache.jsp.test_0002dremote$jsp._jspService(test_0002dremote$jsp.java:71)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at
    org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at
    org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at
    org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at
    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at
    org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at
    org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    com.realty.remoteservice.RemoteServiceException:
    javax.naming.AuthenticationException [Root exception is
    java.lang.SecurityException: attempting to add an object which is not an
    instance of java.security.Principal to a Subject's Principal Set]
         at com.realty.remoteservice.EjbService.addListingAgent(EjbService.java:43)
         at com.realty.remoteservice.EjbService.main(EjbService.java:23)
         at
    org.apache.jsp.test_0002dremote$jsp._jspService(test_0002dremote$jsp.java:61)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at
    org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at
    org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at
    org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at
    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at
    org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at
    org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:536)
    nested exception is:
    javax.naming.AuthenticationException. Root exception is
    java.lang.SecurityException: attempting to add an object which is not an
    instance of java.security.Principal to a Subject's Principal Set
         at javax.security.auth.Subject$SecureSet.add(Subject.java:1071)
         at
    weblogic.common.internal.BootServicesStub.writeUserInfoToSubject(BootServicesStub.java:72)
         at
    weblogic.common.internal.BootServicesStub.authenticate(BootServicesStub.java:80)
         at weblogic.security.acl.internal.Security.authenticate(Security.java:108)
         at
    weblogic.jndi.WLInitialContextFactoryDelegate.pushUser(WLInitialContextFactoryDelegate.java:461)
         at
    weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:316)
         at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:288)
         at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:203)
         at
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:124)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
         at javax.naming.InitialContext.init(InitialContext.java:219)
         at javax.naming.InitialContext.(InitialContext.java:195)
         at
    com.realty.util.RealtyContextFactory.create(RealtyContextFactory.java:25)
         at com.realty.remoteservice.EjbService.addListingAgent(EjbService.java:36)
         at com.realty.remoteservice.EjbService.main(EjbService.java:23)
         at
    org.apache.jsp.test_0002dremote$jsp._jspService(test_0002dremote$jsp.java:61)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at
    org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at
    org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at
    org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at
    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at
    org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at
    org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:536)

    Did you try placing weblogic.jar in front of the classpath?
    Or use WebLogic servlet container instead ;-)
    "Simon Evans" <[email protected]> wrote in message
    news:[email protected]...
    any solution? tomcat also uses jaas so i cant remove them.
    Dimitri I. Rakitine wrote:
    Happened to me once - as far as I remember it was caused by non-WL jaas
    classes in the
    classpath.
    "Simon Evans" <[email protected]> wrote in message
    news:[email protected]...
    i have a servlet in tomcat 4.0 doing a remote lookup on an ejb in
    weblogic 6.1. the code works from a standalone client, but not in
    tomcat.
    so i assume it is something to do with jaas. do i have to configure jaas
    differently? and how?? i do not need to do anything with a standalone
    client to work.
    the code is
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL, "t3://192.168.254.3:7001");
    p.put(Context.SECURITY_PRINCIPAL, "user");
    p.put(Context.SECURITY_CREDENTIALS, "password");
    InitialContext ctx = new InitialContext(p);
    the exception is
    javax.servlet.ServletException: javax.naming.AuthenticationException
    [Root exception is java.lang.SecurityException: attempting to add an
    object which is not an instance of java.security.Principal to a
    Subject's Principal Set]
    at
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
    l.java:457)
    at
    org.apache.jsp.test_0002dremote$jsp._jspService(test_0002dremote$jsp.java:71
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
    va:201)
    atorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
    FilterChain.java:247)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
    ain.java:193)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
    va:243)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    66)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    >>
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
    va:190)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    66)
    at
    org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
    46)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    64)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    >>
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at
    org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    66)
    at
    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
    java:170)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    64)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    64)
    at
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    64)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    >>
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
    :174)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    66)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    >>
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at
    org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
    1027)
    at
    org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125
    at java.lang.Thread.run(Thread.java:536)
    root cause
    com.realty.remoteservice.RemoteServiceException:
    javax.naming.AuthenticationException [Root exception is
    java.lang.SecurityException: attempting to add an object which is not an
    instance of java.security.Principal to a Subject's Principal Set]
    at
    com.realty.remoteservice.EjbService.addListingAgent(EjbService.java:43)
    at com.realty.remoteservice.EjbService.main(EjbService.java:23)
    at
    org.apache.jsp.test_0002dremote$jsp._jspService(test_0002dremote$jsp.java:61
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
    va:201)
    atorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
    FilterChain.java:247)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
    ain.java:193)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
    va:243)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    66)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    >>
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
    va:190)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    66)
    at
    org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
    46)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    64)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    >>
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at
    org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    66)
    at
    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
    java:170)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    64)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    64)
    at
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    64)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    >>
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
    :174)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    66)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    >>
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at
    org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
    1027)
    at
    org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125
    at java.lang.Thread.run(Thread.java:536)
    nested exception is:
    javax.naming.AuthenticationException. Root exception is
    java.lang.SecurityException: attempting to add an object which is not an
    instance of java.security.Principal to a Subject's Principal Set
    at javax.security.auth.Subject$SecureSet.add(Subject.java:1071)
    at
    weblogic.common.internal.BootServicesStub.writeUserInfoToSubject(BootService
    sStub.java:72)
    at
    weblogic.common.internal.BootServicesStub.authenticate(BootServicesStub.java
    :80)
    at
    weblogic.security.acl.internal.Security.authenticate(Security.java:108)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.pushUser(WLInitialContextFacto
    ryDelegate.java:461)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFac
    toryDelegate.java:316)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:288)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:203)
    at
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
    ory.java:124)
    atjavax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
    at
    javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.(InitialContext.java:195)
    at
    com.realty.util.RealtyContextFactory.create(RealtyContextFactory.java:25)
    at
    com.realty.remoteservice.EjbService.addListingAgent(EjbService.java:36)
    at com.realty.remoteservice.EjbService.main(EjbService.java:23)
    at
    org.apache.jsp.test_0002dremote$jsp._jspService(test_0002dremote$jsp.java:61
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
    va:201)
    atorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
    FilterChain.java:247)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
    ain.java:193)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
    va:243)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    66)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    >>
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
    va:190)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    66)
    at
    org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
    46)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    64)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    >>
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at
    org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    66)
    at
    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
    java:170)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    64)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    64)
    at
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    64)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    >>
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
    :174)
    at
    org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
    66)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    >>
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at
    org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
    1027)
    at
    org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125
    at java.lang.Thread.run(Thread.java:536)
    Dimitri
    Dimitri

  • Help needed with weblogic portal and documentum.

    hi guys,
    i have a project in which i have to use documentum with site caching services with weblogic portal 8.1. the html and xml pages will be stored in documentum and the metadata in oracle 8i and xslt will be used for transformation.
    Does anybody have any clue what api or things to use for this thing.
    any help , tutorial, links pointing to the solution will be helpful
    thanks in advance
    rajat

    Ok, so it looks like I only need to call a startapplicaiton after the distribute to make this work.

  • Help needed on weblogic portal source control under CVS

    Hi,
    Is that good or bad to put all the portaldomain under CVS control? eg.
    my portal domain directory structure under development environment is
    like the following:
    c:\myportaldomain --|
    |--beaApps
    |---portalApp
    | |---------myportalApplication
    |
    |---portalApp-project
    I think the stuff I need to put under CVS are "myportalApplication"
    and "portalApp-project" directories.
    However, I want to organize the CVS directory structure like the
    following:
    c:\myportalmodule --|
    |--src
    |--docs
    |--"myportalApplication"
    |--"portalApp-project"
    So this means: after I checkout from CVS, I need to copy the two
    directories "myportalApplication" and "portalApp-project" from
    c:\myportalmodule into corresponding sub-directories under
    c:\myportaldomain, before I can do any development and testing. also,
    if I make some changes on c:\myportaldomain, and I want to checkin, I
    need to copy those files back to c:\myportalmodule. I tried to use
    directory softlink, but it windows NT just offer shortcut, which
    doesn't work.
    Can somebody give some education how to integerate the weblogic portal
    with CVS source control systems?
    Thanks very much

    Hi Rene,
    Thanks for the very helpful info.
    I think maybe I have a idea how to set up the dev environment now,
    basically I will organize the CVS repository and weblogic directories
    in the same way.
    c:\myportalmodule--|
    |---myportaldomain
    | |---beaApps
    | |---portalApp
    | | |---------myportalApplication
    | |
    | |---portalApp-project
    |--src
    |--docs
    |--build.xml
    So before everybody can checkout any code from CVS, he need to
    configure a new domain named "myportaldomain" in c:\myportalmodule
    directory. Since the CVS and his domain have the same directory
    structure, so when he do the fully checkout, the files will actually
    be put into the right place, and he can checkin his files easily.
    one annoying thing is that, since there are other files (such as
    startPortal.bat,etc )generated by domain configuration wizard in
    c:\myportalmodule\myportaldomain, which are not in CVS repository. so
    everytime, we do a checkout, CVS will issue the warnings saying those
    files are in CVS repository. Please advise is there any potential
    problems or issues with this setup? Thanks for your help!!!!!
    "René Zanner" <[email protected]> wrote in message news:<[email protected]>...
    Hi,
    we did a similar thing, but we put the whole beaApps directory in the CVS, because
    we had more applications and also modified some things inside the tools application
    of BEA...
    With CVS you can do a 'partial' checkout of your module, that means you do not
    need to copy the folders back and forth, but you can check in and update directly
    in you domain directory.
    The command for a partial checkout is:
    cvs co -d <name of destination folder> <module name>/<path to your folder>
    Once checked out here, you can work with the files like in the complete checkout.
    HTH,
    René
    [email protected] (mouse) wrote:
    Hi,
    Is that good or bad to put all the portaldomain under CVS control? eg.
    my portal domain directory structure under development environment is
    like the following:
    c:\myportaldomain --|
    |--beaApps
    |---portalApp
    | |---------myportalApplication
    |
    |---portalApp-project
    I think the stuff I need to put under CVS are "myportalApplication"
    and "portalApp-project" directories.
    However, I want to organize the CVS directory structure like the
    following:
    c:\myportalmodule --|
    |--src
    |--docs
    |--"myportalApplication"
    |--"portalApp-project"
    So this means: after I checkout from CVS, I need to copy the two
    directories "myportalApplication" and "portalApp-project" from
    c:\myportalmodule into corresponding sub-directories under
    c:\myportaldomain, before I can do any development and testing. also,
    if I make some changes on c:\myportaldomain, and I want to checkin, I
    need to copy those files back to c:\myportalmodule. I tried to use
    directory softlink, but it windows NT just offer shortcut, which
    doesn't work.
    Can somebody give some education how to integerate the weblogic portal
    with CVS source control systems?
    Thanks very much

  • Help needed for newbie EJB

    Hi, all
    I am a newbie in EJB and I am following the example in the URL:
    http://www.huihoo.com/jboss/online_manual/3.0/
    I am working on the 'interest' example in the first chapter.
    When it come to 'Packaging and deploying the bean', I got some meaage like this:
    ant intro-interest-jar
    Buildfile: build.xml
    validate-servlet:
    validate-jboss:
    fail_if_not_valid:
    init:
    [echo] Using JBoss directory=/opt/jboss
    [echo] Using base classpath=/opt/jboss/client/jboss-j2ee.jar:/opt/jboss/client/jaas.jar:/opt/jboss/client/jbosssx-client.jar:/opt/jboss/client/jboss-client.jar:/opt/jboss/client/jnp-client.jar:/home/xiaobo/learningejb/examples/COULD_NOT_FIND_SERVLET_JAR
    [echo] Using Source directory=/home/xiaobo/learningejb/examples
    [echo] Using Build directory=/home/xiaobo/learningejb/examples/build-examples
    intro-interest-jar:
    compile:
    ejb-jar:
    [delete] Deleting directory /home/xiaobo/learningejb/examples/build-examples/interest/META-INF
    [mkdir] Created dir: /home/xiaobo/learningejb/examples/build-examples/interest/META-INF
    [copy] Copying 1 file to /home/xiaobo/learningejb/examples/build-examples/interest/META-INF
    [copy] Copying 1 file to /home/xiaobo/learningejb/examples/build-examples/interest/META-INF
    [jar] Building jar: /home/xiaobo/learningejb/examples/build-examples/interest/interest.jar
    BUILD SUCCESSFUL
    Total time: 2 seconds
    Why did I get this:
    /home/xiaobo/learningejb/examples/COULD_NOT_FIND_SERVLET_JAR.
    But if I check the "interest.jar" by using 'jar -tvf interest.jar' in the "~/learningejb/examples/build-examples/interest$" directory, it seems it had all files and directories in it.
    But if I copy this jar file into the deploy directory in jboss, and I check the log file 'server.log'
    I found this error message:
    2005-11-28 17:31:03,536 DEBUG [org.jboss.management.j2ee.LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.ejb:service=EJBDeployer,type=org.jboss.deployment.SubDeployer.stop,sequenceNumber=15,timeStamp=1133213463536,message=null,userData=org.jboss.deployment.DeploymentInfo@c36a9f52 { url=file:/opt/jboss-3.2.5/server/default/deploy/interest.jar }
    deployer: org.jboss.ejb.EJBDeployer@3c9c31
    status: Deployment FAILED reason: ejb-jar.xml must define a valid DOCTYPE!
    state: FAILED
    watch: file:/opt/jboss-3.2.5/server/default/deploy/interest.jar
    lastDeployed: 1133210324921
    lastModified: 1133210324000
    mbeans:
    Then I add the follwoing line into the 'ejb-jar.xml':
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    so the 'ejb-jar.xml' looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <description>JBoss Interest Sample Application</description>
    <display-name>Interest EJB</display-name>
    <enterprise-beans>
    <session>
    <ejb-name>Interest</ejb-name>
    <home>org.jboss.docs.interest.InterestHome</home>
    <remote>org.jboss.docs.interest.Interest</remote>
    <ejb-class>org.jboss.docs.interest.InterestBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    and I rejar it and copy the jar file into the deploy directory. I still got the same error message in the log file???!!!
    Please help!
    X.Chen

    It's a no brainer between the AirPort Extreme and Airport Express.
    The AirPort Extreme has 6 wireless antennas up at the top of the "tower", while the AirPort Express has four, so the Extreme has significantly better wireless speed and range than the Express.
    As you know, the broadcast power of wireless routers is limited by law, and most routers are running full blast. Apple routers are not known for their broadcast power, so what we cannot tell you is whether the Extreme will outperform the existing wireless router that you already have in terms of range.
    Also as you know, the speed of your Internet connection is limited to the plan that you have with Verizon. An Apple router cannot take the speed of Internet connection that it receives from your Verizon plan and make it go any faster.
    A user who has both the same Verizon router as you and an AirPort Extreme might be able to tell you how the products compare in his home.
    But...and this is a big BUT...... the bottom line with any wireless router is that you will not know how well it performs in your home until you try it out in your home. To think otherwise would be foolhardy at best.
    Buy from Apple and you have a 14 day return privilege in case things don't work as well as hoped. Other stores may offer a similar option. Check first, before you buy.

  • Urget help needed- PK with EJB 1.1/CMP 1.1

    I have some old code based on EJB 1.1 ,CMP 1.1 works on OC4J(9.0.02). Now going forward seems this does not work(seems it calls getprimarykey in ejbcreate in generated wrappers). Basically, I have a before insert trigger that generates nextval from oracle sequnece and we call create with
    all required columns and set the PK to null. Will this setting work in CMP
    for generating PK using oracle sequence. We are on OC4J so that is the hard part. Please share your experience. I am sure it will be valuable to many as this is a standard way in Oracle to use sequence.

    Hello,
    Here are some of the interesting readings that you can have a look at
    http://www.theserverside.com/patterns/thread.tss?thread_id=220
    http://forum.java.sun.com/thread.jspa?threadID=248408&messageID=1812745
    http://www-128.ibm.com/developerworks/websphere/library/techarticles/0402_brown/brown.html
    With CMP you should avoid using auto generated primary keys. I tried this using Websphere and Oracle it does not work.
    HTH
    VJ

  • Help: weblogic.ejb.extensions.LockTimedOutException

    Dear All:
              I got this exception in our EJB app:
              weblogic.ejb.extensions.LockTimedOutException. Please see attached error
              message below. It is not happening every time you call the bean. It is
              reproducable with patience.
              Have you had this kind of problem and more importantly, how to avoid it?
              Our env is: Wl51 with sp 10, jdk1.3.02, Sun Solaris Unix, a cluster contains
              2 wl instance
              Thanks.
              Wed Jun 19 14:26:53 EDT 2002:<I> <TX> Transaction (TxC (5488304, xid =
              1024502557372_6636, timeout = 300, txState = Marked Rollback, root = null)
              rolled back after 300 sec.
              [GC 99080K->85533K(130688K), 0.0227977 secs]
              Wed Jun 19 14:26:54 EDT 2002:<I> <EJB JAR deployment
              /webapp/dtshc/dts/nmc/ejb/nmcejb.jar> Transaction: '1024502557372_6636'
              rolled back due to EJB exception:
              weblogic.ejb.extensions.LockTimedOutException: Lock for
              primaryKey:com.mm.nmc.entity.ProducerOneYearPlanPK@1700fc timed out after
              300000 ms.
              at
              weblogic.ejb.internal.LockManagerImpl.waitForLock(LockManagerImpl.java:53)
              at weblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:146)
              at weblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:81)
              at weblogic.ejb.internal.StatefulEJBCache.bind(StatefulEJBCache.java:456)
              at
              weblogic.ejb.internal.StatefulEJBObject.getContextForInvoke(StatefulEJBObjec
              t.java:162)
              at weblogic.ejb.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:476)
              at
              com.mm.nmc.entity.ProducerOneYearPlanEJBEOImpl.getData(ProducerOneYearPlanEJ
              BEOImpl.java:979)
              at
              com.mm.nmc.session.PersonalTacticalSessionEJB.getTacticalPlanGoals(PersonalT
              acticalSessionEJB.java:200)
              at
              com.mm.nmc.session.PersonalTacticalSessionEJB.getPersonalTacticalPlan(Person
              alTacticalSessionEJB.java:165)
              at
              com.mm.nmc.session.PersonalTacticalSessionEJB.getPersonalTacticalPlan(Person
              alTacticalSessionEJB.java:155)
              at
              com.mm.nmc.session.PersonalTacticalSessionEJBEOImpl.getPersonalTacticalPlan(
              PersonalTacticalSessionEJBEOImpl.java:340)
              at
              com.mm.nmc.session.PersonalTacticalSessionEJBEOImpl_WLSkel.invoke(PersonalTa
              cticalSessionEJBEOImpl_WLSkel.java:167)
              at
              weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAda
              pter.java:347)
              at
              weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandle
              r.java:86)
              at
              weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:1
              5)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              Jiancai He
              http://www.hefamily.com
              

    Thanks for your message:
              In our case, it is entity EJB. The problem only happens in clustered env,
              and only happens in one of the servers.
              Question: can wl51 use database to manage the concurrent access of entity
              EJBs?
              Thanks.
              Jiancai
              Jiancai He
              http://www.hefamily.com
              "ludovic le goff" <[email protected]> wrote in message
              news:[email protected]...
              > Hello,
              >
              > Basically, it means two (or more) different threads are trying to get an
              > exclusive lock on the same entity bean or stateful session bean at the
              same
              > time. One of the locks eventually times out and this exception is thrown.
              >
              > There are several things that could cause this, for instance:
              >
              > - Two threads trying to invoke a method on the same stateful session bean
              at
              > the same time. The EJB 1.1 spec states that the server must detect this
              > condition and throw a RemoteException to all subsequent callers.
              > LockTimedOutException is a sub-class of java.rmi.RemoteException.
              >
              > - Two threads are trying to access the same entity bean instance inside a
              > single server in the cluster, and the caller holding the lock does not
              > finish fast enough.
              >
              > You might want to check if you have declared the Remote and home interface
              > in your jsp/servlet as global variable. And since it's global, instance
              > getting overridden every time. That's why both the two request end up in
              > using the same EJBObject.
              >
              > You should changed your code and make the remote/home interface variable
              > declaration as local i.e. within the scope of a single request.
              > Then you should not see any problem. Both the threads will use different
              > EJBObjects and hence you should not see any exceptions.
              >
              > You need to code in such a way as to avoid deadlocks. For instance, if
              > more than one client accesses the EJBs in different order, a deadlock may
              > occur. This deadlock is detected and after a certain timeout (5 minutes by
              > default), the deadlock is removed and one of the clients gets a
              > LockTimedOutException. For example, if one request in your application has
              > entity Account 1 (by doing an ejbFindByPrimaryKey) and is then about to
              get
              > Customer 1, and if at the same time another request in another business
              > method has got Customer 1 and is waiting for Account 1, you'll get a
              > deadlock and a LockTimedOutException after 5 minutes. You could avoid
              this
              > by include the code in a synchronized block. You could also get a
              deadlock
              > if you're making a reentrant call, e.g., A calls B which calls back to A.
              >
              > If you haven't already seen this, here's a blurb from "Locking Model for
              > Entity EJBs" at
              >
              http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_environment.html#108796
              > 7 that you might find interesting:
              >
              > The EJB 1.1 container in WebLogic Server Version 5.1 uses a pessimistic
              > locking mechanism for entity EJB instances. As clients enlist an EJB or
              EJB
              > method in a transaction, WebLogic Server places an exclusive lock on the
              EJB
              > instance or method for the duration of the transaction. Other clients
              > requesting the same EJB or method block until the current transaction
              > completes.
              >
              > This method of locking provides reliable access to EJB data, and avoids
              > unnecessary calls to ejbLoad() to refresh the EJB instance's persistent
              > fields. However, in certain circumstances pessimistic locking may not
              > provide the best model for concurrent access to the EJB's data. Once a
              > client has locked an EJB instance, other clients are blocked from the
              EJB's
              > data even if they intend only to read the persistent fields.
              >
              > In a Nutshell the first exception is a consequence of the second.
              >
              > Hope this helps,
              > Ludovic.
              > Developer Relations Engineer
              > BEA Customer Support
              > "newsgroups.bea.com" <[email protected]> a écrit dans le message news:
              > [email protected]...
              > > Dear All:
              > >
              > > I got this exception in our EJB app:
              > > weblogic.ejb.extensions.LockTimedOutException. Please see attached error
              > > message below. It is not happening every time you call the bean. It is
              > > reproducable with patience.
              > >
              > > Have you had this kind of problem and more importantly, how to avoid it?
              > >
              > > Our env is: Wl51 with sp 10, jdk1.3.02, Sun Solaris Unix, a cluster
              > contains
              > > 2 wl instance
              > >
              > > Thanks.
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > > Wed Jun 19 14:26:53 EDT 2002:<I> <TX> Transaction (TxC (5488304, xid =
              > > 1024502557372_6636, timeout = 300, txState = Marked Rollback, root =
              null)
              > > rolled back after 300 sec.
              > >
              > > [GC 99080K->85533K(130688K), 0.0227977 secs]
              > >
              > > Wed Jun 19 14:26:54 EDT 2002:<I> <EJB JAR deployment
              > > /webapp/dtshc/dts/nmc/ejb/nmcejb.jar> Transaction: '1024502557372_6636'
              > > rolled back due to EJB exception:
              > >
              > > weblogic.ejb.extensions.LockTimedOutException: Lock for
              > > primaryKey:com.mm.nmc.entity.ProducerOneYearPlanPK@1700fc timed out
              after
              > > 300000 ms.
              > >
              > > at
              > >
              weblogic.ejb.internal.LockManagerImpl.waitForLock(LockManagerImpl.java:53)
              > >
              > > at weblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:146)
              > >
              > > at weblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:81)
              > >
              > > at
              weblogic.ejb.internal.StatefulEJBCache.bind(StatefulEJBCache.java:456)
              > >
              > > at
              > >
              >
              weblogic.ejb.internal.StatefulEJBObject.getContextForInvoke(StatefulEJBObjec
              > > t.java:162)
              > >
              > > at weblogic.ejb.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:476)
              > >
              > > at
              > >
              >
              com.mm.nmc.entity.ProducerOneYearPlanEJBEOImpl.getData(ProducerOneYearPlanEJ
              > > BEOImpl.java:979)
              > >
              > > at
              > >
              >
              com.mm.nmc.session.PersonalTacticalSessionEJB.getTacticalPlanGoals(PersonalT
              > > acticalSessionEJB.java:200)
              > >
              > > at
              > >
              >
              com.mm.nmc.session.PersonalTacticalSessionEJB.getPersonalTacticalPlan(Person
              > > alTacticalSessionEJB.java:165)
              > >
              > > at
              > >
              >
              com.mm.nmc.session.PersonalTacticalSessionEJB.getPersonalTacticalPlan(Person
              > > alTacticalSessionEJB.java:155)
              > >
              > > at
              > >
              >
              com.mm.nmc.session.PersonalTacticalSessionEJBEOImpl.getPersonalTacticalPlan(
              > > PersonalTacticalSessionEJBEOImpl.java:340)
              > >
              > > at
              > >
              >
              com.mm.nmc.session.PersonalTacticalSessionEJBEOImpl_WLSkel.invoke(PersonalTa
              > > cticalSessionEJBEOImpl_WLSkel.java:167)
              > >
              > > at
              > >
              >
              weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAda
              > > pter.java:347)
              > >
              > > at
              > >
              >
              weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandle
              > > r.java:86)
              > >
              > > at
              > >
              >
              weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:1
              > > 5)
              > >
              > > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              > >
              > >
              > >
              > >
              > >
              > >
              > > --
              > > Jiancai He
              > > http://www.hefamily.com
              > >
              > >
              >
              >
              

  • Deploy ejb on wls7.0 weblogic.ejb.jar.xml ! help

    Morning !
    i'm try to deploy a EJB on wls7.0
    my descriptor is like this and i don't really undestand what's go wrong.
    thanks you to help
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 7.0.0
    EJB//EN" "http://www.bea.com/servers/wls700/dtd/weblogic700-ejb-jar.dtd" >
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <entity>
    <ejb-name>Compte</ejb-name>
    <bean-home-name>Compte</bean-home-name>
    <resource-ref>
    <res-ref-name>jdbc/DataSource</res-ref-name>
    <jndi-name>DataSource</jndi-name>
    </resource-ref>
    <cmp-info>
    <database-map>
    <table>"Compte"</table>
    <column-map>
    <field-name>id</field-name>
    <column-name>"id"</column-name>
    </column-map>
    <column-map>
    <field-name>nomSte</field-name>
    <column-name>"nomSte"</column-name>
    </column-map>
    <column-map>
    <field-name>dateCreation</field-name>
    <column-name>"dateCreation"</column-name>
    </column-map>
    <column-map>
    <field-name>nbEmployes</field-name>
    <column-name>"nbEmployes"</column-name>
    </column-map>
    <column-map>
    <field-name>caSte</field-name>
    <column-name>"caSte"</column-name>
    </column-map>
    <column-map>
    <field-name>descSte</field-name>
    <column-name>"descSte"</column-name>
    </column-map>
    <column-map>
    <field-name>logo</field-name>
    <column-name>"logo"</column-name>
    </column-map>
    <column-map>
    <field-name>id_commercial</field-name>
    <column-name>"id_commercial"</column-name>
    </column-map>
    </database-map>
    <finder>
    <method-signature>findAll()</method-signature>
    <where-clause />
    <load-state>True</load-state>
    </finder>
    </cmp-info>
    </entity>
    <datasource-definitions>
    <datasource>
    <jndi-name>DataSource</jndi-name>
    <url>jdbc:odbc:dev_java</url>
    <username>sa</username>
    <password>lnx.sully</password>
    <driver-class-name>sun.jdbc.odbc.JdbcOdbcDriver</driver-class-name>
    </datasource>
    </datasource-definitions>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    the EXception is !
    Exception
    weblogic.management.ApplicationException: No deployment found at
    E:\bea70\weblogic700\server\bin\GRPEJB.jar.
    at
    weblogic.j2ee.J2EEApplicationContainerFactory.initializeDeployment(J2EEAppli
    cationContainerFactory.java:350)
    at
    weblogic.management.deploy.DeployerRuntime.unprotectedActivate(DeployerRunti
    me.java:350)
    at
    weblogic.management.deploy.DeployerRuntime.access$0(DeployerRuntime.java:282
    at
    weblogic.management.deploy.DeployerRuntime$1.run(DeployerRuntime.java:947)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:721)
    at
    weblogic.management.deploy.DeployerRuntime.checkAndPerformDeployerActions(De
    ployerRuntime.java:941)
    at
    weblogic.management.deploy.DeployerRuntime.activate(DeployerRuntime.java:279
    at java.lang.reflect.Method.invoke(Native Method)
    at
    weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl
    .java:717)
    at
    weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:6
    99)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
    at
    weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerI
    mpl.java:921)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:470)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:198)
    at $Proxy48.activate(Unknown Source)
    at
    weblogic.management.console.actions.mbean.ConfigureAppWizardAction.commit(Co
    nfigureAppWizardAction.java:248)
    at
    weblogic.management.console.actions.mbean.ConfigureAppWizardAction.perform(C
    onfigureAppWizardAction.java:100)
    at
    weblogic.management.console.actions.internal.ActionServlet.doAction(ActionSe
    rvlet.java:171)
    at
    weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServ
    let.java:85)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:945)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :332)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :242)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5360)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:721)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3043)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2468)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    tahnks you !
    Unimon Thierry
    CGBI- CET-E-services
    69, Blvd Galliéni
    91 Issy les Mlx
    tele :01/55/95/54/22 Poste:5422
    Port :06/61/81/78/59
    Prof : mailto:[email protected]
    Pers : mailto:[email protected]

    oops! Pls ignore my previous mail. It was for a different problem.
    FOr the original problem of "couldn ot locate the bean with the ejb-name XZY in weblogic-ejb-jar.xml":
    This happens if you don't have the below files defined
    for a JAR/EAR file:
    weblogic-ejb-jar.xml and weblogic-cmp-rdbms-jar.xml (needed if you have any Datasource mapped)
    These two are basic files required for any JAR/EAR file.
    If you dont' have it already you can generate them using
    $WLS_HOME/bin/startWLBuilder.sh GUI tool bundled along
    with WLS (I used 8.1 SP4) to generate these files ! This tool is really helpful.
    - Mouli

  • EJB ACLs and permissions, help needed urgently

    Hello,
    I am using WL6.1. I need to use weblogic.security.acl.Security.checkPermission
    to check if a user has permission to acess an EJB method. I know one can call
    the method and check the exception to see yes or no. But that requires knowing
    the method signature (parameters and return types etc.).
    I read the documentation and here is what I got:
    ACLs and permissions for WebLogic EJBs differ from ACLs and permissions for other
    kinds of WebLogic Server resources in the following ways:
    1. EJB ACLs are configured in the access control properties of the EJB's deployment
    descriptor.
    2. Permissions are granted on individual methods of a bean; there are no predefined
    permissions.
    3. Permissions on EJBs are granted to Roles, which map to groups in WebLogic Server.
    So if I read it correctly:
    1. One does not need to use WL console to configure EJB ACLs? If otherwise, how
    do we do it?. There is no documentation for it.
    2. What is the ACLName to use when I call the method weblogic.security.acl.Security.checkPermission(java.security.Principal
    principal, java.lang.String aclName,
    java.security.acl.Permission permission,
    char sep)?
    I tried with JNDI name and EJB name and nothing seems to work.
    Can anyone help me out?
    Thanks.
    Ling Wang

    It all depends on where do you want to keep your ACLs and the rest of security.
    Simplest will be fileRealm, but it has limited capability (10k ACLs I recall).
    You do not heed console to set it up. Here is an excert from ACL file:
    acl.read.OT_INTEGRATIONOBJREF=everyone
    acl.read.OT_ORGTRANSPORT=OrgAdmin,AppAdmin
    acl.read.OT_ORGUNITOFMEASURE=OrgAdmin,AppAdmin
    # from nonWorkflowEvents.template
    acl.execute.ET_QUERY=everyone
    acl.execute.ET_BATCH=everyone
    read/execute is action. Caps keep resource (name). On the right hand is a list
    of roles. The security call will be lokking like:
    boolean result = Security.hasPermission("ET_BATCH",
    new PermissionImpl("read"), '.');
    It does not throw, just returns a boolean.
    Now, this is all about programmatic security. If you are up to declarative, you
    need to assign role names to method names in deployment descriptor of your bean
    and map them to actual roles.
    Also you may have problems while asking security question about another principal
    (nto the one currently logged in). Not that it does not work -- just needs caution.
    Hope it helps.
    "Ling Wang" <[email protected]> wrote:
    >
    Hello,
    I am using WL6.1. I need to use weblogic.security.acl.Security.checkPermission
    to check if a user has permission to acess an EJB method. I know one
    can call
    the method and check the exception to see yes or no. But that requires
    knowing
    the method signature (parameters and return types etc.).
    I read the documentation and here is what I got:
    ACLs and permissions for WebLogic EJBs differ from ACLs and permissions
    for other
    kinds of WebLogic Server resources in the following ways:
    1. EJB ACLs are configured in the access control properties of the EJB's
    deployment
    descriptor.
    2. Permissions are granted on individual methods of a bean; there are
    no predefined
    permissions.
    3. Permissions on EJBs are granted to Roles, which map to groups in WebLogic
    Server.
    So if I read it correctly:
    1. One does not need to use WL console to configure EJB ACLs? If otherwise,
    how
    do we do it?. There is no documentation for it.
    2. What is the ACLName to use when I call the method weblogic.security.acl.Security.checkPermission(java.security.Principal
    principal, java.lang.String aclName,
    java.security.acl.Permission permission,
    char sep)?
    I tried with JNDI name and EJB name and nothing seems to work.
    Can anyone help me out?
    Thanks.
    Ling Wang

  • Weblogic.ejb.extensions.LockTimeOutException HELP!

    Hi,
    We're seeing weblogic.ejb.extensions.LockTimeOutException when we try
    to access some Entity Bean's data member. I'm wondering someone could
    help us?
    There is some background:
    WL server 5.1, SP10 (almost sure:)
    Running in Solaris w/ Oracle 8i
    The sequence of calls is:
    IWorkspaceRemote workspace = (IWorkspaceRemote)
    getEntityBean(EJBConstants.JNDI_NAME_WORKSPACE, new
    Long(workspaceID));
    WorkspaceDetailData wsData = workspace.getWorkspaceDetailData();
    ( the EJB home is cached in memory ***)
    Inside ejbLoad() we're using the Composite Entity EJB pattern (for
    lazy loading) and looks something like this:
    void ejbLoad() {
    m_baseData = loadBaseData();
    if (m_detailData != null) {
    m_detailData = loadDetailData();
    DetailData getWorkspaceDetailData() {
    if (m_detailData == null) {
    m_detailData = loadDetailData();
    THe stack trace I get is:
    weblogic.ejb.extensions.LockTimedOutException: Lock for
    primaryKey:21071 timed out after 60000 ms.
    at weblogic.ejb.internal.LockManagerImpl.waitForLock(LockManagerImpl.java:53)
    at weblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:146)
    at weblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:81)
    at weblogic.ejb.internal.StatefulEJBCache.bind(StatefulEJBCache.java:456)
    at weblogic.ejb.internal.StatefulEJBObject.getContextForInvoke(StatefulEJBObject.java:162)
    at weblogic.ejb.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:476)
    at com.intralinks.wsadmin.entity.WorkspaceBeanEOImpl.getWorkspaceDetailData(WorkspaceBeanEOImpl.java:155)
    at com.intralinks.util.IntralinksServlet.setWorkspaceIDNoEventLogging(Unknown
    Source)
    at com.intralinks.util.IntralinksServlet.setWorkspaceID(Unknown
    Source)
    at com.intralinks.servlets.html.workspaces.EnterWorkspaceServlet.process(Unknown
    Source)
    Any ideas?
    Thanks,
    - Roberto

    Hi Roberto,
    Check CP, data sources (if they are available in 5.1) etc for oracle instance
    parameters like servers, user ids, passwords, urls etc.
    S
    [email protected] (Roberto) wrote:
    Hi,
    We're seeing weblogic.ejb.extensions.LockTimeOutException when we try
    to access some Entity Bean's data member. I'm wondering someone could
    help us?
    There is some background:
    WL server 5.1, SP10 (almost sure:)
    Running in Solaris w/ Oracle 8i
    The sequence of calls is:
    IWorkspaceRemote workspace = (IWorkspaceRemote)
    getEntityBean(EJBConstants.JNDI_NAME_WORKSPACE, new
    Long(workspaceID));
    WorkspaceDetailData wsData = workspace.getWorkspaceDetailData();
    ( the EJB home is cached in memory ***)
    Inside ejbLoad() we're using the Composite Entity EJB pattern (for
    lazy loading) and looks something like this:
    void ejbLoad() {
    m_baseData = loadBaseData();
    if (m_detailData != null) {
    m_detailData = loadDetailData();
    DetailData getWorkspaceDetailData() {
    if (m_detailData == null) {
    m_detailData = loadDetailData();
    THe stack trace I get is:
    weblogic.ejb.extensions.LockTimedOutException: Lock for
    primaryKey:21071 timed out after 60000 ms.
    at weblogic.ejb.internal.LockManagerImpl.waitForLock(LockManagerImpl.java:53)
    at weblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:146)
    at weblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:81)
    at weblogic.ejb.internal.StatefulEJBCache.bind(StatefulEJBCache.java:456)
    at weblogic.ejb.internal.StatefulEJBObject.getContextForInvoke(StatefulEJBObject.java:162)
    at weblogic.ejb.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:476)
    at com.intralinks.wsadmin.entity.WorkspaceBeanEOImpl.getWorkspaceDetailData(WorkspaceBeanEOImpl.java:155)
    at com.intralinks.util.IntralinksServlet.setWorkspaceIDNoEventLogging(Unknown
    Source)
    at com.intralinks.util.IntralinksServlet.setWorkspaceID(Unknown
    Source)
    at com.intralinks.servlets.html.workspaces.EnterWorkspaceServlet.process(Unknown
    Source)
    Any ideas?
    Thanks,
    - Roberto

  • URGENT HELP NEEDED ... Tomcat Realm and JRE1.4 plug-in problem

    I have tried the Security Realm of Tomcat. Since I do not have
    an LDAP server, I decided to use the Tomcat-users.xml file in
    Tomcat\conf directory.
    I added the following lines of code in the web.xml file.
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>Entire Application</web-resource-name>
    <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <!-- NOTE: This role is not present in the default users file -->
    <role-name>webviewer</role-name>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>Tomcat Manager Application</realm-name>
    </login-config>
    The <role-name> "webviewer" is added into "Tomcat-Users.xml" as the following:
    <tomcat-users>
    <user name="test" password="password" roles="webviewer" />
    </tomcat-users>
    So, now when we type the url: http://localhost:8080/adbpdbre/default.htm, TOMCAT shows a dialog box asking for UserName: and Password:Now, only when we give the username and password, it shows the page. This is exactly what we want.
    But the problem now is, this default.htm page, has 5 links to 5 applets. The first time that I click on one of these links, the JRE plug of 1.4 shows a dialog again asking for the username and password. Till I dont provide the username and password the system doesnt go ahead and applet doesnt load. I do not want the JRE to ask me for the username/passwords again..How to avoid this ?
    Can you give me some more information on this. Ultimately in the production usage, we will be using LDAP and not Tomcat's memory realm.
    URGENT HELP NEEDED ... I need to get back to my client on this.
    Help would be v. much appreciated.

    In the config file, you 're essentially saying that you want Tomcat to prompt for usr/passw on every request (url-pattern = /*) made by a 'webviewer', and that's exactly what Tomcat is doing.
    Consider using specific url-patterns & roles for resources to be protected. If for now, all you need is to protect the first page, use a more specific url-pattern.
    Just an advice : if you'll be using LDAP in production, do not waste time with Tomcat's Security Realm and the BASIC authentication type, since the two have not much in common. Start reading doc on LDAP, and code a prototype, or even better, a vertical slice of the app (i.e a proof of concept).

  • Help needed to run JSTL 1.1 in Tomcat 6.0.16

    Hi All,Help needed to run JSTL 1.1 in Tomcat 6.0.16. I am trying to run the example given in http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html The example tries to connect to MySQL database from JSP using JSTL and JNDI Datasource.I am running the example using Eclipse 3.4.2 using Sysdeo plugin to start and stop Tomcat server from Eclipse IDE.
    My web.xml file has <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    </web-app>
    and test.jsp has proper taglib directives
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    I have placed the jstl.jar and standard.jarof the jakarta-taglibs-standard-1.1.2.zip under E:\Deepa\workspace\DBTest\WebContent\WEB-INF\lib directory also placedcontext.xml file under E:\Deepa\workspace\DBTest\WebContent\META-INF and the content of context.xml is as below
    <Context path="/DBTest" docBase="DBTest"
    debug="5" reloadable="true" crossContext="true">
    <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
    maxActive="100" maxIdle="30" maxWait="10000"
    username="deepa" password="mysql" driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>
    </Context>
    Now while running the example, Eclipse creates one DBTest.xml file under C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\Catalina\localhost
    which has the following line:
    <Context path="/DBTest" reloadable="true" docBase="E:\Deepa\workspace\DBTest" workDir="E:\Deepa\workspace\DBTest\work" />
    I am getting the following error when running http://localhost/DBTest/WebContent/test.jsp
    in Browser:
    <HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml or the jar files deployed with this application
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
    org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:315)
    org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:148)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:431)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:494)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444)
    org.apache.jasper.compiler.Parser.parse(Parser.java:138)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:154)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    In the Tomcat Server console, I am getting the following error:
    INFO: Server startup in 7295 ms
    May 20, 2009 6:36:48 AM org.apache.jasper.compiler.TldLocationsCache processWebDotXml
    WARNING: Internal Error: File /WEB-INF/web.xml not found
    May 20, 2009 6:36:48 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml or the jar files deployed with this application
    what is the problem with my code?
    When running the same example, by creating a local server in Eclipse(creating new Server connection pointing to same Tomcat 6.0 installation) it runs fine without any error.

    Hi evnafets,
    Wow, very helpful information, great insight into working of Eclipse. Thanks a lot.
    I have one more question. I have a context.xml file under {color:#0000ff}E:\Deepa\workspace\DBTest\WebContent\META-INF{color} folder and that has the Resource element to connect to MySQL database:
    {code{color:#000000}}{color}<Context path="/DBTest" docBase="DBTest" debug="5" reloadable="true" crossContext="true">
    <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="deepa" password="mysql" driverClassName="com.mysql.jdbc.Driver"
    {color:#0000ff}url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>{color}
    {color:#0000ff}</Context>{color}As usual when running application in local Tomcat server of Eclipse, this data source works fine. But when I run the application on Tomcat, by starting Sysdeo plugin from Eclipse, the DBTest.xml file created in C:\Tomcat 6.0\conf\Catalina\localhost has the context entry as<Context path="/DBTest" reloadable="true" docBase="E:\Deepa\workspace\DBTest\WebContent" workDir="E:\Deepa\workspace\DBTest\work">
    </Context>The<Resource> element I have specified in the context.xml of \WebContent\META-INF folder is not taken into account by Tomcat and it gives the following error:May 21, 2009 5:20:04 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException_: Cannot create JDBC driver of class '' for connect URL 'null'"
    _at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(_QueryTagSupport.java:276_)
    at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(_QueryTagSupport.java:159_)
    at org.apache.jsp.test_jsp._jspx_meth_sql_005fquery_005f0(_test_jsp.java:113_)
    at org.apache.jsp.test_jsp._jspService(_test_jsp.java:66_)
    at org.apache.jasper.runtime.HttpJspBase.service(_HttpJspBase.java:70_)
    at javax.servlet.http.HttpServlet.service(_HttpServlet.java:717_)
    at org.apache.jasper.servlet.JspServletWrapper.service(_JspServletWrapper.java:374_)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(_JspServlet.java:342_)
    at org.apache.jasper.servlet.JspServlet.service(_JspServlet.java:267_)
    at javax.servlet.http.HttpServlet.service(_HttpServlet.java:717_)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(_ApplicationFilterChain.java:290_)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(_ApplicationFilterChain.java:206_)
    at org.apache.catalina.core.StandardWrapperValve.invoke(_StandardWrapperValve.java:233_)
    at org.apache.catalina.core.StandardContextValve.invoke(_StandardContextValve.java:191_)
    at org.apache.catalina.core.StandardHostValve.invoke(_StandardHostValve.java:128_)
    at org.apache.catalina.valves.ErrorReportValve.invoke(_ErrorReportValve.java:102_)
    at org.apache.catalina.core.StandardEngineValve.invoke(_StandardEngineValve.java:109_)
    at org.apache.catalina.connector.CoyoteAdapter.service(_CoyoteAdapter.java:286_)
    at org.apache.coyote.http11.Http11Processor.process(_Http11Processor.java:845_)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(_Http11Protocol.java:583_)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(_JIoEndpoint.java:447_)
    at java.lang.Thread.run(_Thread.java:619_)
    {code}
    So to overcome this error I had to place the <Resource> element in DBTest.xml under C:\Tomcat 6.0\conf\Catalina\localhost {color:#000000}and then it works fine. {color}{color:#ff0000}*Why is the context.xml file in META-INF not considered by Tomcat server using Sysdeo Plugin?*
    *Thanks,*
    *Deepa*{color}
    {color}
    Edited by: Deepa76 on May 26, 2009 9:32 PM

  • Help needed in EJB - to call AS from EJB a Session Bean

    Hi All ,
    I have been strictly told not to use Web Services as all the applications are on the same server
    actually I have to make an EJB invocation to an Application Service from the CAF layer from a Session Bean of another EJB Project(Not a CAF Service).
    the CAF layer has 5 parts metadata , permissions , dictionary , ear and ejbmodule.
    I added the ejbModule to the Build Path of the calling EJB Session Bean. And so I was able to access the operations of the Application Service which in turn accesses a BAPI(The Appl Service operation returns a String).
    But while executing I got the exception java.lang.RuntimeException: java.lang.NoClassDefFoundError
    My method :
    Normally from a Dynamic Web Project acting as a client to an EJB Session bean, I was able to get access to EJB Local Interface by using
      private ConverterLocal converterBean = null;
      public void jspInit() {
        try {
         InitialContext ic = new InitialContext();
         converterBean = (ConverterLocal)
         ic.lookup("java:comp/env/Converter");
        } catch (Exception ex) {
             System.out.println("Couldn't create converter bean."+
           ex.getMessage());
    BigDecimal dollarAmount =  converterBean.euroToDollar(value);
    So I created a JNDI field in ejb-j2ee-engine.xml
    enterprise-beans>
            <enterprise-bean>
         <ejb-name>com.sap*******.bapi_company_getlist.BAPI_COMPANY_GETLIST</ejb-name>
                   <jndi-name>COMPANY</jndi-name>
                </enterprise-bean>
    </enterprise-beans>
    And from my Session Bean , I tried to access it using the code in already existing Bean which was working fine
    BAPI_COMPANY_GETLISTBeanImpl bean = new BAPI_COMPANY_GETLISTBeanImpl();
              try {
                   InitialContext ctx = new InitialContext();
                   bean = (BAPI_COMPANY_GETLISTBeanImpl)ctx.lookup("COMPANY");
              } catch (NamingException e) {
                   System.out.println("Converter Bean can't be created");
                   String send = bean.returnDetails();
    And I tried to print the String , but I got the above error
    I have a doubt :
    1) How do I specify the JNDI name ie in the ejb-j2ee-engine.xml file , what should I add as the name of the ejb
    is this sufficient , or are there more steps ??

    Hi Ekaterina,
    I have the document to access my Bean from another Bean.
    I could access my Bean from a standalone Java class with this code
    Properties props = new Properties();
              props.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
              props.put(Context.PROVIDER_URL,"hostname:port");
              try{
                   Context ctx = new InitialContext(props);
                   Object o = ctx.lookup("sap.com/TestEAR/REMOTE/TestBean/com.@#$.TestRemote");
                   TestRemote testRem = (TestRemote)javax.rmi.PortableRemoteObject.narrow(o, TestRemote.class);
                   String msg = testRem.getMessage();
                   System.out.println(msg);
    And in this document there is a way shown to access a bean from another Bean.
       http://help.sap.com/saphelp_nw04/helpdata/en/13/c8633e0084e946e10000000a114084/frameset.htm
    If your client is another enterprise bean, declare the EJB reference in the ejb-jar.xml.
    -For more information, see Declaring EJB References.
    But the problem is that in EJB 3.0 ,  I can't see the ejb-jar.xml file .
    So how should I have a Bean as a client to another Bean, I am not that familiar with Annotations.

  • I Need Help to Access The Source Code From A Form to Know the Calculation Formula

    Hi,
    I Need Help to Access The Source Code From A Form to Know the Calculation Formula. The application is a windows form application that is linked to SQL Server 2008. In one of the application forms it generates an invoice and does some calculations. I just
    need to know where behind that form is the code that's doing the calculations to generate the invoice, I just need to get into the formula that's doing these calculations.
    Thank you so much.

    Hi, 
    Thanks for the reply. This is a view and [AmountDue] is supposed to be [CurrentDueAmount] + [PastDueAmount] - [PaidAmount]. The view is not calculating [PaidAmount] right . Below is the complete code of the view. Do you see anything wrong in the code ?
    Thanks. 
    SELECT     [isi].[InvoiceID], [ii].[DueDate], [SubInvoiceID] = [isi].[ID], [INV_FacilityID] = [if].[ID], [if].[FacilityID],
    [iff].[FacilityFeeID], [LoanID] = NULL, [isi].[PortfolioID], [isi].[Portfolio], 
                          [PaymentType] = [isis_fee].[SectionType], [Name]
    = [iff].[Name], [ReceivedAmount], [dates].[CurrentDueAmount], 
                          [PastDueAmount] = CASE WHEN ISNULL([ReceivedAmount],
    0) > 0 THEN [pastdue].[PastDueFeeAmount] + ISNULL([ReceivedAmount], 0) 
                          WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply reset to current. */ CASE WHEN [pastdue].[PastDueFeeAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN 0 ELSE [pastdue].[PastDueFeeAmount]
    + ISNULL([ReceivedAmount], 0) END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [pastdue].[PastDueFeeAmount] < 0 THEN 0 ELSE
    [pastdue].[PastDueFeeAmount] END, [PaidAmount] = CASE WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [pastdue].[PastDueFeeAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN - ([pastdue].[PastDueFeeAmount]
    + ISNULL([ReceivedAmount], 0)) ELSE 0 END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [pastdue].[PastDueFeeAmount] < 0 THEN - [pastdue].[PastDueFeeAmount]
    ELSE 0 END, [AmountDue] = [unpaid].[UnpaidFeeAmount], [ID] = [iff].[FacilityFeeID]
    FROM         [dbo].[INV_SubInvoice] isi JOIN
                          [dbo].[INV_Invoice] ii ON [isi].[InvoiceID]
    = [ii].[ID] JOIN
                          [dbo].[INV_Facility] [if] ON [isi].[ID] = [if].[SubInvoiceID]
    JOIN
                          [dbo].[INV_FacilityFee] iff ON [if].[ID] = [iff].[INV_FacilityID]
    JOIN
                              (SELECT     [sis_fee].[ID],
    [sis_fee].[SectionTypeCode], [SectionType] = [st_fee].[Name], [sis_fee].[INV_FacilityFeeID]
                                FROM      
       [dbo].[INV_SubInvoiceSection] sis_fee JOIN
                   [dbo].[INV_SectionType] st_fee ON [sis_fee].[SectionTypeCode] = [st_fee].[Code]
                                WHERE      [INV_FacilityFeeID]
    IS NOT NULL AND [StatusCode] = 'BILL') isis_fee ON [iff].[ID] = [isis_fee].[INV_FacilityFeeID] JOIN
                              (SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                   [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedFeeAmount]), 
                   [ReceivedAmount] = SUM([iffa].[ReceivedFeeAmount])
                                FROM      
       [dbo].[INV_FacilityFeeAccrual] iffa
                                GROUP BY [iffa].[SectionID])
    dates ON [isis_fee].[ID] = [dates].[SectionID] LEFT JOIN
                              (SELECT     *
                                FROM      
       [dbo].[INV_FacilityFeeAccrual]) unpaid ON [dates].[SectionID] = [unpaid].[SectionID] AND 
                          [dates].[AccrualDeterminationDateMax] = [unpaid].[AccrualDeterminationDate]
    LEFT JOIN
                              (SELECT     [SectionID],
    [PastDueFeeAmount] = SUM([PastDueFeeAmount])
                                FROM      
       [dbo].[INV_FacilityFeeAccrual]
                                GROUP BY [SectionID]) pastdue
    ON [dates].[SectionID] = [pastdue].[SectionID]
    UNION
    SELECT     [isi].[InvoiceID], [ii].[DueDate], [SubInvoiceID] = [isi].[ID], [INV_FacilityID] = [if].[ID], [if].[FacilityID],
    [FacilityFeeID] = NULL, [il].[LoanID], [isi].[PortfolioID], [isi].[Portfolio], 
                          [PaymentType] = [isis_loan].[SectionType], [Name]
    = [il].[Name], [ReceivedAmount], [CurrentDueAmount], [PastDueAmount] = CASE WHEN ISNULL([ReceivedAmount], 
                          0) > 0 THEN [PastDueAmount] + ISNULL([ReceivedAmount],
    0) WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN 0 ELSE [PastDueAmount] + ISNULL([ReceivedAmount],
    0) END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN 0 ELSE [PastDueAmount]
    END, 
                          [PaidAmount] = CASE WHEN [isis_loan].[SectionTypeCode]
    = 'LOAN_PRIN' THEN 0 ELSE CASE WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN - ([PastDueAmount] + ISNULL([ReceivedAmount],
    0)) ELSE 0 END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN - [PastDueAmount]
    ELSE 0 END END, 
                          [AmountDue] = CASE WHEN [isis_loan].[SectionTypeCode]
    = 'LOAN_PRIN' THEN [CurrentDueAmount] ELSE [unpaid].[AmountDue] END, [ID] = [il].[LoanID]
    FROM         [dbo].[INV_SubInvoice] isi JOIN
                          [dbo].[INV_Invoice] ii ON [isi].[InvoiceID]
    = [ii].[ID] JOIN
                          [dbo].[INV_Facility] [if] ON [isi].[ID] = [if].[SubInvoiceID]
    JOIN
                          [dbo].[INV_Loan] il ON [if].[ID] = [il].[INV_FacilityID]
    JOIN
                              (SELECT     [sis_loan].[ID],
    [sis_loan].[SectionTypeCode], [SectionType] = [st_loan].[Name], [sis_loan].[INV_LoanID]
                                FROM      
       [dbo].[INV_SubInvoiceSection] sis_loan JOIN
                   [dbo].[INV_SectionType] st_loan ON [sis_loan].[SectionTypeCode] = [st_loan].[Code]
                                WHERE      [INV_LoanID]
    IS NOT NULL AND [StatusCode] = 'BILL') isis_loan ON [il].[ID] = [isis_loan].[INV_LoanID] JOIN
                              (SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                   [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[ExpectedPrincipalAmount]), 
                   [ReceivedAmount] = SUM([ReceivedPrincipalAmount])
                                FROM      
       [dbo].[INV_LoanPrincipalAmortization] iffa
                                GROUP BY [iffa].[SectionID]
                                UNION
                                SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                  [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedInterestAmount]), 
                  [ReceivedAmount] = SUM([ReceivedInterestAmount])
                                FROM      
      [dbo].[INV_LoanCashInterestAccrual] iffa
                                GROUP BY [iffa].[SectionID]
                                UNION
                                SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                  [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedInterestAmount]), 
                  [ReceivedAmount] = SUM([ReceivedInterestAmount])
                                FROM      
      [dbo].[INV_LoanPIKInterestAccrual] iffa
                                GROUP BY [iffa].[SectionID])
    dates ON [isis_loan].[ID] = [dates].[SectionID] LEFT JOIN
                              (SELECT     [AmountDue]
    = [UnpaidPrincipalAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
       [dbo].[INV_LoanPrincipalAmortization]
                                UNION
                                SELECT     [AmountDue]
    = [UnpaidInterestAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
      [dbo].[INV_LoanCashInterestAccrual]
                                UNION
                                SELECT     [AmountDue]
    = [UnpaidInterestAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
      [dbo].[INV_LoanPIKInterestAccrual]) unpaid ON [dates].[SectionID] = [unpaid].[SectionID] AND 
                          [dates].[AccrualDeterminationDateMax] = [unpaid].[AccrualDeterminationDate]
    LEFT JOIN
                              (SELECT     [PastDueAmount]
    = SUM([PastDuePrincipalAmount]), [SectionID]
                                FROM      
       [dbo].[INV_LoanPrincipalAmortization]
                                GROUP BY [SectionID]
                                UNION
                                SELECT     [PastDueAmount]
    = SUM([PastDueInterestAmount]), [SectionID]
                                FROM      
      [dbo].[INV_LoanCashInterestAccrual]
                                GROUP BY [SectionID]
                                UNION
                                SELECT     [PastDueAmount]
    = SUM([PastDueInterestAmount]), [SectionID]
                                FROM      
      [dbo].[INV_LoanPIKInterestAccrual]
                                GROUP BY [SectionID]) pastdue
    ON [dates].[SectionID] = [pastdue].[SectionID]
    UNION
    SELECT     [isi].[InvoiceID], [ii].[DueDate], [SubInvoiceID] = [isi].[ID], [INV_FacilityID] = [if].[ID], [if].[FacilityID],
    [FacilityFeeID] = NULL, [il].[LoanID], [isi].[PortfolioID], [isi].[Portfolio], 
                          [PaymentType] = 'PIK Interest Applied', [Name]
    = [il].[Name], [ReceivedAmount], [CurrentDueAmount] = - [dates].[CurrentDueAmount], 
                          [PastDueAmount] = - CASE WHEN ISNULL([ReceivedAmount],
    0) > 0 THEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN 0 ELSE [PastDueAmount] + ISNULL([ReceivedAmount],
    0) END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN 0 ELSE [PastDueAmount]
    END, [PaidAmount] = - CASE WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN - ([PastDueAmount] + ISNULL([ReceivedAmount],
    0)) ELSE 0 END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN - [PastDueAmount]
    ELSE 0 END, [AmountDue] = - [AmountDue], [ID] = [il].[LoanID]
    FROM         [dbo].[INV_SubInvoice] isi JOIN
                          [dbo].[INV_Invoice] ii ON [isi].[InvoiceID]
    = [ii].[ID] JOIN
                          [dbo].[INV_Facility] [if] ON [isi].[ID] = [if].[SubInvoiceID]
    JOIN
                          [dbo].[INV_Loan] il ON [if].[ID] = [il].[INV_FacilityID]
    JOIN
                              (SELECT     [sis_loan].[ID],
    [sis_loan].[SectionTypeCode], [SectionType] = [st_loan].[Name], [sis_loan].[INV_LoanID]
                                FROM      
       [dbo].[INV_SubInvoiceSection] sis_loan JOIN
                   [dbo].[INV_SectionType] st_loan ON [sis_loan].[SectionTypeCode] = [st_loan].[Code]
                                WHERE      [INV_LoanID]
    IS NOT NULL AND [StatusCode] = 'BILL' AND [sis_loan].[SectionTypeCode] = 'LOAN_INT_PIK') isis_loan ON 
                          [il].[ID] = [isis_loan].[INV_LoanID] JOIN
                              (SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                   [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedInterestAmount]), 
                   [ReceivedAmount] = SUM([ReceivedInterestAmount])
                                FROM      
       [dbo].[INV_LoanPIKInterestAccrual] iffa
                                GROUP BY [iffa].[SectionID])
    dates ON [isis_loan].[ID] = [dates].[SectionID] LEFT JOIN
                              (SELECT     [AmountDue]
    = [UnpaidInterestAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
       [dbo].[INV_LoanPIKInterestAccrual]) unpaid ON [dates].[SectionID] = [unpaid].[SectionID] AND 
                          [dates].[AccrualDeterminationDateMax] = [unpaid].[AccrualDeterminationDate]
    LEFT JOIN
                              (SELECT     [PastDueAmount]
    = SUM([PastDueInterestAmount]), [SectionID]
                                FROM      
       [dbo].[INV_LoanPIKInterestAccrual]
                                GROUP BY [SectionID]) pastdue
    ON [dates].[SectionID] = [pastdue].[SectionID]

Maybe you are looking for