Detecting when exception was thrown using custom class loader

Hello all,
I would like to implement the solution described here - http://stackoverflow.com/questions/75218/how-can-i-detect-when-an-exceptions-been-thrown-globally-in-java - that uses custom class loader in order to detect when an Exeption thrown somewhere in the JVM hosting my app, please note that exceptions might be thrown from 3rd party jars the app is using. So, thanks to help I got from another post, I've managed to code the custom class loader. My question is how can the class loader wrap the original exception, as the methods in ClassLoader deals with classes, not instances. So where should I set the original exception?
Thanks!
Edited by: user9355666 on Sep 28, 2010 10:48 PM

user9355666 wrote:
I think I'm missing something fundumental, forgive me for being slow...
This is what I did so far. For the exception wrapper I made a simple class extens Exception that recieve Exception in its ctor and store it. I also subclassed ClassLoader and override its loadClass(). I've registered it as the system classloader. My thinking was to check in that point that if the requested class is instance of Exception and if yes, returning my wrapper class wrapping this exception. But, since loadClass() return class, how can I set in the wrapper the original exception?
In addition, let's say 2 different places in the code throws NPE, to my understanding the classloader will load NPE only once, so how throwing the NPE in the second time can be detected?you are missing a key point. you should creating a custom implementation of the NPE class which hooks into your detection code in its constructor. from that point forward, anytime any NPE (which is your custom class) is constructed, you can detect it.

