PLEASE HELP java.lang.LinkageError

Hello,

I have an jsf managed bean that tries to exchange a dto with the ejb tier as follows:

publicvoid performSearch(){

SearchRequestDTO searchRequestDto =new SearchRequestDTO(this.keyword,this.country,this.postcode,this.commentExists,this.rating, this.websiteExists);

SearchSessionLocal searchSession = lookupSearchSessionBean();

List<EstablishmentLocal> retrievedEstablishments = searchSession.performSearch(searchRequestDto);

this.setRetrievedEstablishments(retrievedEstablishments);

System.out.println("here");

}

Here is the exception I get:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfillingthis request.

exception

javax.servlet.ServletException: #{SearchManagedBean.performSearch}: javax.faces.el.EvaluationException: java.lang.LinkageError: loader constraints violated when linking arcoiris/SearchRequestDTOclass

javax.faces.webapp.FacesServlet.service(FacesServlet.java:209)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)

root cause

javax.faces.FacesException: #{SearchManagedBean.performSearch}: javax.faces.el.EvaluationException: java.lang.LinkageError: loader constraints violated when linking arcoiris/SearchRequestDTOclass

com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)

javax.faces.component.UICommand.broadcast(UICommand.java:312)

javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)

javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)

com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)

com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)

com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)

javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)

Here is the full managed bean:

package arcoiris;

import java.util.ArrayList;

import java.util.List;

import javax.faces.model.SelectItem;

publicclass SearchManagedBean{

//Collected from search form

private String keyword;

private String country;

privateint[] postcode;

privateboolean commentExists;

privateint rating;

privateboolean websiteExists;

//Used to populate form

private List<SelectItem> availableCountries;

private List<SelectItem> availablePostcodes;

private List<SelectItem> availableRatings;

//Retrieved from ejb tier

private List<EstablishmentLocal> retrievedEstablishments;

//Service locator

private arcoiris.ServiceLocator serviceLocator;

//Constructor

public SearchManagedBean(){

System.out.println("within constructor SearchManagedBean");

}

//Getters and setters

public String getKeyword(){

return keyword;

}

publicvoid setKeyword(String keyword){

this.keyword = keyword;

}

public String getCountry(){

return country;

}

publicvoid setCountry(String country){

this.country = country;

}

publicboolean isCommentExists(){

return commentExists;

}

publicvoid setCommentExists(boolean commentExists){

this.commentExists = commentExists;

}

publicint getRating(){

return rating;

}

publicvoid setRating(int rating){

this.rating = rating;

}

publicboolean isWebsiteExists(){

return websiteExists;

}

publicvoid setWebsiteExists(boolean websiteExists){

this.websiteExists = websiteExists;

}

public List<SelectItem> getAvailableCountries(){

List<SelectItem> countries =new ArrayList<SelectItem>();

SelectItem si_1 =new SelectItem();

SelectItem si_2 =new SelectItem();

SelectItem si_3 =new SelectItem();

si_1.setValue("ecuador");

si_1.setLabel("ecuador");

si_2.setValue("colombia");

si_2.setLabel("colombia");

si_3.setValue("peru");

si_3.setLabel("peru");

countries.add(si_1);

countries.add(si_2);

countries.add(si_3);

return countries;

}

publicvoid setAvailableCountries(List<SelectItem> countries){

this.availableCountries = availableCountries;

}

public List<SelectItem> getAvailablePostcodes(){

List<SelectItem> postcodes =new ArrayList<SelectItem>();

SelectItem si_1 =new SelectItem();

SelectItem si_2 =new SelectItem();

SelectItem si_3 =new SelectItem();

si_1.setValue(75001);

si_1.setLabel("75001");

si_2.setValue(75002);

si_2.setLabel("75002");

si_3.setValue(75003);

si_3.setLabel("75003");

postcodes.add(si_1);

postcodes.add(si_2);

postcodes.add(si_3);

return postcodes;

}

publicvoid setAvailablePostcodes(List<SelectItem> availablePostcodes){

this.availablePostcodes = availablePostcodes;

}

public List<SelectItem> getAvailableRatings(){

List<SelectItem> ratings =new ArrayList<SelectItem>();

SelectItem si_1 =new SelectItem();

SelectItem si_2 =new SelectItem();

SelectItem si_3 =new SelectItem();

si_1.setValue(1);

si_1.setLabel("1");

si_2.setValue(2);

si_2.setLabel("2");

si_3.setValue(3);

si_3.setLabel("3");

ratings.add(si_1);

ratings.add(si_2);

ratings.add(si_3);

return ratings;

}

publicvoid setAvailableRatings(List<SelectItem> availableRatings){

this.availableRatings = availableRatings;

}

publicint[] getPostcode(){

return postcode;

}

publicvoid setPostcode(int[] postcode){

this.postcode = postcode;

}

public List<EstablishmentLocal> getRetrievedEstablishments(){

return retrievedEstablishments;

}

publicvoid setRetrievedEstablishments(List<EstablishmentLocal> retrievedEstablishments){

this.retrievedEstablishments = retrievedEstablishments;

}

//Business methods

publicvoid performSearch(){

SearchRequestDTO searchRequestDto =new SearchRequestDTO(this.keyword,this.country,this.postcode,this.commentExists,this.rating, this.websiteExists);

SearchSessionLocal searchSession = lookupSearchSessionBean();

List<EstablishmentLocal> retrievedEstablishments = searchSession.performSearch(searchRequestDto);

this.setRetrievedEstablishments(retrievedEstablishments);

System.out.println("here");

}

private arcoiris.ServiceLocator getServiceLocator(){

if (serviceLocator ==null){

serviceLocator =new arcoiris.ServiceLocator();

}

return serviceLocator;

}

private arcoiris.SearchSessionLocal lookupSearchSessionBean(){

try{

return ((arcoiris.SearchSessionLocalHome) getServiceLocator().getLocalHome("java:comp/env/ejb/SearchSessionBean")).create();

}catch(javax.naming.NamingException ne){

java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);

thrownew RuntimeException(ne);

}catch(javax.ejb.CreateException ce){

java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ce);

thrownew RuntimeException(ce);

}

}

}

