Exforsys

Online Training

weblogic help

This is a discussion on weblogic help within the Java Tutorials forums, part of the Articles and Tutorials category; hi, after i posted the question. i did some reading on weblogic docs. it says i need to modify my ...


Go Back   Exforsys > Articles and Tutorials > Java Tutorials

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

 

LinkBack Thread Tools
  #11 (permalink)  
Old 09-18-2004, 10:32 AM
Junior Member
 
Join Date: Sep 2004
Posts: 12
arudra
Re:weblogic help

hi,

after i posted the question. i did some reading on weblogic docs. it says i need to modify my web.xml file , after copying the files into web-inf/classes directory. i am trying to do that.

anyhow if u have any suggestions let me know.

if my questions appear dumb, please excuse me. as i said earlier , i am new to this weblogic.

thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 09-18-2004, 11:44 AM
Senior Member
 
Join Date: Nov 2004
Posts: 132
Vasu
Re:weblogic help

Arudra,

just try like this:
web-inf/classes/ - put the user package classes.

or web-inf/lib - put the jar file of user package

i think the problem is with the loading of classes.

and also let me know what is user package contains?? beans??

Post edited by: vasu, at: 2004/09/18 11:10
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 09-19-2004, 06:50 PM
akpraveen
Guest
 
Posts: n/a
Re:weblogic help

Sorry Arudra for not replying earlier. The weekend mind was fast asleep!! lolz..

Alright! Look at the error messages.

[code:1]package lcfiles does not exist[/code:1]

And here is where you were trying to import the package:

[code:1]lcfiles.*[/code:1]

By default, you should have an entry in your WEB.XML as to where your servlet classes can be found. Typically, it will be in WEB-INF\\lib.

So, assuming that your Web.xml file has an entry WEB-INF\\lib, then you should have the package you are trying to import into in the following directory structure:

WEB-INF
|---------lib
|---------- lclfiles.jar

Now the lclfiles.jar should have code with package declarations, similiar to the page import statements. For example, lets assume that you are trying to import a file - Praveen.java in lclfiles.jar. You have to look at the package name in Praveen.java. Use winzip to open up the JAR file and look at the first statement. It should be like this:

[code:1]package lclfiles;[/code:1]

So, to use Praveen.java in your servlet or JSP, simply throw in the JAR file in your WEB-INF\\lib and add an import statement
[code:1] import lclfiles.Praveen[/code:1]

If you are getting errors that weblogic cannot find the package, then it is because of two reasons:

1. You didn\'t tell Weblogic that this is were lclfiles.jar is available. (Defining in Web.xml)
2. The package is indeed not available at all!



Don\'t get confused man.. I am worse than you when it comes to getting confused. Ask vasu garu and he will tell you .

Good luck!

Praveen
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 09-20-2004, 03:02 AM
arudra
Guest
 
Posts: n/a
Re:weblogic help

Hi vasu and praveen,

Things are looking good now when compared to the situation a week before.

my packages contain java neans. i placed just the ejb class files in webinf/classes folder, jsp is now error free.

new question, i have several ejb classes spread in the different jar files.

for example , login.jar contains
[code:1]
META-INF/MANIFEST.MF
META-INF/
META-INF/ejb-jar.xml
META-INF/weblogic-ejb-jar.xml
usfiles/
usfiles/UserSBean.class
usfiles/UserSHome.class
usfiles/UserSRemote.class
usfiles/UserSBean_jp3wcr_EOImpl.class
usfiles/UserSBean_jp3wcr_HomeImpl.class
usfiles/UserSBean_jp3wcr_Impl.class
usfiles/UserSBean_jp3wcr_HomeImplRTD.xml
usfiles/UserSBean_jp3wcr_EOImplRTD.xml
lcfiles/
lcfiles/LoginBean.class
lcfiles/LoginHome.class
lcfiles/LoginPK.class
lcfiles/LoginRemote.class[/code:1]

where lcfiles and usfiles are the pacjages i am using in my jsp. to make my jsp work , i have copied only the class files into the classes folder, hence the jsp was error free.

but my jsp file is yielding the following error

javax.naming.NameNotFoundException: Unable to resolve \'UlbSHome\' Resolved: \'\' Unresolved:\'UlbSHome\' ; remaining name \'UlbSHome\'


which was a result of code
[code:1]us= (UserSHome)Context.lookup(\"UlbSHome\");[/code:1]
that means i provided only ejb classes to it not the xml files.

that leaves me to ask the question , how to provide ejb class packages to my jsp. i mean where does jsp looks for beans that i specify for the lookup(in this case UlbSHome).

let me rephrase my whole question,

what should i do, if i want to keep jar files in the lib directory, instead of just copying the ejb class files(packages) folder. i mean what entries in the web.xml file would make my jsp use the EJB packed classes properly.

as always, thanks a lot for the help.

Post edited by: arudra, at: 2004/09/20 08:46
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 09-20-2004, 04:12 PM
akpraveen
Guest
 
Posts: n/a
Re:weblogic help

First:

If you want to reuse code, make sure you reuse it by loading the JAR packages and not by just reusing classes! This becomes messy when it comes to code maintenance and distributed computing applications.

Second, The naming exception you are getting is because you haven\'t specified a JNDI name for the invoking program to lookup the EJB\'s. If your EJB\'s are residing in a different location (J2EE app server), then you need the JNDI address of those EJB\'s you want to use in your App. You normally specify that in your Bean deployment descriptor. (Not sure..I have to go to office and check it out!)

So, I think your app is looking for that JNDI name in the context of the JSP, but cannot find it!

Since I don\'t know what your code looks like, I am assuming that you are doing the lookup via JSP. Specify the JNDI name of the bean you want to access in the servlet context! (web.xml)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 09-20-2004, 07:01 PM
Junior Member
 
Join Date: Sep 2004
Posts: 12
arudra
Re:weblogic help

Quote:
Since I don\'t know what your code looks like, I am assuming that you are doing the lookup via JSP.
Specify the JNDI name of the bean you want to access in the servlet context! (web.xml)
yes, that\'s exactly what i want to do. that indeed what i have asked. how to specify JNDI name of my java bean ( In my case, ejb\'s are resinding in web-inf\\lib folder,as jar packed files), in the web.xml file.

thanks,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 09-20-2004, 09:03 PM
Senior Member
 
Join Date: Nov 2004
Posts: 132
Vasu
Re:weblogic help

Just use like this:

The ejb-ref element declares a reference to an Enterprise JavaBean. You specify it by editing the web.xml file .

<ejb-ref>
<description>description</description>
<ejb-ref-name>name</EJB-ref-name>
<ejb-ref-type>type</EJB-ref-type>
<home>home interface</home>
<remote>remote interface</remote>
<ejb-link>ejb name</ejb-link>
</ejb-ref>
<ejb-ref>
Contains elements that declare an EJB.

<Description>
Specifies a description for the EJB.

<ejb-ref-name>
Specifies the JNDI name that servlets use to get a reference to the EJB.

<ejb-ref-type>
Specifies the Java class type of the referenced EJB.

<home>
Specifies the fully qualified name of the EJB\'s home interface.

<remote>
Specifies the fully qualified name of the EJB\'s remote interface.

Go to this link:
See step 21:

http://e-docs.bea.com/wls/docs61/web...t.html#1006654
<ejb-link>
Specifies that the reference is linked to an EJB in an encompassing J2EE application package. The value of this element must be the ejb-name of an EJB in the J2EE application package
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Weblogic Administrator Required kalareddy Experienced Job Seekers - India 0 06-13-2005 05:37 AM


All times are GMT -4. The time now is 08:29 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.