Thread Aborted Exception

Hi,
I'm using LDAP with Active Directory.
When I run a query, the very first time, results are correctly
populated. Every successive query then fails, with a thread aborted
exception:
Message: Thread was being aborted.
Stack Trace:
at System.Net.UnsafeNclNativeMethods.OSSOCK.recv(IntP tr
socketHandle, Byte* pinnedBuffer, Int32 len, SocketFlags socketFlags)
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset,
Int32 size, SocketFlags socketFlags, SocketError& errorCode)
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset,
Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32
offset, Int32 size)
at System.IO.Stream.ReadByte()
at Novell.Directory.Ldap.Asn1.Asn1Identifier..ctor(St ream
in_Renamed)
at Novell.Directory.Ldap.Connection.ReaderThread.Run( )
Could anyone help with why this is happening?
Thanks,
Nedar
nedar
nedar's Profile: http://forums.novell.com/member.php?userid=78416
View this thread: http://forums.novell.com/showthread.php?t=401581

nedar;1936674 Wrote:
> I did try simply replacing the dll, but that did not help.
Can you encapsulate the failure into a test harness and post the code
some place? If you are running latest libraries... and you do get a
correct run the first time through... perhaps the issue is in the way
you are using them.
Also, have you seen 'similar'
(http://developer.cisco.com/web/cuae/.../105446316CEF7)
error? Seems to involve the FQN / BaseDN being used... same stack
traces, essentially. Specifically:
> DC=cisco,DC=com is reproducing the same error on my side. "o=cisco.com"
> is working fine.
>
> Basically, the correct format of BaseDN for your specific ldap server
> is needed to make the Query work. You may be able to look at your ldap
> server to figure correct format.
>
-- Bob
Bob Mahar -- Novell Knowledge Partner
Do you do what you do at a .EDU? http://novell.com/ttp
"Programming is like teaching a jellyfish to build a house."
http://twitter.com/BobMahar http://vimeo.com/boborama
Bob-O-Rama's Profile: http://forums.novell.com/member.php?userid=5269
View this thread: http://forums.novell.com/showthread.php?t=401581

Similar Messages

  • WCF called from Sharepoint - thread abort exception

    Hello,
    we have an SP web part calling WCF service using simple http binding. SP and WCF are located on different servers in different countries, so not at the same machine. Using WCF we send/receive some files, which are processed at the WCF server site, parsed
    and stored to database. It takes some time, of course, but usually not more than minute or 2. On development server it works normally but on production server we are facing problems like
    System.Threading.ThreadAbortException: Thread was being aborted. at System.Net.UnsafeNclNativeMethods.OSSOCK.recv(IntPtr socketHandle, Byte* pinnedBuffer, Int32 len, SocketFlags socketFlags) at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset,
    Int32 size, SocketFlags socketFlags, SocketError& errorCode) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.Connection.SyncRead(HttpWebRequest
    request, Boolean userRetrievedStream, Boolean probeRead) at System.Net.ConnectStream.ProcessWriteCallDone(ConnectionReturnResult returnResult) at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan
    timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
    msgData, Int32 type) at DHI.FRMP.Sharepoint.Tasks.MCSPConnector.IMCSPConnector.TaskUpdate(TaskUpdateRequest request) at DHI.FRMP.Sharepoint.Tasks.TaskEditSave.TaskEditSave.btnSaveChanges_Click(Object sender, ImageClickEventArgs e)
    or
    System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.WaitHandle.WaitOneNative(SafeHandle waitableSafeHandle, UInt32 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext) at System.Threading.WaitHandle.InternalWaitOne(SafeHandle
    waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext) at System.Net.LazyAsyncResult.WaitForCompletion(Boolean snap) at System.Net.Connection.SubmitRequest(HttpWebRequest request, Boolean forcedsubmit) at System.Net.ServicePoint.SubmitRequest(HttpWebRequest
    request, String connName) at System.Net.HttpWebRequest.SubmitRequest(ServicePoint servicePoint) at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
    at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout) at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message
    message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage
    methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at DHI.FRMP.Sharepoint.Tasks.MCSPConnector.IMCSPConnector.GetTaskCatchmentList(GetTaskCatchmentListRequest
    request) at DHI.FRMP.Sharepoint.Tasks.TaskAdd.ddlWaterRegion_SelectedIndexChanged(Object sender, EventArgs e)
    We have already checked that the client is properly closed and disposed. We also know that the web service call is processed correctly (from the logs).
    Streams are closed.
    Sharepoint timeout for long operation is set to 3600.
    WCF is hosted in windows service application, used .NET 4.0. WCF config:
    <system.serviceModel>
    <client />
    <bindings>
    <basicHttpBinding>
    <binding name="StreamedHTTP" closeTimeout="04:01:00" openTimeout="04:01:00"
    receiveTimeout="04:10:00" sendTimeout="04:01:00" maxBufferSize="2147483647"
    maxReceivedMessageSize="2147483647" messageEncoding="Mtom" transferMode="Streamed">
    <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
    maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>
    </basicHttpBinding>
    </bindings>
    <services>
    <service name="DHI.FRMP.MCSPConnector.MCSPConnector">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="StreamedHTTP"
    contract="DHI.FRMP.MCSPConnector.IMCSPConnector">
    <identity>
    <dns value="localhost" />
    </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
    </services>
    <behaviors>
    <serviceBehaviors>
    <behavior>
    <!-- To avoid disclosing metadata information,
    set the values below to false before deployment -->
    <serviceMetadata httpGetEnabled="True" httpsGetEnabled="False"/>
    <!-- To receive exception details in faults for debugging purposes,
    set the value below to true. Set to false before deployment
    to avoid disclosing exception information -->
    <serviceDebug includeExceptionDetailInFaults="True"/>
    </behavior>
    </serviceBehaviors>
    </behaviors>
    Client creation code
    public static IMCSPConnectorChannel CreateWCFclient(out ChannelFactory<IMCSPConnectorChannel> factory)
    BasicHttpBinding myBinding = new BasicHttpBinding();
    TimeSpan timeOut = new TimeSpan(4, 1, 0);
    int maxSize = 2147483647;
    myBinding.CloseTimeout = timeOut;
    myBinding.OpenTimeout = timeOut;
    myBinding.ReceiveTimeout = timeOut;
    myBinding.SendTimeout = timeOut;
    myBinding.AllowCookies = false;
    myBinding.BypassProxyOnLocal = false;
    myBinding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
    myBinding.MaxBufferSize = maxSize;
    myBinding.MaxBufferPoolSize = maxSize;
    myBinding.MaxReceivedMessageSize = maxSize;
    myBinding.MessageEncoding = WSMessageEncoding.Mtom;
    myBinding.TextEncoding = System.Text.Encoding.UTF8;
    myBinding.TransferMode = TransferMode.Streamed;
    myBinding.UseDefaultWebProxy = true;
    myBinding.ReaderQuotas.MaxDepth = 128;
    myBinding.ReaderQuotas.MaxStringContentLength = maxSize;
    myBinding.ReaderQuotas.MaxArrayLength = maxSize;
    myBinding.ReaderQuotas.MaxBytesPerRead = maxSize;
    myBinding.ReaderQuotas.MaxNameTableCharCount = maxSize;
    ChannelFactory<IMCSPConnectorChannel> myFactory = null;
    //SPSecurity.RunWithElevatedPrivileges(delegate()
    var constants = new Settings(SPContext.Current.Site);//siteelev);
    string endpointAddress = constants.WcfUrl;
    EndpointAddress myEndpoint = new EndpointAddress(endpointAddress);
    myFactory = new ChannelFactory<IMCSPConnectorChannel>(myBinding, myEndpoint);
    IMCSPConnectorChannel channel = myFactory.CreateChannel();
    factory = myFactory;
    return channel;
    Client and factory are both disposed after each usage.
    this is the simplified code with some comments
    IMCSPConnectorChannel channel = CommonFunctions.CreateWCFclient();
    using (var proxy = channel.Wrap<IMCSPConnectorChannel>())
    var svcClient = proxy.BaseObject;
    try
    // do something - works ok
    if (success)
    //try update
    try
    //time consuming WCF method - sometimes 2 minutes, however it passes and in the WCF log is record about it just a second before it crashes back here
    svcClient.TaskUpdate(new TaskUpdateRequest(_taskID));
    catch (FaultException fe)
    //some processing here - not reached
    catch (Exception ue)
    //here it goes to - exception is caught and
    success = false;
    siteelev.WriteLogError(String.Format("Task '{0}' - task update fail on general exception: {1}", _taskID, ue.ToStringWithInnerExceptions()));
    //previos line is processesd, no more code exists after that
    //go back to folder if WCF returns success
    if (success)
    //not reached (success has been set to false when it crashed)
    else
    siteelev.WriteLogInfo("Some log text");
    //this is ALSO NOT reached!! why, I don't understand
    catch (Exception ee)
    // it goes to here!! why ? - the exception has been already handled!
    throw;;
    I don't understand why it goes to the second catch when the exception has been already hadled in previous catch and why it doesn't go into success=false block.
    Any idea what can be wrong?
    Many thanks
    Filip

    Hi,
    thanks for your reply. Now it seems that everything works (I'm still keepng my fingers crossed ;-)
    What we did:
    1) to the page I added 
    protected void Page_Load(object sender, EventArgs e)
                    this.Page.Server.ScriptTimeout = 3600;
    2) to WCF confing at server side we added 
     <serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100"/>
    But if this is what helped, I don't know. The timeout had to be already set in cofig files, but this is only what the SP server administrator claimed, I haven't done it personally. This seems to be much clear
    for me.

  • After thread abort in Sandbox solution, the process is triggered again

    Hi,
    I am facing a problem of the process being triggered again, after thread abort of sandbox solution webpart on SharePoint 2013 Online.
    I have created a sandboxed solution webpart and deployed it on SharePoint 2013 Online. The webpart contains two buttons. The click event of the buttons is added in CreateChildControls methods.
     On the click of the first button, the process completes in 1 second.
    On click of the second button, the process takes more than 30 seconds to complete. As a result, the thread aborts and the process being aborted is triggered again. This creates duplicate processing.
    If I deploy the same solution on a SharePoint 2010 environment, the process is not triggered again after being aborted.
    I am fine with the thread being aborted, but I am not able to understand why the process is being triggered again.
    I want to stop the process from being triggered again after getting aborted.
    Any help would be appreciated.

    Hello !
           If no workflows are associated with the business object BUS2081 and the event POSTED, deactivate it at SWE2.
           Otherwise, you should resolve the cause for dump.To know the reason for dump, following transactions would be helpful : ST22,ST01,ST05 and ST12.
           Instead of checking at SWEQDEL transaction, check at SWEQADM transaction.
    Regards,
    S.Suresh.

  • Thread Locking Exception

    Hi All,
    Many times while working on MDM via MDM API's I received Thread Locking Exception. This Exception is so severe that it leads MDM Data Manager in  hanged state and get resolved only by restarting the server. Sometimes I do not get this exception but Data Manager gets hanged, even I am unable to open Console also. Please answer this question.
    Thanks ..
    Vibha

    Hello All,
    Still we haven't able to resolve this issue. We already have SR with oracle. So many logs were captured.
    Below is the snippet of seedSchedulerdata.log
    ${work.dir}Entered Validate methodExiting Validate method------------------------------------------------------------
    Start seeding task
    job name--> Password Expiration Task
    schTaskName--> Password Expiration Task
    task class name--> com.thortech.xl.schedule.tasks.tcTskPasswordExpiration
    task job disable--> 0
    task frequency--> DAILY
    task maxRetries--> 5
    task retryCount--> 0
    task paramName--> Email Definition Name
    task paramValue--> Password Expired
    task paramTpe--> String
    Updating Job :Password Expiration Task with keys
    java.lang.Exception: Unable to seed scheduler data due to configuration problems. Contact System Administrator
         at oracle.iam.scheduler.seed.SeedSchedulerData.startSeeding(SeedSchedulerData.java:770)
         at oracle.iam.scheduler.seed.SeedSchedulerData.main(SeedSchedulerData.java:113)
    If any of them faced such issue please help.
    Thanks
    DK

  • Thread was being aborted Exception while creating large number of Sites in SharePoint 2013

    Hi All,
    I am getting threading exception while creating a large extent of sites in SharePoint 2013. I am reading data from an excel file and then looping each row. The sites are creating for first two rows then i am getting exception. This code working fine in dev
    server but not in UAT server. I tried with changing maxRequestLength in web.config but not working. And also followed the below link.
    http://support.microsoft.com/kb/928756
    My code as follows-
    private void CreateSites(DataRow dr)
                try
                    using (SPSite site = new SPSite(OtherSiteCollection)) // I am creating sites in another site collection
                        using (SPWeb web = site.OpenWeb())
                                SPWeb newWeb = null;
                                SPWebTemplateCollection templates = site.RootWeb.GetAvailableWebTemplates(1033);
                                SPWebTemplate template = (from SPWebTemplate m in
                                                              templates
                                                          where m.Title == "SiteTemplate"
                                                          select m).FirstOrDefault(); //Here i am using custom template
        string siteName = dr["Site Name"].ToString();
                                newWeb = web.Webs.Add(siteTitle, siteTitle, siteDescription, 1033, template, true, false); //Getting exception here.
                                newWeb.Update();
                                newWeb.Dispose();
                catch (Exception ex)
                    lblMsg.Text = "Exception in create sites : " + ex.Message + ";" + ex.StackTrace + ";" + ex.ToString()
    I am getting error as-
    Exception in create sites: Thread was being aborted.;   at Microsoft.SharePoint.Library.SPRequestInternalClass.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent,
    String& bstrWebTemplate, Int32& plWebTemplateId)
       at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, String& bstrWebTemplate, Int32& plWebTemplateId)
       at Microsoft.SharePoint.SPWeb.ProvisionWebTemplate(SPWebTemplate webTemplate, String webTemplateToUse, SPFeatureWebTemplate featureWebTemplate)
       at Microsoft.SharePoint.SPWeb.ApplyWebTemplate(SPWebTemplate webTemplate)
       at Microsoft.SharePoint.SPWeb.CreateWeb(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean bCreateUniqueSubweb, Boolean bConvertIfThere, Guid appInstanceId)
       at Microsoft.SharePoint.SPWeb.SPWebCollectionProvider.CreateWeb(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean bCreateUniqueSubweb, Boolean bConvertIfThere, Guid appInstanceId)
       at Microsoft.SharePoint.SPWebCollection.Add(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean useUniquePermissions, Boolean bConvertIfThere, Guid appInstanceId)
       at Microsoft.SharePoint.SPWebCollection.Add(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, SPWebTemplate WebTemplate, Boolean useUniquePermissions, Boolean bConvertIfThere)
       System.Threading.ThreadAbortException: Thread was being aborted.
       at Microsoft.SharePoint.Library.SPRequestInternalClass.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, String& bstrWebTemplate, Int32&
    plWebTemplateId)
       at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, String& bstrWebTemplate, Int32& plWebTemplateId)
       at Microsoft.SharePoint.SPWeb.ProvisionWebTemplate(SPWebTemplate webTemplate, String webTemplateToUse, SPFeatureWebTemplate featureWebTemplate)
       at Microsoft.SharePoint.SPWeb.ApplyWebTemplate(SPWebTemplate webTemplate)
       at Microsoft.SharePoint.SPWeb.CreateWeb(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean bCreateUniqueSubweb, Boolean bConvertIfThere, Guid appInstanceId)
       at Microsoft.SharePoint.SPWeb.SPWebCollectionProvider.CreateWeb(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean bCreateUniqueSubweb, Boolean bConvertIfThere, Guid appInstanceId)
       at Microsoft.SharePoint.SPWebCollection.Add(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean useUniquePermissions, Boolean bConvertIfThere, Guid appInstanceId)
       at Microsoft.SharePoint.SPWebCollection.Add(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, SPWebTemplate WebTemplate, Boolean useUniquePermissions, Boolean bConvertIfThere)
    Thread was being aborted.;   at System.Threading.ThreadAbortException: Thread was being aborted.
    Can anyone please help. Thanks!
    dinesh

    If you do this from a Console application, does it succeed?
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Thread unserialized exception: NotSerializableException: java.lang.Thread

    hello experts,
    i have this exception coming; seems to be coming from some thread but i removed all the threads from my code, i thought its because of some object which is still unserialized, i am not sure whether this is because of one unserialized object or its because of more reasons, please have a look:
    Exception in client main: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
         java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.lang.Thread
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
         java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.lang.Thread
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173)
         at BallServerImpl_Stub.getAllBallProxies(Unknown Source)
         at CopyOfManyMovingBalls.<init>(CopyOfManyMovingBalls.java:80)
         at CopyOfManyMovingBalls$2.run(CopyOfManyMovingBalls.java:294)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.lang.Thread
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
         at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155)
         ... 11 more
    this is coming  when i m accessing this method:
    class BallServerImpl extends UnicastRemoteObject
    implements BallServer
    * @return an enumeration of all Balls as proxy objects
    public Ball[] getAllBallProxies() throws java.rmi.RemoteException
         Ball[] locations1 = new Ball[hash.size()];
    java.util.Enumeration iter = hash.elements();
    int idx = 0;
    while (iter.hasMoreElements())
         BallImpl impl = (BallImpl)iter.nextElement();
    locations1[idx++] = new BallProxy(impl);
    return locations1;
    why this function is running fine when i m calling this from client unlike getAllBallProxies() nevertheless both are returning the same thing:
    * @return an enumeration of all Balls as remote references
    public Ball[] getAllBalls()
         Ball[] locations = new Ball[hash.size()];
    java.util.Enumeration iter = hash.elements();
    int idx = 0;
    while (iter.hasMoreElements())
    locations[idx++] = (Ball)iter.nextElement();
    return locations;
    the proxy Class:
    * The Proxybouncing ball.
    public class BallProxy implements Serializable,Ball {
    * The Real bouncing ball.
    public class BallImpl extends UnicastRemoteObject implements IBallRemote,Serializable
    *load of thanks as this is "SHOW STOPPER",
    jibbylala*
    Edited by: 805185 on Oct 25, 2010 8:33 PM
    Edited by: 805185 on Oct 25, 2010 8:39 PM
    Edited by: 805185 on Oct 25, 2010 9:21 PM
    Edited by: 805185 on Oct 25, 2010 9:25 PM
    Edited by: 805185 on Oct 25, 2010 9:27 PM
    Edited by: 805185 on Oct 25, 2010 9:46 PM

    that there was some thread there in BallProxy but i removed all from them and now testingIf you don't post the code people ask to see, you may never get a useful answer here.
    P.S i didn't know that threads are not SerializedThe Thread class is not Serializable. Precision please.
    Now i m updating the code, i needed the confirmationConfirmation of what?
    and now trying to avoid them.Them?
    But what if i need them.Them?
    Please make the effort to express yourself clearly. You've already been told you're not making much sense and you haven't done anything about it.
    how can we make serialized?The concept of serializing a Thread makes no sense whatsoever. You don't want to do it. You don't need to do it. You can't do it. It wouldn't work if you could do it.
    Somewhere or other you have a class member that is a reference to a Thread. Remove it or make it transient. If you post the code somebody may help you. If you don't, nobody can possibly do that.

  • Transaction Aborted Exceptions are seen when service downloading data

    Hi,
    We are getting two different types of exceptions while one service trying to download data from another service
    There are two scenarios where we are getting these transaction exceptions that are seen when client's service downloads data from server's service.
    1. The first kind of transaction exception is seen when service is trying to send the message to messaging queue in the InitialReceiveNext() method. The queue.send method throws this exception and the stack trace is as mentioned below:
    04 Jun 2014 19:16:12,805 [BridgeExchanger] TRACE - Sending queue message 00000000-0000-0000-0000-000000000000\0 to queue private$\msgqueue
    04 Jun 2014 19:16:12,806 [ClientBridgeEndpoint] ERROR - Error occurred during Receive!
    System.Transactions.TransactionException: The operation is not valid for the state of the transaction. ---> System.TimeoutException: Transaction Timeout
    — End of inner exception stack trace —
    at System.Transactions.TransactionState.Promote(InternalTransaction tx)
    at System.Transactions.Transaction.Promote()
    at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transaction transaction)
    at System.Transactions.TransactionInterop.GetDtcTransaction(Transaction transaction)
    at System.Messaging.MessageQueue.StaleSafeSendMessage(MQPROPS properties, IntPtr transaction)
    at System.Messaging.MessageQueue.SendInternal(Object obj, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)
    at CI.Platform.Bus.Bridge.Client.BridgeExchanger.InitialReceiveNext(DownloadEndpoint endpoint)
    at CI.Platform.Bus.Bridge.Client.BridgeExchanger.ReceiveNext()
    at CI.Platform.Bus.Bridge.Client.ClientBridgeEndpoint.Exchange(Object state)
    2. The second kind of exception is seen at the transaction.complete statement in the InitialReceiveNext() method. The stack trace is as shown below:
    04 Jun 2014 23:15:59,152 [BridgeExchanger] DEBUG - Skipping the download message as the message is already downloaded..No new message is added to queue private$\msgqueue
    04 Jun 2014 23:15:59,153 [ClientBridgeEndpoint] ERROR - Error occurred during Receive!
    System.Transactions.TransactionAbortedException: The transaction has aborted. ---> System.TimeoutException: Transaction Timeout
    — End of inner exception stack trace —
    at System.Transactions.TransactionStateAborted.BeginCommit(InternalTransaction tx, Boolean asyncCommit, AsyncCallback asyncCallback, Object asyncState)
    at System.Transactions.CommittableTransaction.Commit()
    at System.Transactions.TransactionScope.InternalDispose()
    at System.Transactions.TransactionScope.Dispose()
    at CI.Platform.Bus.Bridge.Client.BridgeExchanger.InitialReceiveNext(DownloadEndpoint endpoint)
    at CI.Platform.Bus.Bridge.Client.BridgeExchanger.ReceiveNext()
    at CI.Platform.Bus.Bridge.Client.ClientBridgeEndpoint.Exchange(Object state)
    If anybody has any insight please reply.
    Thanks in advance!!!

    Hello,
    Your two questions are both related to MSMQ forum. Please post threads on that forum for more effective response. Please refer to
    http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/home?forum=msmq. Thank you for understanding.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Fixed size thread pool excepting more tasks then it should

    Hello,
    I have the following code in a simple program (code below)
              BlockingQueue<Runnable> q = new ArrayBlockingQueue<Runnable>(10, false);
              ThreadPoolExecutor newPool = new ThreadPoolExecutor(1, 10, 20, TimeUnit.SECONDS, q);
    for (int x = 0; x < 30; x++) {
    newPool.execute(new threaded());
    My understanding is that this should create a thread pool that will accept 10 tasks, once there have been 10 tasks submitted I should get RejectedExecutionException, however; I am seeing that when I execute the code the pool accepts 20 execute calls before throwing RejectedExecutionException. I am on Windows 7 using Java 1.6.0_21
    Any thoughts on what I am doing incorrectly?
    Thanks
    import java.util.concurrent.*;
    public class ThreadPoolTest {
         public static class threaded implements Runnable {
              @Override
              public void run() {
                   System.out.println("In thread: " + Thread.currentThread().getId());
                   try {
                        Thread.sleep(5000);
                   } catch (InterruptedException e) {
                        System.out.println("Thread: " + Thread.currentThread().getId()
                                  + " interuptted");
                   System.out.println("Exiting thread: " + Thread.currentThread().getId());
         private static int MAX = 10;
         private Executor pool;
         public ThreadPoolTest() {
              super();
              BlockingQueue<Runnable> q = new ArrayBlockingQueue<Runnable>(MAX/2, false);
              ThreadPoolExecutor newPool = new ThreadPoolExecutor(1, MAX, 20, TimeUnit.SECONDS, q);
              pool = newPool;
         * @param args
         public static void main(String[] args) {
              ThreadPoolTest object = new ThreadPoolTest();
              object.doThreads();
         private void doThreads() {
              int submitted = 0, rejected = 0;
              for (int x = 0; x < MAX * 3; x++) {
                   try {
                        System.out.println(Integer.toString(x) + " submitting");
                        pool.execute(new threaded());
                        submitted++;
                   catch (RejectedExecutionException re) {
                        System.err.println("Submission " + x + " was rejected");
                        rejected++;
              System.out.println("\n\nSubmitted: " + MAX*2);
              System.out.println("Accepted: " + submitted);
              System.out.println("Rejected: " + rejected);
    }

    I don't know what is wrong because I tried this
    public static void main(String args[])  {
        BlockingQueue<Runnable> q = new ArrayBlockingQueue<Runnable>(10, false);
        ThreadPoolExecutor newPool = new ThreadPoolExecutor(1, 10, 20, TimeUnit.SECONDS, q);
        for (int x = 0; x < 100; x++) {
            System.err.println(x + ": " + q.size());
            newPool.submit(new Callable<Void>() {
                @Override
                public Void call() throws Exception {
                    Thread.sleep(1000);
                    return null;
    }and it printed
    0: 0
    1: 0
    2: 1
    3: 2
    4: 3
    5: 4
    6: 5
    7: 6
    8: 7
    9: 8
    10: 9
    11: 10
    12: 10
    13: 10
    14: 10
    15: 10
    16: 10
    17: 10
    18: 10
    19: 10
    20: 10
    Exception in thread "main" java.util.concurrent.RejectedExecutionException
         at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1768)
         at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
         at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)
         at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:92)
         at Main.main(Main.java:36)
         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:597)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)Ihave Java 6 update 24 on Linux, but I don't believe this should make a difference. Can you try my code?

  • Sudden exit of Thread without Exception or Error

    Hi @all,
    I've got some strange problem.
    Within my socket server I handle each request within a Thread. Inside this Thread, the whole code is surrounded by...
    try
    catch( Throwable th )
    Sometimes a Thread dies without occurence of any Exception or Error.
    Especially strage is, that (if it crashes) always objects of the same class and exactly the same line of code is executed last.
    There is kind of logging, that is executed last, like ...
    logLogger.debug( "" );
    Next should be getting the instance of a Singleton, which is a database connection pool, and getting a database connection out of it.
    DbConnectionPool.getInstance().getDbConnection();
    Within "getInstance()", the first line of code is logging, as well as the first line of "getDbConnection()".
    The logger that I use is log4j. The same code is used in many classes, but the error only occurs in few of them.
    Do you have any idea, what this error could be about?
    Could it be, that there is no Throwable risen in case of an error, but only the concerning Thread dies, but the whole virtual machine and other functionality works well, as before?
    My system :
    Suse Linux Enterprise Server Version 8 /
    Suse Linux Enterprise Server Version 10
    At least 4 CPUs and 8 GiB of RAM, as well as enough space on hard disk.
    Java virtual machine :
    Java(TM) SE Runtime Environment (build 1.6.0_20-b02), Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode) /
    Java(TM) SE Runtime Environment (build 1.6.0-b105), Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode)
    Many thanks in advance.
    Bye ... Christian

    The concerning code is as follows.
    The Thread class :
    try
    // Get AddressCount parameter from configuration.
    int iAddressCount = 0;
    try
    iAddressCount = Integer.parseInt( elmF1755.getAttributeValue( ATT_ADDRESSCOUNT ) );
    logLogger.debug( "Received AddressCount from configuration : " + iAddressCount ); *// This is the last executed line of code.*
    catch( Exception ex )
    throw new Exception( String.format( "Invalid configuration attribute <%1$s : %2$s : %3$s>.", Constants.FUNCTIONPARAMETER, Constants.ELM_F1755, Constants.ATT_ADDRESSCOUNT ), ex );
    // Get free database connection from the pool.
    clsDB = DbConnectionPool.getInstance().getDbConnection();
    if( clsDB == null )
    throw new Exception( "No free database connection available." );
    catch( Throwable th )
    String strError = th.getClass().getSimpleName() + " occured. (" + th.getMessage() + ")";
    logLogger.error( strError, th );
    clsResponse.clear();
    clsResponse.setTag( SSI_T002_FUNCID, GLF1755_ID );
    clsResponse.setFuncOrRetVal( SSI_E999_SYSERROR, strError );          
    return clsResponse.getResponseString();
    finally
    // Clean-up
    if( result != null )
    result.close();
    logLogger.debug( "End execute." );
    The DbConnectionPool code :
    public static DbConnectionPool getInstance()
    throws Exception
    logLogger.debug( "Get instance of the DbConnectionPool." ); *// This should be executed next*
    if( instance == null )
    instance = new DbConnectionPool();
    return ( instance );
    public synchronized Connection getConnection()
    logLogger.debug( "Start getConnection." ); *// This should be executed as well*
    }

  • How to stop the 2nd thread when 1st thread caught exception.

    Hello Friends,
    I have written a java program using Thread.
    In this program i have created two separate threads.
    For example Thread1 and Thread2.
    During execution of both threads,
    If any exception comes on Thread1 or Thread2, the other thread should not be continued its execution. Suddenly the other thread has to interrupted its execution.
    How to do this. If any body know the way to do this, please help me.
    Rgds
    tskarthikeyan

    Try this. It was working Fine.
    public class ThreadComm {
         public static volatile boolean exceptionThrown= true;
         public static void main(String[] args) {
              Thread t1 = new Thread(new Runnable() {
                   public void run () {
                        try {
                             /*if (exceptionThrown) {
                                  System.out.println("First Thread Interrupted");
                                  return;
                             for(int i=1;i<=5000;i++){
                                  System.out.println("FirstThread>>"+i);
                                  if(i==2500) {
                                       throw new Exception("First Thread Interrupted");
                        }catch(Exception e) {
                             exceptionThrown = false;
              Thread t2 = new Thread(new Runnable() {
                   public void run() {
                        try {
                             /*if (exceptionThrown) {
                                  System.out.println("Second Thread Interrupted");
                                  return;
                             for(int i=1;i<=1000;i++){
                                  System.out.println("SecondThread>>"+i);
                                  if(i==777) {
                                       throw new Exception("Second Thread Interrupted");
                             int i=0;
                             while(exceptionThrown && i<=5000) {
                                  System.out.println("SecondThread>>"+i);
                                  if(i==4000) {
                                       throw new Exception("Second Thread Interrupted");
                                  i++;
                        }catch(Exception e) {
                             exceptionThrown = true;
              t1.start();
              t2.start();
    }

  • JEditorPane PageLoader thread causing exceptions, not on EDT

    Hello,
    I have a swing GUI that creates a JEditorPane component and loads up an HTML file using the setPage() method to finally display it. I'm occaisionally getting NullPointerExceptions and ArrayIndexOutOfBoundsExceptions when running the GUI. It is apparent that the JEditor pane spawns a page loading process to load up the HTML. When the loading completes, this page loading thread signals the swing JEditorPane component to update its display. Because the signalling is being done from the pageloader thread and not from the EDT it seems to be creating race conditions and therefore the exceptions.
    An example of the typical stacktrace thrown is:
    Exception in thread "Thread-6" java.lang.NullPointerException
    at javax.swing.text.CompositeView.replace(CompositeView.java:200)
    at javax.swing.text.CompositeView.loadChildren(CompositeView.java:97)
    at javax.swing.text.FlowView$LogicalView.loadChildren(FlowView.java:684)
    at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
    at javax.swing.text.FlowView.loadChildren(FlowView.java:122)
    at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
    at javax.swing.text.FlowView.setParent(FlowView.java:272)
    at javax.swing.text.html.ParagraphView.setParent(ParagraphView.java:58)
    at javax.swing.text.CompositeView.replace(CompositeView.java:200)
    at javax.swing.text.BoxView.replace(BoxView.java:164)
    at javax.swing.text.CompositeView.loadChildren(CompositeView.java:97)
    at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
    at javax.swing.text.html.BlockView.setParent(BlockView.java:55)
    at javax.swing.text.CompositeView.replace(CompositeView.java:200)
    at javax.swing.text.BoxView.replace(BoxView.java:164)
    at javax.swing.text.html.TableView$RowView.replace(TableView.java:1457)
    at javax.swing.text.CompositeView.loadChildren(CompositeView.java:97)
    at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
    at javax.swing.text.CompositeView.replace(CompositeView.java:200)
    at javax.swing.text.BoxView.replace(BoxView.java:164)
    at javax.swing.text.html.TableView.replace(TableView.java:896)
    at javax.swing.text.CompositeView.loadChildren(CompositeView.java:97)
    at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
    at javax.swing.text.html.TableView.setParent(TableView.java:800)
    at javax.swing.text.CompositeView.replace(CompositeView.java:200)
    at javax.swing.text.BoxView.replace(BoxView.java:164)
    at javax.swing.text.CompositeView.loadChildren(CompositeView.java:97)
    at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
    at javax.swing.text.html.BlockView.setParent(BlockView.java:55)
    at javax.swing.text.html.HTMLEditorKit$HTMLFactory$BodyBlockView.setParent(HTMLEditorKit.java:1277)
    at javax.swing.text.CompositeView.replace(CompositeView.java:200)
    at javax.swing.text.BoxView.replace(BoxView.java:164)
    at javax.swing.text.View.updateChildren(View.java:1095)
    at javax.swing.text.View.insertUpdate(View.java:679)
    at javax.swing.plaf.basic.BasicTextUI$RootView.insertUpdate(BasicTextUI.java:1590)
    at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.insertUpdate(BasicTextUI.java:1849)
    at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:185)
    at javax.swing.text.DefaultStyledDocument.create(DefaultStyledDocument.java:145)
    at javax.swing.text.html.HTMLDocument.create(HTMLDocument.java:281)
    at javax.swing.text.html.HTMLDocument$HTMLReader.flushBuffer(HTMLDocument.java:3323)
    at javax.swing.text.html.HTMLDocument$HTMLReader.flush(HTMLDocument.java:2127)
    at javax.swing.text.html.HTMLEditorKit.read(HTMLEditorKit.java:231)
    at javax.swing.JEditorPane.read(JEditorPane.java:557)
    at javax.swing.JEditorPane.read(JEditorPane.java:585)
    at javax.swing.JEditorPane$PageLoader.run(JEditorPane.java:648) As can be seen from the stack trace, the javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:185) line is called from the PageLoader.run thread which attempts to manipulate the swing component.
    I haven't prepared a small compact test case for this yet as it is a race condition and only occurs under certain timings. The GUI on my machine throws these exceptions on almost every second run but far less frequently on another test machine.
    I'm using Java 6 u 13 b 3 in linux ubuntu Jaunty.
    Is there a way to load the page synchronously or to correctly load the page without causing these exceptions?
    Thanks,
    Mark
    Edited by: Mark_Silberbauer on Jun 9, 2009 11:30 AM

    I would try to create a HTMLDocument instance and read content there by the kit you use. When the document's filling is finished just call editorPane.setDocument() in EDT.
    Regards,
    Stas

  • Illegal thread state exception.

    I created a thread that runs a process with some 1 gb of data throughput. the process exits for low data. but for huge data. it says illegal thread state of exception.
    sample code :
    Runtime rt = Runtime.getRuntime();
    Process child =rt.exec("myprocess.exe hugefile.txt");
    child.exitValue();
    here hugefile.txt contains some 30000 lines of text.
    for thisdata. its shouldnt work.
    can u suggest me one of the efficient and effective code for
    thread processing.
    please help me.

    You are calling exitValue() before the process exists (and so there's no exit value).
    You have to call waitFor() to wait for it to finish.
    Process process = Runtime.getRuntime().exec("myprocess.exe hugefile.txt");
    int exitValue = process.waitFor(); // You don't have to call exitValue() since waitFor() will also return the exit value

  • AWT  Thread and Exceptions

    I have a gui application in which I need to get a reference to the thread group that runs the gui.
    I what this because I need to catch any runtime exceptions that are caused by the gui, or the program. Once I have caught the exception I want to let the user know that a fatal error has occured and to report it.
    I know how my error reporting mechanism is going to work, but I dont know how to get a hold of the underlying threads of a gui, or there tread group. Any help would be appreciated.

    is this not sufficient/simple enough?
    public static void main(String[] args)
         JFrame app = null;
         try
              // initialisation code here
         catch(Throwable e)
              if(app != null)
                   // report to app
              else
                   e.printStackTrace();
                   System.exit(1);
    }

  • Thread and Exception

    I'm developping a library in Java that deals with network.
    I've got a multithreaded class that use a socket.
    In the run() function i keep reading the socket, that implies i have to try, catch IOException.
    The matter is that as i'm developping a library, i'd like to let the user choose what to do with this exception. I'd like to throw the exception.
    But the prototype of the run function don't allow to throw anything.
    Can anyone can give me a trick to manage a fake throw ?
    thank you
    Fabrice

    >
    - Runtime exceptions may be uncaught, without any
    compiler warning.This is unrelated to multithreading. By definition,
    RuntimeException, Error, and their descendants are
    unchecked exceptions, meaning they're usually preventable
    with good coding practices and/or you can't recover from
    them anyway, so there's no reason to explicitly declare them.
    A completely separate issue is that any exceptions--checked or
    unchecked--thrown in thread that you spawn will not be visible to the
    spawning thread.
    - hashtable may not be read by the user.Not sure what you mean here. If there's some hashtable in the new thread
    that you want to read, you can do so. You just need to provide a reference
    to it before starting the thread.
    - listener, in event style method, may not be
    register.Again, not sure what you mean here, but you CAN register listeners so that the original thread
    is notified of events in the new thread.
    >
    What's the worse solution !!
    Anyone knows why it's impossible to declare run() as a
    throwing exception function ?Your run method can't throw an exception because the declaration of the method it's implementing doesn't allow it. The reason Run.runnable doesn't allow it is beacause it doesn't make any sense for an independent thread to throw an exception back to the thread that spawned it.

  • Error Msg: RemoteException occurred in server thread; nested exception is:

    Hi Everyone,
    I got the above msg and does anyone has any idea what could be the root of the problem? Attached below is extraction from the server log file.
    Thanks,
    Kelvin
    Server Log
    [#|2005-09-28T23:28:59.836+0800|INFO|sun-appserver-pe8.1_01|javax.enterprise.system.container.ejb|_ThreadID=21;|EJB5018: An exception was thrown during an ejb invocation on [SupplierTableFacadeBean]|#]
    [#|2005-09-28T23:28:59.836+0800|INFO|sun-appserver-pe8.1_01|javax.enterprise.system.container.ejb|_ThreadID=21;|
    javax.ejb.EJBException
         at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:2807)
         at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:2713)
         at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:2521)
         at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:819)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:137)
         at $Proxy89.createSupplier(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:324)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:167)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at supplier._SupplierTableFacadeRemote_DynamicStub.createSupplier(_SupplierTableFacadeRemote_DynamicStub.java)
         at org.apache.jsp.process.supplier.addsupplier_005fprocess_jsp._jspService(addsupplier_005fprocess_jsp.java:141)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         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:324)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:184)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
    Caused by: java.lang.NullPointerException
         at supplier.SupplierTableFacadeBean.createSupplier(SupplierTableFacadeBean.java:89)
         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:324)
         at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:153)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:950)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:158)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:128)
         ... 44 more
    |#]
    -----------------------------------------------------------------------------------------------------------------------------------------------------

    I have attached my createSupplier method from the session bean. I hope it helps in finding the problem
    Regards,
    Kelvin
    public String createSupplier(String supid, String password, String name, String address,String contactno, String faxno, String email, String kcpersonnal, String kcpdesignation, String cpcno, String industry, String natureofbiz, String paidupcapital, String preferredcontract, Integer creditrating, String others) throws FinderException, UserException{
    SupplierTableLocal supplierTable = null;
    String key;
    boolean ok;
    //Checking for the minimum creation values.
    if ( supid.equals("") || password.equals("") || name.equals("")|| address.equals("")|| contactno.equals("") || faxno.equals("")|| email.equals("")|| kcpersonnal.equals("") || kcpdesignation.equals("")|| cpcno.equals("")|| industry.equals("")|| natureofbiz.equals("")||paidupcapital.equals("")) {
    throw new UserException("Please enter the userid, password, name, address, contactno, faxno, email, kcpersonnel, kcpdesignation, cpcno, industry, natureofbiz, paidupcapital.");
    //Checks if supplierid is unique.
    else{
    Collection list = supplierHome.findBySupid(supid);
    if( (list.size() != 0) ) {
    throw new UserException("SupplierID already exists.");
    //If SupplierID chosen is unique
    else {
    do{
    key = supid;
    //Check if the Primary Key has already been taken
    try{
    supplierTable = supplierHome.findByPrimaryKey(key);
    ok = true;
    catch (javax.ejb.FinderException ex) {
    ok = false;
    } while (ok);
    try{
    supplierTable = supplierHome.create(supid, password, name, address, contactno, faxno, email, kcpersonnal, kcpdesignation, cpcno, industry, natureofbiz, paidupcapital, preferredcontract, creditrating, others);
    catch (javax.ejb.CreateException e){
    return null;
    return key;
    }

Maybe you are looking for