Similar Messages

  • SCSM 2012 R2 error 'An exception was thrown while processing ProcessDiscoveryData for session ID uuid:

    Hi All,
    My environment details:
    SCSM 2012 R2
    SCCM 2012 R2 connector configured
    When I looked into the event viewer , I find the following error occurring continuously while the SCCM 2012 synchronization
    Error Event 26319
    An exception was thrown while processing ProcessDiscoveryData for session ID uuid:xxxxx
    Exception message: The relationship source specified in the discovery data item is not valid.
    Relationship source ID: xxxx
    Rule ID: xxxxxx
    Full Exception: Microsoft.EnterpriseManagement.Common.DiscoveryDataInvalidRelationshipSourceException: The relationship source specified in the discovery data item is not valid.
    This error is accompanied by the below warning
    Event:34113
    Connector SCCM Connector -Primary Site 
    Error writing changes to entity of type Microsoft.Windows.Peripheral.LogicalDisk with DisplayName XXXXXXX
    Message: The relationship source specified in the discovery data item is not valid.
    Relationship source ID: XXXXXXX
    Rule ID: XXXXXXX
    If this error occurs with every synchronization, examine view Cached_CMv5_LogicalDisks for correctness or the schema for type Microsoft.Windows.Peripheral.LogicalDisk in management pack Microsoft.Windows.Peripheral.Library.
    Event:33333
    Data Access Layer rejected retry on SqlError:
    Request: p_RelationshipDiscovered -- (RelationshipId=f449d88a-ecbf-5b16-40be-c085391a6380), (SourceEntityId=ccdf084d-254f-0ad4-ba2e-189b75ff109a), (TargetEntityId=07734206-0880-a4ec-a638-df20ccbdcbaf), (RelationshipTypeId=e4c6f8ce-0763-51c6-6421-c424a93a1eb6),
    (DiscoverySourceId=df6eae9f-f14f-4e6e-9f3c-c1effa193fbe), (HealthServiceEntityId=34b1c704-120c-1175-9fe3-411e2c0aac30), (PerformHealthServiceCheck=False), (TimeGenerated=09/01/2015 04:15:26), (SourceEntityLastModified=), (IsRelationshipAlreadyDiscovered=False),
    (RelationshipInserted=False), (LastModified=), (ChangeId=), (RETURN_VALUE=1)
    Class: 16
    Number: 777980002
    Message: The specified relationship doesn't have a valid source.
    From the events, it is clear that the problem is with SCCM connector and in the warning it mention to check the management pack ,
    Microsoft.Windows.Peripheral.Library
    whether need to update any MP ??
    I tried to resolve this, but ended up in aforum which suggested to do a restart of server .But since it is Prod , restart will not be easy.
    If any suggestions , it will be good to resolve this
    Thank you  

    Hi,
    Please install UR3 and check the result:
    Update Rollup 3 for System Center 2012 R2 Service Manager
    http://support.microsoft.com/kb/2962041
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Exception of type  'System.OutOfMemory Exception' was thrown while running

    We have a web application develeoped in ASP.Net, SQL Server 2005 , Crystal Reports 10.2. When I try to run a report which has around 5 lakh records (the query to fetch the records in sql server takes around 1.5 to 2 minutes) gives an error Exception of type  'System.OutOfMemory Exception' was thrown.
    Can anybody help !!
    Thanks

    Hello, Balla;
    the first thing to check is that the ASP.NET Worker process has rights to your Temp folder. You will find where it is by checking your Environment variables.
    Use the correct name for the ASP.NET worker process depending on your operating system - LocalMachine\IIS_WPG(Windows 2003 Server) or ASPNET(XP) or (Vista) IIS_IUSRS
    To give the IIS_WPG account full control of a folder:
    1. Right-click the folder and select 'Properties'.
    2. Go to the 'Security' tab and click the 'Add' button.
    3. Click the 'Locations' button and select the
    computer name. Click 'OK'.
    4. Type "IIS_WPG" under the 'Enter the object names to
    select' box.
    5. Click 'Check Names'. <Your machine name>\IIS_WPG
    appears. Click 'OK'.
    6. Check 'Full Control' from 'Permissions for IIS_WPG'.
    Click 'OK'.
    ====================
    NOTE:
    The IIS_WPG includes the LocalService,
    System, and NetworkService accounts.
    ====================
    If that is not the issue:
    What database driver are you using in the design of your report? Go to Database|Set datasource location and tell me the properties of the database connection.
    Do you logon to the database in your code or pass the data to it using Datasets?
    Are there subreports in the design? How many are there? What section are they in? What data source does each one use?
    Do you have a lot of formulas in the report?
    Elaine

  • Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain

    Hi All,
      I have created a custom web part in VS 2008 for Share point server 2010 with DevExpress v12.2.17, and deployed as Sandboxed solution. when i add that web parts in web part zone i am getting the error as "Web Part Error:
    Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred. ".
    If there is any way to get detailed error either log file or event viewer.
    Kindly advice to find the cause of the problem.
    Thanks,
    Selvakumar.S

    Hello,
    Are you impersonating your code? Have you tried to debug your code by attaching SPUCHostService.exe? if not please do so.
    You also need to check ULS log for more information about this error. Here is one ref link if this could help
    http://sohilmakwana.wordpress.com/2013/11/29/sandbox-error-unhandled-exception-was-thrown-by-the-sandboxed-code-wrappers-execute-method-in-the-partial-trust-app-domain/
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How can i solve this Exception that "How can i solve this exception that "End of stack trace from previous location where exception was thrown" in Windows phone 8.

    Hi Sir/Mam,
    Please give me solution for this problem.I tried this in all ways for solve this problem like i checked my all class objects cleared or not when leaving current page to come to before page.
    This Exception came at After saved data in the wp8 device database,then it is coming to back page(when i navigate to another page) then that navigated page running and go to "Public Asyn Void Listmenu()" method ,in this method again retrieve the
    data from database after getting this data,it shows this Exception.
    Note :-This Exception came in WP8 Device only,not in Emulator.In the Emulator it is working fine.
    My Exception:-
    Exception:- System.Exception.Exception.HRESULT:0*80040015
    at
    System.Runtime.CompliterServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at
    System.Runtime.ComplierServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at
    System.Runtime.ComplierServices.TaskAwaiter'1.GetResult()
    at
    _10Min._10MinUserPages.<checkStatusAndSavedDataExistinFormTable>d_e3.MoveNext()
    End of stack trace from previous location where exception was thrown
    at
    system.runtime.Compilerservices.TaskAwater.throwForNonSuccess(Task task)
    at
    System.Runtime.compilerservices.TaskAwaiter.HandlerNonSuccessAndDebuggerNotification(Task task)
    at
    System.Runtime.ComplierServices.TaskAwaiter'1.GetResult()
    at
    _10Min._10MinUserPages.<listmenu>d_8.MoveNext().
    How can i solve this problem please help me. I am suffering from 1 week days with this problem.
    Please help me.any one.
    Thanks & Regards,
    SrinivaaS.

    Is the flow of code to the point where exception occurs:
    1) Data saved in Db
    2) Navigated back
    3)Navigated to another page
    4) Method ListMenu() is called(as soon as navigated to page in step 3) to retrieve the saved data from db & exception occurs.
    Can you paste here the definition of ListMenu(), also does the exception occurs as soon as db is accessed inside this method or else.
    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

  • Using custom class loaders with DefaultCacheServer

    Hello,
    Is it possible for the DefaultCacheServer to use the class loader specified when a named cache is initially created (e.g. CacheFactory.getCache(cacheName, classLoader))? We would like our application to allow cached objects to be customized and deployed at runtime. Performing a rolling restart of the DefaultCacheServers to update the classpath is not feasible as this could negatively impact existing applications.
    Thanks,
    Jim

    Hi Jim,
    You are correct, the DefaultCacheServer does not currently have any ClassLoader customization support. What is important to know is that the DefaultCacheServer is just a thin wrapper around the Coherence library, and the only functionality it adds is the auto starting of services, and periodic reassurance that the services are still running. As suggested in my prior post, you can choose to extend, or call out to it's methods to add functionality. If you are interested in per-cache ClassLoaders, you should be able to achieve this by again creating your own custom CacheServer class, which iterates through your list of caches, and calls CacheFactory.getCache(name, loader), and then finishes up by calling DefaultCacheServer.main().
    You may also want to consider using seperate cache services (still in the same process) per customer. If you were to take such an approach you could choose to address the ClassLoader issue by calling the setContextClassLoader() method on each service, which would then cover all caches associated to a specific customer. There are other benefits to the multi-service approach, for instance you can choose to run or not run a service on a given node, allowing more control over how much of your cluster resources a customer has access to.
    thanks,
    mark
    Coherence Development Team

  • Enable Audit on SCOM Agent An exception was thrown while processing Submit Tasks does not have sufficient permission to perform the operation.

    Hi All,
    An exception was thrown while processing Submit Tasks Domain\"SDK Account" does not have sufficient permission to perform the operation.
    am getting this error when try to enable audit in one of Domain controllers.

    Dear Mark,
    i face similar problem before, i had resolve it be adding SDK service account to Operation Manager Administration group.
    Regards, Ibrahim Hamdy

  • Exception creating EntityManagerFactory using PersistenceProvider class

    Hi,
    im new to OC4J and using standalone version of it.
    I'd made a new spring based application with JDBC connection.
    When i'm trying to deploy this application i'm getting the exception :
    Exception creating EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.HibernatePersistence for persistence unit ApplicationEntityManagerI'm not able to understand why i'm getting this error because i'm not using HibernatePersistance in the application.
    Kindly help.
    Here is the stack trace of "ascontrol.log"
    2009-01-15 21:02:40,691 [OC4J Launcher] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions administrators:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:02:40,738 [OC4J Launcher] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions system:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:03:53,882 [HTTPThreadGroup-4] WARN  ias.ContentEmIntegration init.51 - Initialize Content DB Integration class
    2009-01-15 21:04:04,007 [EMUI_21_04_00_/console/postLogon] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions administrators:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:04:04,054 [EMUI_21_04_00_/console/postLogon] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions system:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:04:04,319 [EMUI_21_04_00_/console/postLogon] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions administrators:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:04:04,351 [EMUI_21_04_00_/console/postLogon] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions system:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:04:04,616 [EMUI_21_04_00_/console/postLogon] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions administrators:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:04:04,648 [EMUI_21_04_00_/console/postLogon] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions system:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:04:05,132 [EMUI_21_04_04_/console/postLogon] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions administrators:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:04:05,179 [EMUI_21_04_04_/console/postLogon] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions system:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:04:05,413 [EMUI_21_04_04_/console/postLogon] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions administrators:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:04:05,460 [EMUI_21_04_04_/console/postLogon] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions system:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:04:05,695 [EMUI_21_04_04_/console/postLogon] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions administrators:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:04:05,726 [EMUI_21_04_04_/console/postLogon] WARN  jmx.SecureWalletManager _setPermission.161 - WARNING: Could not set file permissions system:F for wallet at C:\Program Files\Java\oc4j_extended_101340\j2ee\home\persistence\ascontrol\ascontrol\securestore\ewallet.p12
    2009-01-15 21:05:16,963 [EMUI_21_05_16_/console/ias/j2ee/deploy/deploySavePlan] ERROR em.console doGet.303 - java.lang.IllegalStateException: Response has already been committed
    java.lang.IllegalStateException: Response has already been committed
         at com.evermind.server.http.EvermindHttpServletResponse.resetBuffer(EvermindHttpServletResponse.java:1892)
         at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:249)
         at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:51)
         at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:193)
         at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:284)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:198)
         at oracle.sysman.emSDK.svlt.PageHandler.render(PageHandler.java:796)
         at oracle.sysman.emSDK.svlt.PageHandler.handleRequest(PageHandler.java:398)
         at oracle.sysman.emSDK.svlt.EMServlet.myDoGet(EMServlet.java:765)
         at oracle.sysman.emSDK.svlt.EMServlet.doGet(EMServlet.java:283)
         at oracle.sysman.ias.studio.app.StudioConsole.doGet(StudioConsole.java:385)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.sysman.ias.studio.app.BrowserVersionFilter.doFilter(BrowserVersionFilter.java:75)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.sysman.ias.studio.app.MultipleJVMFilter.doFilter(MultipleJVMFilter.java:85)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.sysman.ias.studio.app.PostLogonFilter.doFilter(PostLogonFilter.java:80)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.sysman.ias.studio.app.ShortHostnameRedirectFilter.doFilter(ShortHostnameRedirectFilter.java:68)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:619)

    Greetings,
    Did you develop your application using Spring\Hibernate on JBoss? Oracle uses Toplink so you can revisit your persistence settings in accordance with:
    How-To : Using EJB 3.0 and Java Persistence API with Spring in OC4J
    http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-ejb30-jpa-spring/doc/how-to-ejb30-jpa-spring.htmlThe main page that this is referenced from is at:
    Oracle TopLink
    http://www.oracle.com/technology/products/ias/toplink/technical/tips/index.html-Michael

  • EJB5018: An exception was thrown during an ejb invocation on [ResultFacade]

    I have a problem to access from application client to methods of session beans
    the problem haw to call this method "getcodesresultcampbean("ARTV")"
    EJB5018: An exception was thrown during an ejb invocation on [ResultFacade]
    javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean: java.lang.NoClassDefFoundError: org/postgresql/jdbc3/Jdbc3PreparedStatement
    at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:3591)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3436)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:192)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:71)
    at $Proxy306.findByRefCampagne(Unknown Source)
    at com.bellconsulting.praxys.stats.service.StatCampagneBean.getcodesresultcampbean(StatCampagneBean.java:77)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:589)
    at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
    at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
    at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
    at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:190)
    at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:67)
    at $Proxy305.getcodesresultcampbean(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:589)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
    Caused by: java.lang.NoClassDefFoundError: org/postgresql/jdbc3/Jdbc3PreparedStatement
    at org.postgresql.jdbc3.Jdbc3Connection.prepareStatement(Jdbc3Connection.java:37)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.prepareStatement(AbstractJdbc3Connection.java:266)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.prepareStatement(AbstractJdbc2Connection.java:151)
    at com.sun.gjc.spi.ConnectionHolder.prepareStatement(ConnectionHolder.java:413)
    at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:497)
    at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:415)
    at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1538)
    at org.hibernate.loader.Loader.doQuery(Loader.java:661)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
    at org.hibernate.loader.Loader.doList(Loader.java:2211)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
    at org.hibernate.loader.Loader.list(Loader.java:2090)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
    at com.bellconsulting.praxys.stats.facades.ResultFacade.findByRefCampagne(ResultFacade.java:54)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    **************************code source************** ResultFacade******
    package com.bellconsulting.praxys.stats.facades;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import com.bellconsulting.praxys.stats.entities.Result;
    * @author idriss
    @Stateless
    public class ResultFacade implements ResultFacadeLocal {
    @PersistenceContext
    private EntityManager em;
    /** Creates a new instance of ResultFacade */
    public ResultFacade() {
    public void create(Result result) {
    em.persist(result);
    public void edit(Result result) {
    em.merge(result);
    public void destroy(Result result) {
    em.merge(result);
    em.remove(result);
    public Result find(Object pk) {
    return (Result) em.find(Result.class, pk);
    public List findAll() {
    return em.createQuery("select object(o) from Result as o").getResultList();
    public List findByRefCampagne (String campaignCode) {
    return em.createNamedQuery("Result.findByRefcampagne").setParameter("refcampagne", campaignCode).getResultList();
    *****************StatCampagneBean********
    package com.bellconsulting.praxys.stats.service;
    import com.bellconsulting.praxys.stats.facades.ResultFacadeLocal;
    import java.sql.Date;
    import javax.ejb.EJB;
    import javax.ejb.Stateful;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import com.bellconsulting.praxys.stats.entities.Campaign;
    import com.bellconsulting.praxys.stats.entities.Result;
    import com.bellconsulting.praxys.stats.facades.CampaignFacadeLocal;
    import java.util.Iterator;
    import java.util.List;
    * @author idriss
    @Stateful
    public class StatCampagneBean implements StatCampagneRemote {
    @EJB
    private CampaignFacadeLocal campaignFacade;
    private @EJB ResultFacadeLocal resultFacade;
    private String _campagnecode;
    /** Creates a new instance of StatCampagneBean */
    public StatCampagneBean() {
    public StatCampagneBean(String campagnecode)
    this._campagnecode= campagnecode;
    @PersistenceContext
    private EntityManager _manager;
    public int getnbreOKbean(String codecampagne) {
    //TODO implement getnbreOK
    Campaign camp= _manager.find(Campaign.class,codecampagne);
    return camp.getNbRepPositive();
    public void statCodesResultats(String nomcamp, String codecamp, Date datedebut, Date datefin) {
    //TODO implement statCodesResultats
    public String[ ] getcodesresultcampbean(String codecamp) {
    //TODO implement getcodesresultcampbean
    // _manager.getTransaction().begin();
    /* EntityManagerFactory emf = Persistence.createEntityManagerFactory("Result");
    EntityManager em = emf.createEntityManager();
    String querystring = "select object(r) from Result r"+" where r.refcampagne = ?1";
    Query query =em.createQuery(querystring).setParameter(1,codecamp);
    *for (Result r : coderesultList)
    coderesult[j++]= r.getResultPK().getCode().toString();
    // List<Result> coderesultList = query.getResultList();
    List<Result> coderesultList = resultFacade.findByRefCampagne(codecamp);
    Iterator<Result> itr = coderesultList.iterator();
    String[]codesresult =null;
    int j= 0;
    while (itr.hasNext()){
    codesresult[j++] =itr.next().getResultPK().getCode().toString();
    // _manager.getTransaction().commit();
    return codesresult;
    *********************Application client *************
    package application.praxys;
    import com.bellconsulting.praxys.stats.service.StatCampagneRemote;
    import javax.swing.JOptionPane;
    import stats.praxys.*;
    * @author idriss
    public class Main {
    /** Creates a new instance of Main */
    public Main() {
    * @param args the command line arguments
    public static void main(String[] args) {
    // TODO code application logic here
    // InitialContext ctx;
    String[] nbreok =null ;
    int c =0;
    /* try {
    ctx = new InitialContext();
    StatCampagneRemote simpleSession = (StatCampagneRemote) ctx.lookup(StatCampagneRemote.class.getName());
    nbreok = simpleSession.getnbreOK("ARTV");
    System.out.println("voici un resultaaaaaaaaaaaaaaaaaaaaa"+" "+nbreok);
    } catch (NamingException ex)
    TeleVenteServiceLocator tvLocator = new TeleVenteServiceLocator();
    StatCampagneRemote statCampagneBean = (StatCampagneRemote)tvLocator.getCampaignService();
    JOptionPane.showMessageDialog(null, "dfsdfsdfsfsq");
    nbreok=statCampagneBean.getcodesresultcampbean("ARTV");
    //nbreok =statCampagneBean.getnbreOKbean("ARTV");
    System.out.println("voici un resultaaaaaaaaaaaaaaaaaaaaa "+ nbreok[1]);
    JOptionPane.showMessageDialog(null, "dfsdfsdfsfsq"+nbreok[2]);
    ***************Result entity bean*********
    package com.bellconsulting.praxys.stats.entities;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.EmbeddedId;
    import javax.persistence.Entity;
    import javax.persistence.JoinColumn;
    import javax.persistence.ManyToOne;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    * Entity class Result
    * @author idriss
    @Entity
    @Table(name = "result")
    @NamedQueries( {
    @NamedQuery(name = "Result.findByCode", query = "SELECT r FROM Result r WHERE r.resultPK.code = :code"),
    @NamedQuery(name = "Result.findByLibelle", query = "SELECT r FROM Result r WHERE r.libelle = :libelle"),
    @NamedQuery(name = "Result.findByPriorite", query = "SELECT r FROM Result r WHERE r.priorite = :priorite"),
    @NamedQuery(name = "Result.findByPrix", query = "SELECT r FROM Result r WHERE r.prix = :prix"),
    @NamedQuery(name = "Result.findByResType", query = "SELECT r FROM Result r WHERE r.resType = :resType"),
    @NamedQuery(name = "Result.findByRefcampagne", query = "SELECT r FROM Result r WHERE r.resultPK.refcampagne = :refcampagne"),
    @NamedQuery(name = "Result.findByRetValue", query = "SELECT r FROM Result r WHERE r.retValue = :retValue"),
    @NamedQuery(name = "Result.findByRetUnit", query = "SELECT r FROM Result r WHERE r.retUnit = :retUnit")
    public class Result implements Serializable {
    * EmbeddedId primary key field
    @EmbeddedId
    protected ResultPK resultPK;
    @Column(name = "libelle")
    private String libelle;
    @Column(name = "priorite", nullable = false)
    private int priorite;
    @Column(name = "prix", nullable = false)
    private float prix;
    @Column(name = "resType")
    private Integer resType;
    @Column(name = "retValue")
    private Integer retValue;
    @Column(name = "retUnit")
    private String retUnit;
    @JoinColumn(name = "refcampagne", referencedColumnName = "code", insertable = false, updatable = false)
    @ManyToOne
    private Campaign campaign;
    /** Creates a new instance of Result */
    public Result() {
    * Creates a new instance of Result with the specified values.
    * @param resultPK the resultPK of the Result
    public Result(ResultPK resultPK) {
    this.resultPK = resultPK;
    * Creates a new instance of Result with the specified values.
    * @param resultPK the resultPK of the Result
    * @param priorite the priorite of the Result
    * @param prix the prix of the Result
    public Result(ResultPK resultPK, int priorite, float prix) {
    this.resultPK = resultPK;
    this.priorite = priorite;
    this.prix = prix;
    * Creates a new instance of ResultPK with the specified values.
    * @param refcampagne the refcampagne of the ResultPK
    * @param code the code of the ResultPK
    public Result(String refcampagne, String code) {
    this.resultPK = new ResultPK(refcampagne, code);
    * Gets the resultPK of this Result.
    * @return the resultPK
    public ResultPK getResultPK() {
    return this.resultPK;
    * Sets the resultPK of this Result to the specified value.
    * @param resultPK the new resultPK
    public void setResultPK(ResultPK resultPK) {
    this.resultPK = resultPK;
    * Gets the libelle of this Result.
    * @return the libelle
    public String getLibelle() {
    return this.libelle;
    * Sets the libelle of this Result to the specified value.
    * @param libelle the new libelle
    public void setLibelle(String libelle) {
    this.libelle = libelle;
    * Gets the priorite of this Result.
    * @return the priorite
    public int getPriorite() {
    return this.priorite;
    * Sets the priorite of this Result to the specified value.
    * @param priorite the new priorite
    public void setPriorite(int priorite) {
    this.priorite = priorite;
    * Gets the prix of this Result.
    * @return the prix
    public float getPrix() {
    return this.prix;
    * Sets the prix of this Result to the specified value.
    * @param prix the new prix
    public void setPrix(float prix) {
    this.prix = prix;
    * Gets the resType of this Result.
    * @return the resType
    public Integer getResType() {
    return this.resType;
    * Sets the resType of this Result to the specified value.
    * @param resType the new resType
    public void setResType(Integer resType) {
    this.resType = resType;
    * Gets the retValue of this Result.
    * @return the retValue
    public Integer getRetValue() {
    return this.retValue;
    * Sets the retValue of this Result to the specified value.
    * @param retValue the new retValue
    public void setRetValue(Integer retValue) {
    this.retValue = retValue;
    * Gets the retUnit of this Result.
    * @return the retUnit
    public String getRetUnit() {
    return this.retUnit;
    * Sets the retUnit of this Result to the specified value.
    * @param retUnit the new retUnit
    public void setRetUnit(String retUnit) {
    this.retUnit = retUnit;
    * Gets the campaign of this Result.
    * @return the campaign
    public Campaign getCampaign() {
    return this.campaign;
    * Sets the campaign of this Result to the specified value.
    * @param campaign the new campaign
    public void setCampaign(Campaign campaign) {
    this.campaign = campaign;
    * Returns a hash code value for the object. This implementation computes
    * a hash code value based on the id fields in this object.
    * @return a hash code value for this object.
    @Override
    public int hashCode() {
    int hash = 0;
    hash += (this.resultPK != null ? this.resultPK.hashCode() : 0);
    return hash;
    * Determines whether another object is equal to this Result. The result is
    * <code>true</code> if and only if the argument is not null and is a Result object that
    * has the same id field values as this object.
    * @param object the reference object with which to compare
    * @return <code>true</code> if this object is the same as the argument;
    * <code>false</code> otherwise.
    @Override
    public boolean equals(Object object) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if (!(object instanceof Result)) {
    return false;
    Result other = (Result)object;
    if (this.resultPK != other.resultPK && (this.resultPK == null || !this.resultPK.equals(other.resultPK))) return false;
    return true;
    * Returns a string representation of the object. This implementation constructs
    * that representation based on the id fields.
    * @return a string representation of the object.
    @Override
    public String toString() {
    return "com.bellconsulting.praxys.stats.entities.Result[resultPK=" + resultPK + "]";
    Message was edited by:
    081283

    Try posting this on the EJB forum:
    http://forum.java.sun.com/forum.jspa?forumID=13

  • I have my iPhoto set to an external drive yesterday when it was in use the usb disconnected i now have a message saying (your photo library is either in use by another application or has become unreadable) I have tried shutting down and restarting.

    I have my iPhoto set to an external drive, when it was in use the usb disconected as i was moving my mac air, when i re-conected a message said (your photo library is either in use by another application or has become unreadable).
    I have tried shutting it down and then re opening iPhoto but get the same message.
    The reason for the external drive was there was not enough room on my hard drive, I have around 7000 photos on it.
    is there a simple fix?
    Regards
    Dale

    These are your options:
    1. Restore the iPhoto library from the most recent backup that predates the issue.
              Advantages: Always works, if library damage is causing the problem and the backup is intact.
              Disadvantages: Impossible if you don't have a backup. All changes made since the backup are lost.
    2. Repair or rebuild the library. Be sure to back it up first.
              Advantages: May solve the problem with no loss of data.
              Disadvantages: May fail. May take a long time if the library is large.
    3. Scavenge the library with a third-party application called "iPhoto Library Manager," which you can find in a web search. From the application's menu bar (not the iPhoto menu bar), select Library ▹ Rebuild.
              Advantages: All images and albums should be preserved.
              Disadvantages: All books, calendars, and slideshows will be lost.

  • How do I view a list of software and when it was last used?

    I'm new to Apple and on Windows you could see a list of software on your pc and when it was last used - that helped me delete unused stuff but I can't find the same function on my Macbook Pro? 

    I've found a way through Terminal for AFP and Mail:
    https://discussions.apple.com/message/16155552#16155552

  • CONTAINER:atg.service.pipeline.RunProcessException: An exception was thrown from the context of the link named [loadCommerceItemObjects].; SOURCE:java.lang.RuntimeException:

    Can Any one help me in finding the cause of following error
    16:18:27,565 INFO  [PipelineManager] DEBUG Cancel Link Transaction
    16:18:27,565 INFO  [PipelineManager] DEBUG Transaction is TX_MANDATORY
    16:18:27,565 INFO  [PipelineManager] DEBUG Setting transaction to rollback
    16:18:27,565 INFO  [PipelineManager] DEBUG Cancel Chain Transaction
    16:18:27,565 INFO  [PipelineManager] DEBUG Transaction is TX_REQUIRED
    16:18:27,565 INFO  [PipelineManager] DEBUG Setting transaction to rollback
    16:18:27,565 ERROR [OrderManager]
    CAUGHT AT:
    CONTAINER:atg.service.pipeline.RunProcessException: An exception was thrown from the context of the link named [loadCommerceItemObjects].; SOURCE:java.lang.RuntimeException: CONTAINER:atg.repository.RepositoryException; SOURCE:org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -53eaeff2:f142:52c29876:2a4f status: ActionStatus.ABORT_ONLY >; - nested throwable: (ja
            at atg.service.pipeline.PipelineChain.runProcess(PipelineChain.java:393)
            at atg.service.pipeline.PipelineChainContext.runProcess(PipelineChainContext.java:207)
            at atg.service.pipeline.PipelineManager.runProcess(PipelineManager.java:475)
            at atg.commerce.pipeline.CommercePipelineManager.runProcess(CommercePipelineManager.java:123)
            at atg.commerce.order.OrderImpl.ensureContainers(OrderImpl.java:1745)
            at atg.commerce.order.OrderImpl.getShippingGroups(OrderImpl.java:1084)
            at com.mk.integration.epicor.salesAudit.datamanager.EpicorSalesAuditDataManager.processShippingGroups(EpicorSalesAuditDataManager.java:477)
            at com.mk.integration.epicor.salesAudit.datamanager.EpicorSalesAuditDataManager.constructSalesAuditFeed(EpicorSalesAuditDataManager.java:431)
            at com.mk.integration.epicor.salesAudit.datamanager.EpicorSalesAuditDataManager.exportFullfilledOrder(EpicorSalesAuditDataManager.java:213)
            at com.mk.integration.epicor.salesAudit.processor.EpicorSalesAuditProcessor.exportFullfilledOrder(EpicorSalesAuditProcessor.java:42)
            at com.mk.integration.epicor.salesAudit.scheduler.EpicorSalesAuditScheduler.startSalesAuditExport(EpicorSalesAuditScheduler.java:65)
            at com.mk.integration.epicor.salesAudit.scheduler.EpicorSalesAuditScheduler.doScheduledTask(EpicorSalesAuditScheduler.java:49)
            at atg.service.scheduler.SingletonSchedulableService.performScheduledTask(SingletonSchedulableService.java:253)
            at atg.service.scheduler.ScheduledJob.runJobs(ScheduledJob.java:466)
            at atg.service.scheduler.Scheduler$2handler.run(Scheduler.java:782)
    Caused by: java.lang.RuntimeException: CONTAINER:atg.repository.RepositoryException; SOURCE:org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -53eaeff2:f142:52c29876:2a4f status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -53eaeff2:f142:52c29876:2a4f status:
            at atg.adapter.gsa.GSAItemDescriptor.loadProperty(GSAItemDescriptor.java:5994)
            at atg.adapter.gsa.GSAItem.getPersistentPropertyValue(GSAItem.java:1315)
            at atg.adapter.gsa.GSAItem.getPropertyValue(GSAItem.java:1208)
            at atg.adapter.gsa.GSAItem.getPropertyValue(GSAItem.java:1405)
            at atg.repository.RepositoryItemImpl.getPropertyValue(RepositoryItemImpl.java:151)

    Hi,
    I seems like you don't have any active transaction. Try start or get transaction before execute your required operations.
    After it, commit (or rollback, if something wrong happens) the transaction.
    Hope it helps.

  • How can I make server use single class loader for several applications

    I have several web/ejb applications. These applications use some common libraries and should share instances of classes from those libraries.
    But applications are being deployed independently thus packaging all them to EAR is not acceptable.
    I suppose the problem is that each application uses separate class loader.
    How can I make AS use single class loader for a set of applications?
    Different applications depend on different libraries so I need a way that will not share library for all applications on the domain but only for some exact applications.
    When I placed common jar to *%domain%/lib* - all works. But that jar is shared between all applications on the domain.
    When I tried to place common jar to *%domain%/lib/applibs* and specified --libraries* attribute on deploying I got exception
    java.lang.ClassCastException: a.FirstDao cannot be cast to a.FirstDaoHere http://download.oracle.com/docs/cd/E19879-01/820-4336/6nfqd2b1t/index.html I read:
    If multiple applications or modules refer to the same libraries, classes in those libraries are automatically shared.
    This can reduce the memory footprint and allow sharing of static information.Does it mean that classes should be able to be casted ?

    You didn't specify which version of the application server you are using, but the config is similar as long as you know what to look for. Basically, you need to change the classloader delegation. Here's how it is done in 8.2
    http://download.oracle.com/docs/cd/E19830-01/819-4721/beagb/index.html

  • Custom class loader and local class accessing local variable

    I have written my own class loader to solve a specific problem. It
    seemed to work very well, but then I started noticing strange errors in
    the log output. Here is an example. Some of the names are in Norwegian,
    but they are not important to this discussion. JavaNotis.Oppstart is the
    name of my class loader class.
    java.lang.ClassFormatError: JavaNotis/SendMeldingDialog$1 (Illegal
    variable name " val$indeks")
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:431)
    at JavaNotis.Oppstart.findClass(Oppstart.java:193)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    at JavaNotis.SendMeldingDialog.init(SendMeldingDialog.java:78)
    at JavaNotis.SendMeldingDialog.<init>(SendMeldingDialog.java:54)
    at JavaNotis.Notistavle.sendMelding(Notistavle.java:542)
    at JavaNotis.Notistavle.access$900(Notistavle.java:59)
    at JavaNotis.Notistavle$27.actionPerformed(Notistavle.java:427)
    JavaNotis/SendMeldingDialog$1 is a local class in the method
    JavaNotis.SendMeldingDialog.init, and it's accessing a final local
    variable named indeks. The compiler automatically turns this into a
    variable in the inner class called val$indeks. But look at the error
    message, there is an extra space in front of the variable name.
    This error doesn't occur when I don't use my custom class loader and
    instead load the classes through the default class loader in the JVM.
    Here is my class loading code. Is there something wrong with it?
    Again some Norwegian words, but it should still be understandable I hope.
         protected Class findClass(String name) throws ClassNotFoundException
             byte[] b = loadClassData(name);
             return defineClass(name, b, 0, b.length);
         private byte[] loadClassData(String name) throws ClassNotFoundException
             ByteArrayOutputStream ut = null;
             InputStream inn = null;
             try
                 JarEntry klasse = arkiv.getJarEntry(name.replace('.', '/')
    + ".class");
                 if (klasse == null)
                    throw new ClassNotFoundException("Finner ikke klassen "
    + NOTISKLASSE);
                 inn = arkiv.getInputStream(klasse);
                 ut = new ByteArrayOutputStream(inn.available());
                 byte[] kode = new byte[4096];
                 int antall = inn.read(kode);
                 while (antall > 0)
                     ut.write(kode, 0, antall);
                     antall = inn.read(kode);
                 return ut.toByteArray();
             catch (IOException ioe)
                 throw new RuntimeException(ioe.getMessage());
             finally
                 try
                    if (inn != null)
                       inn.close();
                    if (ut != null)
                       ut.close();
                 catch (IOException ioe)
         }I hope somebody can help. :-)
    Regards,
    Knut St�re

    I'm not quite sure how Java handles local classes defined within a method, but from this example it seems as if the local class isn't loaded until it is actually needed, that is when the method is called, which seems like a good thing to me.
    The parent class is already loaded as you can see. It is the loading of the inner class that fails.
    But maybe there is something I've forgotten in my loading code? I know in the "early days" you had to do a lot more to load a class, but I think all that is taken care of by the superclass of my classloader now. All I have to do is provide the raw data of the class. Isn't it so?

  • Can I dinamicly load a class with custom class loader ?

    Can I dinamicly load a class with custom class loader ?

    Hi,
    I was wondering if you found answer to your question, and also were you using your custom class loader inside a signed applet as I am in a similar situation, and was wondering if you could help me. An example would be great...
    Thanks a lot.
    Regards.

Maybe you are looking for