Results 1 to 8 of 8
  1. #1
    narsi is offline Member
    Join Date
    Nov 2014
    Posts
    8
    Rep Power
    0

    Post geeting java.lang.LinkageError: loader constraints violated when linking exception

    The following is the Snippest code in that in that iam getting java.lang.LinkageError: loader constraints violated when linking
    at underlined place
    installmentMessageResponseBean = (InstallmentMessageResponseBean) responseBean;
    String sourceTemplatePDFURL="D://jboss_ckm//CA-PDL-ENG.pdf"; //source file path
    System.out.println("====================sourceTemp latePDFURL "+sourceTemplatePDFURL);
    // String sessionIdFolderAbsolutePath = (String) request.getSession().getAttribute("UserSessionTemp oraryFilesPath");
    //System.out.println("=====================sessionId FolderAbsolutePath "+sessionIdFolderAbsolutePath);
    //advanceMessageResponseBean = (AdvanceMessageResponseBean) responseBean;
    agreementBean = installmentMessageResponseBean.getAgreementBean();
    System.out.println("======dealNbr === "+agreementBean.getDealNbr());
    String dt = DateUtil.getCurrentDate().toString();
    dt = dt.replace("-", "");
    dt = dt.replace(":", "");
    dt = dt.replace(".", "");
    dt = dt.replace(" ", "_");
    System.out.println("======dt.getCurrentDate() === "+dt);
    String destinationPDFURL = "D:/" + "CA_PDL_ENG"+agreementBean.getDealNbr()+"_"+dt+".p df";
    System.out.println("====================destinatio nPDFURL "+destinationPDFURL);
    // advanceMessageResponseBean = (AdvanceMessageResponseBean) responseBean;
    //System.out.println("====================checkPrint ingResponseBean.getResponseCode() "+advanceMessageResponseBean.getResponseCode() );
    HistoryAgreementPdf historyAgreementPdf = new HistoryAgreementPdf();
    historyAgreementPdf.getCheckPrinterDetails(agreeme ntBean,"", sourceTemplatePDFURL, destinationPDFURL);

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: geeting java.lang.LinkageError: loader constraints violated when linking exceptio

    When posting code please wrap it in code tags to retain its formatting.
    That's unreadable as it is.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    narsi is offline Member
    Join Date
    Nov 2014
    Posts
    8
    Rep Power
    0

    Default Re: geeting java.lang.LinkageError: loader constraints violated when linking exceptio

    The following is snipset code at highileted place iam getting that exception please help me


    PHP Code:
    installmentMessageResponseBean = (InstallmentMessageResponseBean) responseBean;
     String sourceTemplatePDFURL="D://jboss_ckm//CA-PDL-ENG.pdf"; //source file path
     System.out.println("====================sourceTemp latePDFURL "+sourceTemplatePDFURL);
     // String sessionIdFolderAbsolutePath = (String) request.getSession().getAttribute("UserSessionTemp oraryFilesPath");
     //System.out.println("=====================sessionId FolderAbsolutePath "+sessionIdFolderAbsolutePath);
     //advanceMessageResponseBean = (AdvanceMessageResponseBean) responseBean;
     agreementBean = installmentMessageResponseBean.getAgreementBean();
     System.out.println("======dealNbr === "+agreementBean.getDealNbr());
     String dt = DateUtil.getCurrentDate().toString();
     dt = dt.replace("-", "");
     dt = dt.replace(":", "");
     dt = dt.replace(".", "");
     dt = dt.replace(" ", "_");
     System.out.println("======dt.getCurrentDate() === "+dt);
     String destinationPDFURL = "D:/" + "CA_PDL_ENG"+agreementBean.getDealNbr()+"_"+dt+".p df";
     System.out.println("====================destinatio nPDFURL "+destinationPDFURL);
     // advanceMessageResponseBean = (AdvanceMessageResponseBean) responseBean;
     //System.out.println("====================checkPrint ingResponseBean.getResponseCode() "+advanceMessageResponseBean.getResponseCode() );
     HistoryAgreementPdf historyAgreementPdf = new HistoryAgreementPdf();
    [COLOR="#FF0000"] [B]historyAgreementPdf.getCheckPrinterDetails(agreementBean,"", sourceTemplatePDFURL, destinationPDFURL)[/B];[/COLOR]

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: geeting java.lang.LinkageError: loader constraints violated when linking exceptio

    OK.
    That exception will give you the class name that is causing the problem.
    You have a copy of that class in some jar in your application which is clashing with the one on the server.
    You should remove the offending jar file from your application IIRC.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    narsi is offline Member
    Join Date
    Nov 2014
    Posts
    8
    Rep Power
    0

    Default Re: geeting java.lang.LinkageError: loader constraints violated when linking exceptio

    I added following lines of code additionally and iam checked hascode and class names.according to u it is giving different hash codes,but same class names how?
    the following is snippset code
    PHP Code:
    System.out.println("AgreementBean : 1 --->>> " + agreementBean.getClass().hashCode());
    	                System.out.println("AgreementBean : 2 --->>> " + agreementBean + " \n --->>> " + agreementBean.hashCode()+
    	                		"\n --->>>" + agreementBean.toString());
    for the above lines the foolowing is out put

    AgreementBean : 1 --->>> 620106128
    AgreementBean : 2 --->>> com.transaction.AgreementBean@4f7e2705
    --->>> 1333667589
    --->>>com.transaction.AgreementBean@4f7e2705

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: geeting java.lang.LinkageError: loader constraints violated when linking exceptio

    I'm not saying anything about the AgreementBean, as I don't know exactly which class that error is talking about. You haven't posted that bit of the exception message.

    I'm simply saying that the usual cause of that problem is you have a jar file in your application lib that is also in the server lib.
    It may not be the cause in your case, but until you post the full error message it's going to be all I can say.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    narsi is offline Member
    Join Date
    Nov 2014
    Posts
    8
    Rep Power
    0

    Default Re: geeting java.lang.LinkageError: loader constraints violated when linking exceptio

    the Following is the error message

    ERROR [[action]] Servlet.service() for servlet action threw exception
    java.lang.LinkageError: loader constraints violated when linking com/qfund/ml/transaction/AgreementBean class at com.qfund.wl.transaction.HistoryAgreementAction.pe rform(HistoryAgreementAction.java:106)
    at com.qfund.wl.action.ActionServlet.processActionPer form(ActionServlet.java:251)
    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1586)
    at com.qfund.wl.action.ActionServlet.process(ActionSe rvlet.java:56)
    at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:510)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:810)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    at com.qfund.wl.filters.HttpOnlyFilter.doFilter(HttpO nlyFilter.java:71)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    at com.qfund.wl.filters.ClickjackFilter.doFilter(Clic kjackFilter.java:29)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    at com.qfund.wl.filters.HttpOnlyFilter.doFilter(HttpO nlyFilter.java:71)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    at com.qfund.wl.filters.XSSFilter.doFilter(XSSFilter. java:27)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    at com.qfund.wl.filters.PerfFilter.doFilter(PerfFilte r.java:88)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:81)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:178)
    at org.jboss.web.tomcat.security.CustomPrincipalValve .invoke(CustomPrincipalValve.java:39)
    at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:153)
    at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:59)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:856)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:744)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread .run(MasterSlaveWorkerThread.java:112)
    at java.lang.Thread.run(Thread.java:595)

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: geeting java.lang.LinkageError: loader constraints violated when linking exceptio

    So you're going to need to see whether that class exists elsewhere, in another jar file, or something along those lines.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 0
    Last Post: 04-30-2013, 09:43 AM
  2. unreported exception java.lang.Exception
    By Marisabel in forum New To Java
    Replies: 6
    Last Post: 05-01-2011, 04:21 AM
  3. Replies: 5
    Last Post: 02-15-2011, 12:39 AM
  4. Replies: 5
    Last Post: 06-02-2010, 02:05 PM
  5. java.lang.LinkageError
    By rameshm77 in forum Advanced Java
    Replies: 0
    Last Post: 06-05-2008, 03:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •