WebSphere Application Server - Need help in deploying EJB in websphere 6.1

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Application Server > March 2007 > Need help in deploying EJB in websphere 6.1





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Need help in deploying EJB in websphere 6.1

2007-03-14, 7:29 am

Hi,

I am getting some problem in deploying EJB.
I created a jar file contains ejb classes and ejb-jar.xml and a war file which contain a Servlet and a web.xml file.
Than i combined the jar and war with application.xml in EAR file.
but when i try to deploy this ear file it gives deploymetdescriptor load exception.
I checked it completely but it is all fine.
the ejb-jar.xml is...



<ejb-jar>
<description>MY WAS EJB application </description>
<display-name>Select Query</display-name>
<enterprise-beans>
<session>
<ejb-name>SelectData</ejb-name>
<home>ejb.SelectDataHome</home>
<remote>ejb.SelectData</remote>
<ejb-class>ejb.SelectDataBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>

i am deploying my first ejb. please help.
thank you in advance.

2007-03-15, 1:27 am

hi,

ok help me buy telling where could be the problem.
As i am getting error in the first step of deployment by selecting the ear file

"The EAR file might be corrupt or incomplete.
AppDeploymentException: [null] org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException: IWAE0022E Exception occurred loading deployment descriptor for module "jarName.jar" in EAR file "C:\IBM\WebSphere\AppServer2\profil
es\AppSrv01\wstemp\92668751\upload\EarNa
me.ear"

Structure of files is
Ear contain three files jar,war and META-INF\application.xml
war file contain jsp,servlet and WEB-INF\web.xml
jar file contain ejbHome,ejbRemote,ejbBean and META-INF\ejb-jar.xml
please reply.
Randy Schnier

2007-03-15, 1:30 pm

Try replacing the first line of your ejb-jar.xml with the following. I suspect your DD is missing some parameters that are needed by the parser.

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="2.1"
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/ejb-jar_2_1.xsd">


sumit1201@gmail.com wrote:
> Hi,
>
> I am getting some problem in deploying EJB.
> I created a jar file contains ejb classes and ejb-jar.xml and a war file which contain a Servlet and a web.xml file.
> Than i combined the jar and war with application.xml in EAR file.
> but when i try to deploy this ear file it gives deploymetdescriptor load exception.
> I checked it completely but it is all fine.
> the ejb-jar.xml is...
>
>
>
> <ejb-jar>
> <description>MY WAS EJB application </description>
> <display-name>Select Query</display-name>
> <enterprise-beans>
> <session>
> <ejb-name>SelectData</ejb-name>
> <home>ejb.SelectDataHome</home>
> <remote>ejb.SelectData</remote>
> <ejb-class>ejb.SelectDataBean</ejb-class>
> <session-type>Stateless</session-type>
> <transaction-type>Bean</transaction-type>
> </session>
> </enterprise-beans>
> </ejb-jar>
>
> i am deploying my first ejb. please help.
> thank you in advance.
>

2007-03-16, 7:29 am

Hi Randy,

thank you for reading my message.
I did the same as you suggested me and i passed from that error but one more is standing in my way. Please give me two more minutes to suggest some solution.
Now the exception is in application.xml
file is shown with the error.

<?xml version="1.0" encoding="ISO-8859-1"?>

<application version="1.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/application_1_4.xsd">
<display-name>Today </display-name>
<module>
<web>
<web-uri>app.war</web-uri>
<context-root>/app</context-root>
</web>
</module>
<module>
<ejb>select.jar</ejb>
</module>

</application>


[3/16/07 12:36:13:658 IST] 00000027 SystemErr R Stack trace of nested exception:
[3/16/07 12:36:13:658 IST] 00000027 SystemErr R org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException: IWAE0007E Could not load resource "META-INF/application.xml" in archive " C:\IBM\WebSphere\AppServer2\profiles\App
Srv01\wst
emp\92668751\upload\Query.ear"
Stack trace of nested exception:
Wrapped exception
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'application'.

2007-03-19, 1:24 am

Please suggest me where I am going wrong in application.xml file.
the file is...

<application version="1.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/application_1_4.xsd">
<display-name>Today </display-name>
<module>
<web>
<web-uri>app.wa r</web-uri>
<context-root>/app</context-root>
</web&g t;
</module>
<module>
<ejb>select.jar</ejb>
</module>

</application>

I am getting ResourceLoadException
IWAE0007E Could not load resource "META-INF/application.xml" in archive " C:\IBM\WebSphere\AppServer2\profiles\App
Srv01\wstemp\92668751\upload\Query.ear "

Please help.
Ken Hygh

2007-03-19, 7:27 am

sumit1201@gmail.com wrote:
> Please suggest me where I am going wrong in application.xml file.
> the file is...
>
> <application version="1.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/application_1_4.xsd">
> <display-name>Today </display-name>
> <module>
> <web>
> <web-uri>app.wa r</web-uri>
> <context-root>/app</context-root>
> </web&g t;
> </module>
> <module>
> <ejb>select.jar</ejb>
> </module>
>
> </application>
>
> I am getting ResourceLoadException
> IWAE0007E Could not load resource "META-INF/application.xml" in archive " C:\IBM\WebSphere\AppServer2\profiles\App
Srv01\wstemp\92668751\upload\Query.ear "
>
> Please help.


Well, web-uri is clearly wrong.

Ken

2007-03-20, 7:29 am

Sorry the correct file is.

<?xml version="1.0" encoding="ISO-8859-1"?>

<application version="1.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/application_1_4.xsd">
<display-name>Today </display-name>
<module>
<web>
<web-uri>app.war</web-uri>
<context-root>/app</context-root>
</web>
</module>
<module>
<ejb>select.jar</ejb>
</module>

</application>

would you please tell me the exact uri.

Thank you

2007-03-20, 1:21 pm

the actual uri is this which is giving error

<application version="1.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/application_1_4.xsd">

Please suggest me.
Thank you.

2007-03-27, 7:17 am

Hi folk,

I deployed the EJB on websphere but on accessing a servlet i am getting error :

"Cannot instantiate class: org.jnp.interfaces.NamingContextFactory"

Can anyone help me in this.
I didnot put anything in classpath.
But i am able to access pre-deployed samples application of EJB.
Please help

Sumit
Ken Hygh

2007-03-27, 7:17 am

sumit1201@gmail.com wrote:
> Hi folk,
>
> I deployed the EJB on websphere but on accessing a servlet i am getting error :
>
> "Cannot instantiate class: org.jnp.interfaces.NamingContextFactory"
>
> Can anyone help me in this.
> I didnot put anything in classpath.
> But i am able to access pre-deployed samples application of EJB.
> Please help
>
> Sumit


You'll need to look into your code to find out where you're using this
class. It is not an IBM-supplied class.

Ken
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com