Eclipse Helios Java EE 6: Target Unreachable, identifier 'bean' resolved to null - eclipse

I read through the answers on Java EE 6: Target Unreachable, identifier 'helloBean' resolved to null about identifier being resolved to null. I am facing the similar issue here. My development environment is Eclipse Helios and tomcat 7.0.
I actually have both faces-config.xml and web.xml made compliant to JSF2.0, however, that doesn't solve the issue. It works when I have the faces-config to include the bean. Once I took it off, even though I am having the #ManagedBean annotation, it just doesn't work. I don't see and error or warning in tomcat startup console messages and logs.
Appreciate if anyone can assist.
The faces-config.xml I am using:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<managed-bean>
<managed-bean-name>userManagedBean</managed-bean-name>
<managed-bean-class>UserManagedBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>

Related

eclipse webapp welcome file display error

I m new to eclipse and facing difficulties at the beginning of a new webapp.
index.jsp doesnt display.
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>PizzaOrderApp</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
I already tryed with http://localhost:8080/PizzaOrderApp/index.jsp and http://localhost:8080/PizzaOrderApp/jsp/index.jsp
after remove-readd tomcat server:
Have you tried putting the .jsp file directly in the WebContent folder rather than creating a folder for the JSP pages?
You did not define the Spring dispatcher servlet in web.xml. You can either copy index.jsp outside of WEB-INF directory (into webcontent), or you should have a deep look into the Spring MVC documentation.
I also faced this problem but what i was doing wrong is, I created
Dynamic project in eclipse with Dynamic Web Module version 3.0. It
won't give you Web.xml file.I added Web.xml file from other project
but still Welcome File is not getting.
Then i deleted the project and i created the project with Dynamic Web
Module Version 2.4 and it given me Web.xml file. I again Configure the
Welcome File in the Web.xml file, After that its working fine.Server
which i am using is Tomcat 7 and java 1.7,Eclipse Luna.

Problems with eclipse and maven war plugin overlay

I have a project where I am replacing out the web.xml and other files using a war overlay in maven. Everything works great and then I try to import into eclipse and have all kinds of problems.
To start with I use mvn eclipse:eclipse to generate my Eclipse files. This works but the imported project does not contain the Dynamic Web facet.
Once the Dynamic Web facet (version 2.5) is added, the project still recognizes the deployment descriptor as 2.4 and gives me errors anyway even though it is;
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
Has anyone struggled through this type of thing before?

Liferay - Eclipse alloy tag library error

I am developing a portlet that runs on Liferay portal (I have currently Liferay+Tomcat7 bundle, it will later run on JBoss). I am using Eclipse Helios with Liferay IDE and Liferay SDK.
In my .jsp files, I use Alloy:
<%# taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
Everything works fine - the portlet gets successfully deployed and is shown correctly.
The only problem is, that Eclipse is marking it as an error:
Description Resource Path Location Type
Can not find the tag library descriptor for "http://liferay.com/tld/aui" edit.jsp /PortletVisual-portlet/docroot line 2 JSP Problem
This is mainly a cosmetic error. Liferay IDE in Eclipse evidently doesnt understand these dependencies, although the project itself works fine. I can live with this "error marker", it doesnt bother me that much. I was just curious if there is a way to fix it.
Thanks for any tips!
EDIT: this is my web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>PortletVisual-portlet</display-name>
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/portlet_2_0</taglib-uri>
<taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://liferay.com/tld/aui</taglib-uri>
<taglib-location>/WEB-INF/tld/aui.tld
</taglib-location>
</taglib>
</jsp-config>
</web-app>
Try this one:
<taglib>
<taglib-uri>http://liferay.com/tld/aui</taglib-uri>
<taglib-location>/WEB-INF/tld/liferay-aui.tld</taglib-location>
</taglib>
If not working try here
Hope I helped! Good luck!!!!

Websphere v8.0.0.6 WASX7017E, ADMA0209E Application exception while Deployment of EJB 2.0 EAR

