0

I'm working on a large project which consists of 10 sub-projects.

We're using Eclipse for development, JBOSS 7 as the app. server. Our projects use JSF 2.1, Spring 3.2, Hibernate 4.2 and Primefaces 3.3 for JSF implementation.

There are 2 "core" projects which other projects references, and these projects are referenced from the other 8 projects, and one project -let's say Project A- (of 8) references another one -let's say Project B-.

Now, the problem is; Project A uses entities of the "core" projects and Project B includes the JSF Converters.

When i try to use an entity in a selectOneMenu, i get "Converter" not found error. (NOTE: Converters are working!)

I added the converter definition to Project B's faces-config.xml, but still get the same error.

How i can use the converters from other Project?

Thanks.

Here is the "getAsObject" Method :

@Override
    public Object getAsObject(FacesContext facesContext,
            UIComponent uIComponent, String value) {
        if (value == null || value.trim().equalsIgnoreCase("")) {
            return null;
        }
        return ManagedBeanLocator.locateSessionController().findByRID("Akademikbirim", value);
    }
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Answer depends on the build system. Are you using standard Eclipse or e.g. Maven? – BalusC Jul 31 '13 at 11:14
  • BalusC; thanks four your inquiry. We use Maven. – user2636805 Jul 31 '13 at 11:27
  • My "getAsObject" ends with : return getSessionController().findByRID("Akademikbirim", value); This may be the point, do you agree? (Both projects include sessionController but project B is only included as a war, so no controller initialized, right?) – user2636805 Jul 31 '13 at 11:27
  • Source code is irrelevant if whole class is not found by JSF. Unfortunately, I don't do Maven, so I can't answer in detail from top of head. But to the point, you need to make sure that the project structure generated by Maven ends up like http://stackoverflow.com/questions/8320486/structure-for-multiple-jsf-projects-with-shared-code/ – BalusC Jul 31 '13 at 11:40
  • So, I've written a small code which find and replicates the converters needed in Project A, but located in Project B. I thought that it's a definite solution to the problem but now, there's a strange behaviour in the converters. You see the last line of the "getAsObject" method above; the method accesses the "sessionController", but when i call a public method of the class "sessioncontroller", it fails. Primefaces extensions says "Server return exception class java.lang.NoSuchMethodError", altough such a method definitely exists! – user2636805 Aug 01 '13 at 12:36
  • The full messafe from PE is : "Server return exception class java.lang.NoSuchMethodError with description tr/com/akgun/uys/view/controller/_common/SessionController.findByRID(Ljava/lang/String;Ljava/lang/String;)Ltr/com/akgun/uys/db/model/_base/BaseEntity;" – user2636805 Aug 01 '13 at 12:50

0 Answers0