Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JBWEB006003: Cannot convert .. of type class java.lang.String to class javax  RSS feed

 
Amitkumar Fulambarkar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am migrating the JSF (Version 1.1) application from websphere 7 to JBoss EAP 6.2.
I have removed the references of IBM libraries in the web.xml and added the maven dependencies for jsf jars from Sun. However, when I run the application I get the following error for the pages which has UIComponent.
The application was working on webshere and not giving the error. Is this conflicting with the JSF implementation of JBoss and how to do to resolve it? I can work on JSF upgrade at this stage.
Please help.

ERROR:


Thanks
Amit
 
Tim Holloway
Bartender
Posts: 18608
68
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid we need more information. The full stack trace and the source code of the login page would be a good start.

Although if the JBoss server is a JSF version 2 server, I suspect that you may be having problems stemming from using JSPs as your View Templates. JSPs are not supported as View Templates in JSF2 - you have to use View Template Language (.xhtml) files. VTL supports JSF Facelets which are an integral feature of JSF2.
 
Amitkumar Fulambarkar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,
We are using the old version of JSF 1.2 as this is a legacy application. In our project we just want to migrate the application from webshere 7 to JBoss. For this we are considering the minor changes to be done to remove the dependency of IBM libraries. Hence we are not modifying much of the code.

Please advise if we can solve this issue and migrate the application on JBoss with minimal changes in the code. If not, what is the recommended solution for this.
Source code:
1. LoginHandler.java


login.jsp


error trace



pom.xml



web.xml



faces-config.xml


 
Tim Holloway
Bartender
Posts: 18608
68
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is false economy.

It has been a VERY LONG time since JSF 1.x has been supported on any platform. JBoss EAP 6.2 has JSF 2.0 built into it and that means that at a minumum you'd have to override the built-in JSF support or expect massive failures from incompatible code.

You are far better off considering converting the app while you are porting it.
 
Amitkumar Fulambarkar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,
Thanks for looking into it. I completely agree with you. I do understand that I am on very old version of JSF and I have to find the way out of it.
Of course, I would need to upgrade the JSF version very soon, but I do expect the significant work in the code to make it compatible with the higher version.
The other alternate you suggested is to override JSF come up with JBoss. Are there any configuration changes to be done to make application use the JSF lib provided by me and not from JBoss. Maybe in the web xml? Not sure this is the right place to ask the question on JBoss, though it is related to JSF.

Thanks
amit
 
Tim Holloway
Bartender
Posts: 18608
68
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To get JBoss to work with other JSF implementations, you would need to add a directive to the web.xml file telling JBoss to switch off JSF for that app, then include your own JSF implementation as part of the WAR/EAR. Check the WebLogic documentation.

There were significant changes to JSF between JSF 1 and JSF 2. JSPs were dropped in favor of Facelet View Templates (.xhtml). Taglibs basically went away, as JSF 2 element handlers only dimly resemble JSP tag handlers. DTDs were replaced with XML schemas. The EL processor interface was totally overhauled. Of course, there are also many improvements, as well. Facelets make tiled Views much easier, for example.

My #1 rule in JSF is that the more JSF-specific code your app has, the more likely you're doing it wrong. JSF was designed to work primarily with POJOs, and the presence of imports for any javax.faces classes except for the data model fa├žades (SelectItem and DataModel) is an instant alarm to me. Aside from the simple fact that it probably means a more straightforward solution has been missed, the more JSF-specific code an app has, the more it is likely to be impacted by internal changes to the JSF implementation itself.
 
Amitkumar Fulambarkar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,
Thanks for your valuable inputs. This really helpful to take the further call on how to proceed with this migration.

Thanks a lot.

Regards,
Amit
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!