and here is the full dto class:

package arcoiris;

import java.io.Serializable;

publicclass SearchRequestDTOimplements Serializable{

private String keyword;

private String country;

privateint[] postcode;

privateboolean commentExists;

privateint rating;

privateboolean websiteExists;

public SearchRequestDTO(){

}

public SearchRequestDTO(String keyword, String country,int[] postcode,boolean commmentExists,int rating,boolean websiteExists){

this.keyword=keyword;

this.country= country;

this.postcode = postcode;

this.commentExists = commentExists;

this.rating = rating;

this.websiteExists = websiteExists;

}

public String getKeyword(){

return keyword;

}

publicvoid setKeyword(String keyword){

this.keyword = keyword;

}

public String getCountry(){

return country;

}

publicvoid setCountry(String country){

this.country = country;

}

publicint[] getPostcode(){

return postcode;

}

publicvoid setPostcode(int[] postcode){

this.postcode = postcode;

}

publicboolean isCommentExists(){

return commentExists;

}

publicvoid setCommentExists(boolean commmentExists){

this.commentExists = commmentExists;

}

publicint getRating(){

return rating;

}

publicvoid setRating(int rating){

this.rating = rating;

}

publicboolean isWebsiteExists(){

return websiteExists;

}

publicvoid setWebsiteExists(boolean websiteExists){

this.websiteExists = websiteExists;

}

}

here is the signature of the session ejb business method:

public List<EstablishmentLocal> performSearch(SearchRequestDTO searchRequestDto)

I use Jboss 4.0.3.

Can anyone help please?

Julien Martin.

ps. the two dto classes (web and ejb tier) are exactly the same!!

Message was edited by:

balteo

[18166 byte] By [balteoa] at [2007-10-3 2:50:55]
# 1
If you are putting part of your application in the shared library then please make sure that it should not *import* any of the classes which are there in other 2 war or jar files which are loaded separately. So organize your classes in that way.
atulcsea at 2007-7-14 20:39:46 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...