1

Before occuring this exception I had two projects

Paging -> a simple struts2 web application using EJBs

Simple PagingWithAjaxJSON-ejb -> EJB app referenced by above project.

Everything was working as expected.

After that I decided use Maven for my apps. I changed the first app(Paging) according to Maven directory structure for a web app. So I had to changed only package imports in source code.

Before(in Paging app)

import beans.personBeanRemote; . . and so on.. 

After (current app)

import com.mycompany.ajaxstruts2.beans.personBeanRemote; . . and so on.. 

and also in package diclarations accordingly.

except this everything is ditto.

But this time when I browse the same file index.jsp, it says

**Struts Problem Report Struts has detected an unhandled exception: Messages: beans.personBeanRemote ejb ref resolution error for remote business interfacebeans.personBeanRemote Lookup failed for 'java:global/SimplePagingWithAjaxJson-ejb/personBean!beans.personBeanRemote' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} javax.naming.NamingException: Lookup failed for 'java:global/SimplePagingWithAjaxJson-ejb/personBean!beans.personBeanRemote' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NamingException: ejb ref resolution error for remote business interfacebeans.personBeanRemote [Root exception is java.lang.ClassNotFoundException: beans.personBeanRemote]] File: org/glassfish/web/loader/WebappClassLoader.java Line numbe 1578** 

code snippet from index.jsp is same in previous and current app's index.jsp files.

But <%@page import=...> in current project's index.jsp is changed accordingly to adapt changed directory structure.

Context c = new InitialContext(); personBeanRemote bean= (personBeanRemote) c.lookup("java:global/SimplePagingWithAjaxJson-ejb/personBean!beans.personBeanRemote"); int x = bean.getCount(); 

previous application is working but current Maven app is not. Used NetBeans IDE 6.9 for both apps.

Note: EJB app is intact.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.