Ejb-local-refs not showing up in webapp
I have an EAR that has a WAR and an EJBJAR inside (nothing new here). I have my
WAR reference several local ejbs from the EJBJAR. All of my local-ejb-ref entries
in web.xml are not appearing in the console.
Are there any restrictions on this?
Thanks
Local refs in web.xml is supported in 70 (servlet 2.3) and up, I suppose.
Chris Bono wrote:
I have an EAR that has a WAR and an EJBJAR inside (nothing new here). I have my
WAR reference several local ejbs from the EJBJAR. All of my local-ejb-ref entries
in web.xml are not appearing in the console.
Are there any restrictions on this?
Thanks--
Rajesh Mirchandani
Developer Relations Engineer
BEA Support
Similar Messages
-
Hi!
Im a novice at this environment so I have been running the EJB Tutorial provided
with 8.1
Everything works as i should until I deploy the application.
I get a:
weblogic.management.DeploymentException: Could not setup environment - with nest
ed exception:
[weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'Ban
dsExampleEJB.jar#Music' declared in the ejb-ref or ejb-local-ref 'ejb/MusicLink'
in the application module 'webapp' could not be resolved. The target EJB for
th
e ejb-ref could not be found. Please ensure the link is correct.]
The code for the ejb-local-ref is as folows:
<ejb-local-ref>
<ejb-ref-name>ejb/MusicLink</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>examples.ejb20.relationships.bands.MusicHome</local-home>
<local>examples.ejb20.relationships.bands.Music</local>
<ejb-link>BandsExampleEJB.jar#Music</ejb-link>
</ejb-local-ref>
What can I be doing wrong?
/PeterGunnar,
There are a few mistakes in the tutorial that will
be fixed for the upcoming SP2 release. As far as the tutorial code
itself goes I've reproduced this problem by following the tutorial
exactly as its stated and there's a couple of things that can be
what's causing all the problems for you and others.
The easiest solution is to use the supplied MusicBean source that's
supplied with the tutorial. That bean code is correct and functional.
The tutorial is missing some of the steps required to reproduce that
exact bean code.
I'll cover all the errors I found. One of these is quite possibly what's
tripping you and others up.
1) The getBands() and addBand() method should be made to be local
methods instead of remote methods.
So in step 4 after you've created these methods change the interface
exposure
to be local either directly in the source by changing the tag, or in the
design view
by right clicking the method and selecting "local". This will show the
methods
with a yellow diamond next to them in the design view.
You also need to enable local interfaces as well as update the local
interface and local home interface.
To do this:
1) switch to the design view
2) click on the EJB
3) find the "naming" node in the property editor and uncheck "Remote EJB"
4) check the "Local EJB" checkbox which will then enable the fields for
the local and local home interfaces
5) enter the value of local interface to be: "Music"
6) enter the value of local home interface to be: "MusicHome"
2) The setup datasource step is incorrect in the tutorial.
The entity beans that are imported use a datasource called
"examples-dataSource-demoPool".
This datasource doesn't exist in the default workshop domain so in this step
the user
is to create the missing datasource. So going to the datasource viewer and
choosing "add datasource"
and pasting in the above name will create the datasource that's needed for
the entity beans.
3) In the source code listing for MusicBean there's missing imports for:
javax.naming.InitialContext
javax.naming.NamingException
4) the ejb-local-ref XML has one problem, possibly two:
1) The case is incorrect for the EJB ref name. The tutorial has it as:
ejb/MusicLink
but addBand.jsp refers to it as ejb/musicLink. So either change the
jsp file or the ejb-ref-name so
that the two match.
2) The placement of the <ejb-local-ref> XML may be in the wrong spot.
This element must
appear at the bottom of web.xml. i.e.
<webapp>
<ejb-local-ref>
<ejb-ref-name>ejb/musicLink</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>examples.ejb20.relationships.bands.MusicHome</local-home>
<local>examples.ejb20.relationships.bands.Music</local>
<ejb-link>BandsExampleEJB.jar#Music</ejb-link>
</ejb-local-ref>
</web-app>
5) and finally ensure that your application's build order is correct. Make
sure that the EJB
project builds before the web project.
This can be verified by selecting the menu "tools->application properties"
and then
clicking on the "build" node to get the build order.
All of these mistakes will be fixed for the SP02 release. Hopefully one of
these solutions fixes
the problems you're experiencing.
-Michael
"Gunnar Skogen" <[email protected]> wrote in message
news:[email protected]...
>
This thread :
Suggestions on newbie tutorials for Workshop and Weblogic 8.1
Date: 8 Aug 2003 15:06:55 -0700
From: "Morgan" <[email protected]>
Organization: BEA NEWS SITE
Newsgroup: weblogic.developer.interest.workshop
Describes the same problem, no solution - so:
1) When will the tutorial(s)/ and or workshop be fixed ?
2) Could we get a fix for this particular problem ? ( I tried more than Iwant
to admit )
"Gunnar Skogen" <[email protected]> wrote:
Hi,
(chiming in because:)
I have exactly the same problem with the same app:
This is following the tutorial for 8.1 :"Tutorial EJB project, Part one"
to the
letter and running the build.
The link names etc are correct, however, nothing is/has been deployed
according
to console..
NB: Following the tutorial the MusicBean is set up as a remote bean
(default
in
workshop?) - have tried going the local way also without any success.
It appears
the tutorial itself is faulty(?) ( it also shows the dialog for importing
a webapp
when it most probably means to create an empty one )
Michael Kovacs <[email protected]> wrote:
Hi Peter,
A couple of things...
Ensure that your EJBs are deployed to the server properly. It
seems from your error that they might very well already be
deployed successfully, but that's just a guess. To verify this you
can have a look at the WebLogic admin console and see that your
beans have been deployed to the server by looking at your
application.
Assuming your beans are deployed....
Ensure that the reference to the EJB ref is using the exact
name of the ejb-ref-name. The name is case sensitive.
So when you do your lookup of the bean in your JSP
ensure that the "ejb/MusicLink" from the <ejb-ref-name>
matches exactly. i.e.
Object obj = ctx.lookup("java:comp/env/ejb/MusicLink");
Also, make sure that the <ejb-link> is correct.
The format for the link name is:
EJBprojectname.jar#EJBName
So for your example, make sure that "BandsExampleEJB"
is the name of your EJB project or correct that value in the
link name, and that your Bean's EJB name is "Music".
Let me know if this helps.
-Michael
Peter Hegedüs wrote:
Hi!
Im a novice at this environment so I have been running the EJB
Tutorial
provided
with 8.1
Everything works as i should until I deploy the application.
I get a:
weblogic.management.DeploymentException: Could not setup environment- with nest
ed exception:
[weblogic.deployment.EnvironmentException: [J2EE:160101]Error: Theejb-link 'Ban
dsExampleEJB.jar#Music' declared in the ejb-ref or ejb-local-ref
'ejb/MusicLink'
in the application module 'webapp' could not be resolved. The targetEJB for
th
e ejb-ref could not be found. Please ensure the link is correct.]
The code for the ejb-local-ref is as folows:
<ejb-local-ref>
<ejb-ref-name>ejb/MusicLink</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>examples.ejb20.relationships.bands.MusicHome</local-home>
<local>examples.ejb20.relationships.bands.Music</local>
<ejb-link>BandsExampleEJB.jar#Music</ejb-link>
</ejb-local-ref>
What can I be doing wrong?
/Peter -
Ejb3 help needed( ejb-local-ref )
hi
I have developed one enterprise application.In client refers the session bean in turn session bean refers the entity bean.
But the problem is when i run that application i am not getting desired output.I ahve used JNDI look up to refer the bean.
i am using netbeansIDE5.5 and sun's application server
i think my web.xml ( )is not correcct.
content of web.xml (partly)
<ejb-local-ref>
<ejb-ref-name>TaskSessionLocal</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home/>
<local>TaskEjb.TaskSessionLocal</local>
<ejb-link>TaskSession</ejb-link>
</ejb-local-ref>
can anybody please tell me what all these signifies(<ejb-local-ref> and all)
regards
shruthiIf you're referring to an EJB 3.0 Local Business interface using an ejb-local-ref do not
include the <local-home> element. Here's a full description of the meaning of each
element from our EJB FAQ :
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#EJB_ejb-ref_ejb_local_ref -
Hi
Can someone explain me exact use of this <ejb-local-ref>
tag. I have seen ejb running without this config also and most of the professionally written ejb have this. When should this be used and why.
Also i see <ejb-link> tag being used. I beleive if want to reference another ejb in another jar of the same ear, this should be used. I would appreciate if someone can explain me these 2 things.
ThanksCan someone explain me exact use of this
<ejb-local-ref>
tag. I have seen ejb running without this config also
and most of the professionally written ejb have this.
When should this be used and why.ejb-ref is a way of getting reference to another ejb from within the bean code in one ejb. It provides a way to link ejbs based on ejb names rather than jndi-names.
you can also refer to another ejb using the jndi name of the target ejb by looking it up from the global jndi tree. However, this is not a clean way, bcos the jndi name is the deployer's responsibility and could change. If you hook different ejbs using the jndi-names it could be quite inflexible and also you may not be able to take advantage of the container's colocation optimizations.
To link ejbs within the same J2ee application in a flexible way and to take advantage of the container's optimizations, you can use ejb-refs and ejb-links.
hope this helps,
Mihir
Also i see <ejb-link> tag being used. I beleive if
want to reference another ejb in another jar of the
same ear, this should be used. I would appreciate if
someone can explain me these 2 things.
Thanks -
Ejb-ref and ejb-local-ref tags
Hi everyone,
Can someone please tell me
1) Is it necessary for me to define ejb-ref or ejb-local-ref tags if I am referering one ejb from other ejb? I mean to say is it mandatory that I should have these deployment descriptor tags?
2) What is purpose of ejb-link tag ?Hi everyone,
Can someone please tell me
1) Is it necessary for me to define ejb-ref or
ejb-local-ref tags if I am referering one ejb from
other ejb? I mean to say is it mandatory that I should
have these deployment descriptor tags?Yes, to write portable J2EE components, every time you have a dependency on an ejb, you need to declare an ejb-ref (for a Remote EJB client) or ejb-local-ref (for a Local EJB client). This is true no matter what kind of J2EE component is accessing the ejb (Application Client, JSP, Servlet, or another ejb).
Think of the ejb-ref or ejb-local-ref as a pointer. It's different from the thing that is pointed to. Instead, it represents a dependency between a client component and a target ejb.
2) What is purpose of ejb-link tag ?Every ejb-ref or ejb-local-ref must be resolved to unambiguously point to the target ejb. The ejb-link tag is one way to resolve this dependency for the case where the target ejb lives in the same .ear as the referring component. The ejb-link tag is the ejb-name (or <ejb-jar uri>#<ejb-name>) of the target ejb.
Note that this means ejb-link is the ONLY way to resolve an ejb-local-ref, since by definition Local EJB access can only take place between two ejbs within the same .ear or a web component/ejb that live within the same .ear.
For ejb-refs, you can use ejb-link if the target ejb is within the same .ear. If not, the ejb specification does not prescribe how the dependency is resolved. It's left up to the J2EE implementation. The most common approach is for the vendor to provide a product-specific runtime .xml element that resolves the ejb-ref by associating it with the global JNDI name of the target EJB. That's the approach used in the J2EE SDK and Sun Java System Application Server.
Kenneth Saks
J2EE SDK Team
SUN Microsystems -
ejb-local-ref where to put this tag in ejb-jar.xml ??
I have an ejb-jar.xml that looks like this. I have had no problem with remote interfaces. Now I want the bean to have a local interface too.
Just let me know where the tag I have mentioned for the <ejb-local-ref> has to be put into.
When I compile this file it throws me an error which i have shown below the output of the ejb-jar.xml file
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>IDMaster</ejb-name>
<home>maxateev.mondial.brg.idmaster.IDMasterHome</home>
<remote>maxateev.mondial.brg.idmaster.IDMaster</remote>
<local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
<local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
<ejb-class>maxateev.mondial.brg.idmaster.IDMasterEJB</ejb-class>
<persistence-type>Container</persistence-type>
<ejb-local-ref>
<ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
<local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
</ejb-local-ref>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>IDMaster</abstract-schema-name>
<cmp-field>
<field-name>idPrefix</field-name>
</cmp-field>
<cmp-field>
<field-name>idValue</field-name>
</cmp-field>
<primkey-field>idPrefix</primkey-field>
<query>
<query-method>
<method-name>findAllIDMasters</method-name>
<method-params/>
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT (f) FROM IDMaster as f]]></ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>IDMaster</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
I have also added the following tag in the weblogic-jar.xml
<local-jndi-name>IDMasterEJB.IDMasterLocalHome</local-jndi-name>
Just let me know whether I am correct
On compilation (using ant utility) the error thrown is like this :
ejbc:
[java] ERROR: Error parsing 'ejb-jar.xml' line 47: The content of element type "entity" must ma
tch "(description?,display-name?,small-icon?,large-icon?,ejb-name,home?,remote?,local-home?,local?,e
jb-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-schema-name?,cmp-field*,pri
mkey-field?,env-entry*,ejb-ref*,ejb-local-ref*,security-role-ref*,security-identity?,resource-ref*,r
esource-env-ref*,query*)".
[java] ERROR: ejbc found errors
[java] Java Result: 1
Kindly Help !!!
Thanks n regards
SajivThis should take care of it
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>IDMaster</ejb-name>
<home>maxateev.mondial.brg.idmaster.IDMasterHome</home>
<remote>maxateev.mondial.brg.idmaster.IDMaster</remote>
<local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
<local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
<ejb-class>maxateev.mondial.brg.idmaster.IDMasterEJB</ejb-class>
<persistence-type>Container</persistence-type>
<ejb-local-ref>
<ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
<local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
</ejb-local-ref>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>IDMaster</abstract-schema-name>
<cmp-field>
<field-name>idPrefix</field-name>
</cmp-field>
<cmp-field>
<field-name>idValue</field-name>
</cmp-field>
<primkey-field>idPrefix</primkey-field>
<ejb-local-ref>
<ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
<local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
</ejb-local-ref>
<query>
<query-method>
<method-name>findAllIDMasters</method-name>
<method-params/>
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT (f) FROM IDMaster as f]]></ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>IDMaster</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar> -
Why does Local Folders not show up when I install Thunderbird on certain computers?
I've installed Thunderbird on my computer and it looks normal with "Local Folders" showing up in the left pane. I didn't add an email account, I just installed Thunderbird and an add-on called ImportExport tool and left it with only Local Folders. But when I try to do the same thing and install it on someone else's computer to help them import an .mbox file, when I install Thunderbird on their computer, "Local Folders" is not there. The left pane is just completely blank. And it looks like I can't import an .mbox file without it being there. I tried installing it on another laptop too and the same thing happened with no Local Folders. Why is "Local Folders" not showing up for these other two computers?
I circumvented the problem by copying the c:\users\username\appdata\local\thunderbird folder and the c:\users\username\appdata\roaming\thunderbird folder from my working PC to the nonworking computers, and Local Folders appeared in Thunderbird on those computers. It seems like these files aren't being generated properly on installation.
I tried uninstalling Thunderbird from my working PC and reinstalling it again to see what would happen (after also deleting those two appdata folders so that fresh ones would be created), and this time Local Folders did not appear on my PC as well. I don't think I did anything different during installation either. So I'm not sure why the Local Folders are no longer being generated at installation. -
Local printer not showing up in RDP session
Is the user RDP using the RDP shortcut saved or creates a new connection everytime? if using the save connection, have you tried deleting it and re-creating it and checking the local resources option again. It should show up a redirected printer in RDP session.
Hi Spicepros,
Situation: I've got a Windows 7 machine using RDP (let's call it Local) connected to a remote Windows 7 machine (Remote) which is hosted on an iMac in Boot Camp. It is a VPN connection. The printer, attached directly to the Local system is an HP LaserJet 400 M401 PCL6 connected via "USB001 Virtual Port". But this printer does not show up on the remote Windows 7 machine.
The RDP connection has Local Resources turned on.
My colleague was able to print to her local printer until she replaced her printer. Now we can't make it work.
Any suggestions would be greatly appreciated!
Warm regards,
Dave
This topic first appeared in the Spiceworks Community -
Remote desktop local drives not showing
Hi,
When I connect to a client server using Remote Desktop connection, I cannot see my local drive letters under client's my computer. I have checked the "Disk Drives" under Local Resources tab. The client sever has Windows 2003.
Please let me know why I cannot see my local drive letters.
Thanks.Using Benny's advice, here's how I fixed it for me:
I had, of course, set the property in my local MSTSC properties (Show options > Local Resources tab > Local devices and resources > "More" button > Drives).
After logging into the Terminal Server and seeing my local drives not there (hence bringing me to this thread), I then went to "Remote Desktop Session Host Configuration", as it is called on my Win2008 server, as suggested.
When it came up, there is a "Connections" section with an "RDP-Tcp" icon. I right-clicked this and selected Properties. This brings up a dialog.
Selected "Sessions" tab. Unchecked "Override user settings", selected OK, then selected the "Refresh" under the "RD Session Host Configuration" sidebar. I could then see my drives under my Computer icon on the Start Menu. Perhaps the Sessions
bit and Refresh action I did were coincidental, since I think the Sessions setting pertains more to timeouts than actual connection properties like drives, but this got me working.
-Tom -
iTunes only shows Exchange-calendars in the list where you can choose which calendars (we're talking about "calendars", not "accounts") you want to synchronize. If I add a local calendar in iCal, I can not choose it to synchronize with my iPhone. It simply doesn't show up in the list of available calendars. How does iTunes compile this list of available Calendars to synchronize?
Hi Zachary,
Here is an article I'd suggest to troubleshoot this situation:
iOS: Device not recognized in iTunes for Windows
http://support.apple.com/kb/TS1538
You may only need to go through the steps with one device and have it resolve for the others.
Cheers,
- Ari -
Sharing library on local network not showing on all computers
I am unable to see my shared music folder in iTunes for the music on the home server on a local network from my laptop. It shows fine on my wife's laptop but not on mine. I can't see the remote speakers either. All the settings in iTunes are correct for sharing and for look for shared music and I have access to the files on the network from my laptop when I browse network places. When I first installed it worked fine on my machine but then it stopped. I can't figure out why. I also tried with the firewall off but did not help either.
Any ideas why it would stop working, but still work on other PCs on the network. I have a total of 3 pcs on the network plus the server.I have the same problem with a new laptop running Vista. All three of my XP computers that run ITunes can see the shared network drive on my server. ITunes on the Vista computer doesn't see any shared network folders, even though I can open them in Vista. Even tried a shortcut the network folder on the desktop. Zip. I've seen dozens of posts about this problem and no answers from Apple... and people complain about Microsoft software... sigh.
-
Local Contacts not showing in Contacts List
Local contacts list only displays two contacts, my own and an emergency contact after sync'ing my Samsung 10.1 tablet with Google.
1.Local Contacts.
When l now open Contacts app, l am constantly presented with 'Setup/ Sync/ Import' contacts.
Yet all my local contacts are still available in the 'Groups' tab.
Through the Groups tab some days ago, l ended up on the full Contacts list, yet am unable to find it again, so the contacts are all there, the problem would seem to be with the App itself?
2. Google Contacts
a) When l attempt to 'Sync' with Google, a repeated 'Sync' error is given. I am assuming this is because there are none and all contacts are saved locally.
b) Why is it not possible to sync Local Contacts with Google and thus have a separate backup.
What l have tried as suggested on 'Setup/ Sync' dialogue:
1. Syncing and reimporting Local Contacts - This has resulted in multiple entries within 'Groups' tab yet not updated main list.
2. Syncing with Google account. - Local contacts are not on Google account and as l said above 'Sync' error
3. Import Contacts - Tried loading SD saved Local Contacts vcf file.
Please advise.
Solved!
Go to Solution.Whilst there is little I can do regarding the syncing behaviour I may be able to resolve the first issue:
Main Menu > Contacts > Menu Button > Filter > Untick both options under the "Filter" Section > Ensure "All" is ticked in the "Local Contacts" Section under "Display Contacts" > Done.
What are your thoughts about this forum? Let us know by doing this short survey.
- Official Sony Xperia Support Staff
If you're new to our forums make sure that you have read our Discussion guidelines.
If you want to get in touch with the local support team for your country please visit our contact page. -
Members of Domain Local Groups not showing up through net group command
Hello,
I am trying to get the list of members in a Domain Local Group using "NET GROUP" command, but unable to get the member list.
I get the message "group not found", whereas members of Global Groups are visible.
Thank you in advance !Unfortunately your post is off topic here, in the TechNet Site Feedback forum, because it is not Feedback about the TechNet Website or Subscription.
This is only one forum among the many that are on the TechNet Discussion Forums, and given your post, you likely chose the wrong forum.
This is a standard response I’ve written up in advance to help many people (thousands, really.) who post their question in this forum in error, but please don’t ignore it.
The links I share below I’ve collected to help you get right where you need to go with your issue.
For technical issues with Microsoft products that you would run into as an
end user of those products, one great source of info and help is
http://answers.microsoft.com, which has sections for Windows, Hotmail, Office, IE, and other products. Office related forums
are also here: http://office.microsoft.com/en-us/support/contact-us-FX103894077.aspx
For Technical issues with Microsoft products that you might have as an
IT professional (like technical installation issues, or other IT issues), you should head to the TechNet Discussion forums at
http://social.technet.microsoft.com/forums/en-us, and search for your product name.
For issues with products you might have as a Developer (like how to talk to APIs, what version of software do what, or other developer issues), you should head to the
MSDN discussion forums at http://social.msdn.microsoft.com/forums/en-us, and search for your product or issue.
If you’re asking a question particularly about one of the Microsoft Dynamics products, a great place to start is here:
http://community.dynamics.com/
If you really think your issue is related to the subscription or the TechNet Website, and I screwed up, I apologize!
Please repost your question to the discussion forum and include much more detail about your problem, that could include screenshots of the issue (do not include subscription information or product keys in your screenshots!), and/or links to the problem
you’re seeing.
If you really had no idea where to post this question but you still posted it here, you still shouldn’t have because we have
a forum just for you! It’s called the Where is the forum for…? forum and it’s here:
http://social.msdn.microsoft.com/forums/en-us/whatforum/
Moving to off topic.
Thanks
MSDN and TechNet Subscriptions Support
Did Microsoft call you out of the blue about your computer?
No, they didn't. -
Using EJB Local Interface problem
Hi to all
I have got a problem in using Local EJB Interface in Weblogic , please attention to my description
I use JDeveloper as IDE
At first I create an Application in JDeveloper that has two projects that their names are Model and ViewContorller that first one contains my EJB and another contains my JSP page respectively
The EJB code is :
@Stateless(name="AliEJB001Bean")
@Remote
@Local
public class AliEJB001Bean implements AliEJB001, AliEJB001Local {
public AliEJB001Bean() {
public String Hi(){
return "Hi000";
And its Local Interface code is :
@Local
public interface AliEJB001Local {
String Hi();
I deploy Model project to an EJB Jar file that its name is AliEE1ejb1.jar
and I deploy the ViewContorller project to a WAR file that its name is AliEE1WebApp.war
Now I add this tags to web.xml
<ejb-local-ref>
<ejb-ref-name>ali/testejb</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>model.AliEJB001Local</local>
</ejb-local-ref>
Then I deploy the Application to an EAR file by name AliEE1
After those I run my JSP page witch calls the EJB in JDeveloper (through Local EJB Interface) , JDeveloper deploy my Application to the ItegratedWeblogicServer
Ultimately the JSP can calls the EJB through Local Interface and use the Hi method and shows me the result but JDeveloper while compiles the application give me these Warnings :
Warning: <May 15, 2011 9:02:52 AM PDT> <Error> <J2EE> <BEA-160187> <weblogic.appc failed to compile your application. Recompile with the -verbose option for more details. Please see the error message(s) below.>
Warning: There are 1 nested errors:
Warning: weblogic.servlet.internal.dd.compliance.ComplianceException: Element "<ejb-local-ref>" with ejb-ref-name "ali/testejb" must either specify a valid ejb-link element or have a corresponding ejb-reference-descriptor element in weblogic.xml with a valid jndi-name.
Warning: at weblogic.servlet.internal.dd.compliance.BaseComplianceChecker.addDescriptorError(BaseComplianceChecker.java:74)
Warning: at weblogic.servlet.internal.dd.compliance.BaseComplianceChecker.addDescriptorError(BaseComplianceChecker.java:80)
Warning: at weblogic.servlet.internal.dd.compliance.EJBRefsComplianceChecker.validate(EJBRefsComplianceChecker.java:97)
Warning: at weblogic.servlet.internal.dd.compliance.EJBRefsComplianceChecker.checkEJBLocalRef(EJBRefsComplianceChecker.java:47)
Warning: at weblogic.servlet.internal.dd.compliance.EJBRefsComplianceChecker.check(EJBRefsComplianceChecker.java:39)
Warning: at weblogic.servlet.internal.dd.compliance.ComplianceUtils.checkCompliance(ComplianceUtils.java:48)
Warning: at weblogic.servlet.jsp.JspcInvoker.checkCompliance(JspcInvoker.java:145)
Warning: at weblogic.servlet.jsp.JspcInvoker.compile(JspcInvoker.java:198)
Warning: at weblogic.application.compiler.AppcUtils.compileWAR(AppcUtils.java:376)
Warning: at weblogic.application.compiler.WARModule.compile(WARModule.java:245)
Warning: at weblogic.application.compiler.flow.SingleModuleCompileFlow.proecessModule(SingleModuleCompileFlow.java:18)
Warning: at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:36)
Warning: at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
Warning: at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
Warning: at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
Warning: at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26)
Warning: at weblogic.application.compiler.WARCompiler.compile(WARCompiler.java:29)
Warning: at weblogic.application.compiler.flow.AppCompilerFlow.compileInput(AppCompilerFlow.java:112)
Warning: at weblogic.application.compiler.flow.AppCompilerFlow.compile(AppCompilerFlow.java:37)
Warning: at weblogic.application.compiler.Appc.runBody(Appc.java:198)
Warning: at weblogic.utils.compiler.Tool.run(Tool.java:158)
Warning: at weblogic.utils.compiler.Tool.run(Tool.java:115)
Warning: at weblogic.application.compiler.Appc.main(Appc.java:257)
Warning: at weblogic.appc.main(appc.java:14)
According to the warning messages I wanna add <ejb-link> tag to the web.xml for resolving warnings I add the <ejb-link> like this:
<ejb-local-ref>
<ejb-ref-name>ali/testejb</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>model.AliEJB001Local</local>
<ejb-link>AliEE1ejb1.jar#AliEJB001Bean </ejb-link>
</ejb-local-ref>
But when JDeveloper want deploy my application again it shows me this Error
[09:29:59 AM] Redeploying Application...
<May 15, 2011 9:29:59 AM PDT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1305476999381' for task '7'. Error is: 'weblogic.application.ModuleException: Could not setup environment'
weblogic.application.ModuleException: Could not setup environment
at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
Truncated. see log file for complete stacktrace
Caused By: weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'AliEE1ejb1.jar#AliEJB001Bean' declared in the ejb-ref or ejb-local-ref 'ali/testejb' in the application module 'ViewControllerWebApp.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
at weblogic.deployment.BaseEnvironmentBuilder.addEJBLinkRef(BaseEnvironmentBuilder.java:464)
at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:485)
at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
Truncated. see log file for complete stacktrace
>
<May 15, 2011 9:29:59 AM PDT> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 9 task for the application 'AliEE1'.>
<May 15, 2011 9:29:59 AM PDT> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'AliEE1'.>
<May 15, 2011 9:29:59 AM PDT> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: Could not setup environment
at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
Truncated. see log file for complete stacktrace
Caused By: weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'AliEE1ejb1.jar#AliEJB001Bean' declared in the ejb-ref or ejb-local-ref 'ali/testejb' in the application module 'ViewControllerWebApp.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
at weblogic.deployment.BaseEnvironmentBuilder.addEJBLinkRef(BaseEnvironmentBuilder.java:464)
at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:485)
at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
Truncated. see log file for complete stacktrace
>
[09:30:00 AM] #### Deployment incomplete. ####
[09:30:00 AM] Remote deployment failed
Do you know how I can solve this issue ?
thanksThank you so much
I find out the solution
I have to define my EJB in ejb-jar.xml like this
<enterprise-beans>
<session>
<ejb-name>ReplicableSFSB2</ejb-name>
<business-local>model2.AliEJB001Local</business-local>
<business-remote>model2.AliEJB001</business-remote>
<ejb-class>model2.AliEJB001Bean</ejb-class>
<session-type>Stateless</session-type>
</session>
</enterprise-beans>
And then I use the EJB name witch I defined in <ejb-name> tag in <ejb-link> tag of web.xml
like this
<ejb-local-ref>
<ejb-ref-name>ali/testejb2</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>model2.AliEJB001Local</local>
<ejb-link>Model2EJB.jar#ReplicableSFSB2</ejb-link>
</ejb-local-ref> -
EJB Local Interfaces / javax.naming.NamingException
Hi!
I have tried to deploy a very simple (Hello World like)EJB-Application. It contains a simple stateless SessionBean (with local interfaces) and a JSP which is using the EJB.
Opening the JSP i get the following error message:
javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance found for the ejb-local-ref 'ejb/TesterEJB', an EJB matching it's ejb-link 'ejb-jar-ic.jar#TesterEJB' was found, but it contained an Entity, not a Session
Here's my ejb-jar.xml:
<?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>
<display-name>oc4jJAR</display-name>
<enterprise-beans>
<session>
<display-name>TesterEJB</display-name>
<ejb-name>TesterEJB</ejb-name>
<local-home>oc4jtest.TesterHome</local-home>
<local>oc4jtest.Tester</local>
<ejb-class>oc4jtest.TesterBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<security-identity>
<description/>
<use-caller-identity/>
</security-identity>
</session>
</enterprise-beans>
<assembly-descriptor>
<method-permission>
<unchecked/>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getMessage</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getPrimaryKey</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getEJBLocalHome</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>remove</method-name>
<method-params>
<method-param>java.lang.Object</method-param>
</method-params>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>remove</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>isIdentical</method-name>
<method-params>
<method-param>javax.ejb.EJBLocalObject</method-param>
</method-params>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>create</method-name>
<method-params/>
</method>
</method-permission>
<container-transaction>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getMessage</method-name>
<method-params/>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
And here's my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
<web-app>
<display-name>oc4jWAR</display-name>
<filter>
<filter-name>TestFilter</filter-name>
<display-name>TestFilter</display-name>
<description/>
<filter-class>oc4jtest.TestFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>TestFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>test</servlet-name>
<display-name>test</display-name>
<jsp-file>/test.jsp</jsp-file>
</servlet>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>/test.jsp</welcome-file>
</welcome-file-list>
<ejb-local-ref>
<ejb-ref-name>ejb/TesterEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>oc4jtest.TesterHome</local-home>
<local>oc4jtest.Tester</local>
<ejb-link>ejb-jar-ic.jar#TesterEJB</ejb-link>
</ejb-local-ref>
</web-app>
What's wrong?
Comments would be appreciated!
Thanks!
Peter
PS: The application runs fine on Sun's Reference Implementation!Hi!
I have tried to deploy a very simple (Hello World like)EJB-Application. It contains a simple stateless SessionBean (with local interfaces) and a JSP which is using the EJB.
Opening the JSP i get the following error message:
javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance found for the ejb-local-ref 'ejb/TesterEJB', an EJB matching it's ejb-link 'ejb-jar-ic.jar#TesterEJB' was found, but it contained an Entity, not a Session
Here's my ejb-jar.xml:
<?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>
<display-name>oc4jJAR</display-name>
<enterprise-beans>
<session>
<display-name>TesterEJB</display-name>
<ejb-name>TesterEJB</ejb-name>
<local-home>oc4jtest.TesterHome</local-home>
<local>oc4jtest.Tester</local>
<ejb-class>oc4jtest.TesterBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<security-identity>
<description/>
<use-caller-identity/>
</security-identity>
</session>
</enterprise-beans>
<assembly-descriptor>
<method-permission>
<unchecked/>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getMessage</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getPrimaryKey</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getEJBLocalHome</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>remove</method-name>
<method-params>
<method-param>java.lang.Object</method-param>
</method-params>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>remove</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>isIdentical</method-name>
<method-params>
<method-param>javax.ejb.EJBLocalObject</method-param>
</method-params>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>create</method-name>
<method-params/>
</method>
</method-permission>
<container-transaction>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getMessage</method-name>
<method-params/>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
And here's my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
<web-app>
<display-name>oc4jWAR</display-name>
<filter>
<filter-name>TestFilter</filter-name>
<display-name>TestFilter</display-name>
<description/>
<filter-class>oc4jtest.TestFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>TestFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>test</servlet-name>
<display-name>test</display-name>
<jsp-file>/test.jsp</jsp-file>
</servlet>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>/test.jsp</welcome-file>
</welcome-file-list>
<ejb-local-ref>
<ejb-ref-name>ejb/TesterEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>oc4jtest.TesterHome</local-home>
<local>oc4jtest.Tester</local>
<ejb-link>ejb-jar-ic.jar#TesterEJB</ejb-link>
</ejb-local-ref>
</web-app>
What's wrong?
Comments would be appreciated!
Thanks!
Peter
PS: The application runs fine on Sun's Reference Implementation!
Maybe you are looking for
-
What is the Role that gives me access to JCO settings page?
Hi all, I am at the customer site doing some WDP dev. I need to setup JCO so as to make use of RFC. Customer has already assigned all the roles they have and i still cant access to the backend setting page. What is the role to give me the access? how
-
Safari is missing important resources and should be reinstalled
I'm getting the following message in Safari with a "clean" install of Leopard. Safari is missing important resources and should be reinstalled. I can get to some pages, but not others. Any idea why I'd be getting this? Google searches report this as
-
my ipod stopped working and I am not able to start it. When I connect it to my computer and start itunes, it ask me to restore the device but that too gives an error (1601). I have tried the recommended soln but that didnt help. What should I do?
-
Error initializing Java Runtime Environment. You may need to reinstall Flash.
...This is really annoying. I work with adobe cs5. Recently, it started to not work. I would have to restart it over and over to get it to compile an swf properly. So I am trying cs5.5. I get this error "Error initializing Java Runtime Environment.
-
HT1338 Why do I get an error message when attempting to update OS X?
I can't seem to complete the latest updates. I get an error message every time.