I have the following problem with WebSphere 8.0.0.6 and no solution is found on the web. I hope anyone can help with this and this will help someone else with this problem.
Error Description:
Error #1 (while installing application):
WASX7017E: Exception received while running file /tmp/wsant3816346180883063201jacl;
exception information:com.ibm.websphere.management.application.client.AppDeploymentException:
com.ibm.websphere.management.application.client.AppDeploymentException
Following Error:
ADMA0209E: Enterprise JavaBeans (EJB) module ServerEJB.jar contains the following
container-managed persistence (CMP) or bean-managed persistence (BMP) :
... (list of all entities)
Explanation:
I generate an EAR with an EJB 2.0 component/project. Up to now I have deployed this EAR within WAS 6.1 successfully, but with WAS 8 it doesn't deploy anymore.
I have the necessary bind-ejbjar.xmi, even in the new format - converted with the script from IBM.
Questions:
WAS 8 still seems to know that there exists a EJB 3 component in the EAR - the question is WHY?
What is the minimum requirement for a EAR/EJB-Module to deploy in WAS 8 - there must be big changes?
Are there more bind-files to be included?
Thanks for help
UPDATE:
So obviously there are prerequisites to declare a package as EJB2.x.
See IBM-HelpCenter:
IBM WebSphere info for developers DE
But I fullfill all of this two prerequisites.
How do I have to package the jar for Websphere 8 to make it acceptable as an EJB2.x?
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/index.jsp?topic=%2Fcom.ibm.websphere.zseries.doc%2Fae%2Frejb_consid.html&lang%3Dde
The solution was achieved by upgrading to version 2.1 ejb, because there the "version" attribute is allowed and this is required by WebSphere to recognize a non-EJB 3.0 version.
This means that an EJB 2.0 version can not work, since the above tag is not allowed in the ejb-jar_2_0.dtd. Maybe a
<cmp-version>2.x</cmp-version>
could help here, but I didn't tested it.
The conversion of the header of ejbjar.xml brought success:
from 2.0 (ejb-jar_2_0.dtd):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<!-- EJB-jar file declaration -->
<ejb-jar id="EJBJar" version="2.0">
<display-name>Overall Bean Definition</display-name>
<enterprise-beans>
<entity id="Dcnotetext">
...
to 2.1 (ejb-jar_2_1.xsd - you need namespaces! ):
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar id="EJBJar"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.1"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
<!-- EJB-jar file declaration -->
<display-name>Overall Bean Definition</display-name>
<enterprise-beans>
<entity id="Dcnotetext">
...
No further changes to XMI or XML files were necessary!
Thanks for help!

Web-app version is overridden when launching Tomcat 7 from Eclipse

I'm developping a web application that is using web-fragment.xml files.
AFAIK, the web-framgent.xml files of the JAR in WEB-INF/lib should be merged and resolved to an effective web.xml.
So, I activate the logEffectiveWebXml option of my Tomcat 7 server to see the resulting file.
Hereby the beginning of the effective web.xml file:
Case 1: When the application is deploy on a standalone Tomcat 7:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0"
metadata-complete="true">
Case 2: When the application is deploy on a Tomcat 7 in Eclipse IDE:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="2.5"
metadata-complete="true">
You notice that the version attribute is replaced with "2.5".
Besides, the effective web.xml is correct when deploying the app on the standalone Tomcat (the content of web-fragments.xml files are merged) whereas these contents are absent when launching Tomcat from Eclipse.
I think this is due to the version override.
Do you know why the version attribute is overriden when launching in Eclipse?
I inspect Eclipse configuration, projects configuration (they all use dynamic web module 3.0) and workspace directory ".metadata.plugins\org.eclipse.wst.server.core" but I don't manage to find something wrong...
NOTE: I also notice that the version is overridden even if I don't deploy my application (= fresh Tomcat install).
Thanks for your help.