weblogic workshop built error.

S

swun2010

Hi,

I am running weblogic 8.1.4.
I am following its tutorial to build a EJB project, but its built
failed with the following error:

Build project MyEJBProject started.
BUILD STARTED
check-env:
clean:
Deleting 2 files from C:\DOCUME~1\sam.wun\LOCALS~1\Temp
\wlw_MyEJBProject_build
Deleted 5 directories from C:\DOCUME~1\sam.wun\LOCALS~1\Temp
\wlw_MyEJBProject_build
removed module 'MyEJBProject.jar'
build:
WARNING: Building to temporary directory C:\DOCUME~1\sam.wun
\LOCALS~1\Temp\/wlw_MyEJBProject_build...
WARNING: Running EJBGen...
Loading source file C:\DOCUME~1\sam.wun\LOCALS~1\Temp\/
wlw_MyEJBProject_build/examples\ejb20\relationships\bands
\BandBean.java...
Loading source file C:\DOCUME~1\sam.wun\LOCALS~1\Temp\/
wlw_MyEJBProject_build/examples\ejb20\relationships\bands
\MusicBean.java...
Constructing Javadoc information...
EJBGen 2.16

C:\DOCUME~1\sam.wun\LOCALS~1\Temp\wlw_MyEJBProject_build\examples
\ejb20\relationships\bands\
WARNING: BandBean.java:29: No JNDI name was found.
WARNING: MusicBean.java:27: No JNDI name was found.
ERROR: MusicBean.java:27: [ejb-local-ref name=ejb/null link=null] must
have either 'link' or all of 'name', 'type', 'home', 'remote|local'
attributes specified.
1 error.
ERROR: Java returned: 1
BUILD FAILED
ERROR: Java returned: 1


The offending line is at "public class MusicBean" in the following ejb
file:

package examples.ejb20.relationships.bands;

import javax.ejb.*;
import weblogic.ejb.*;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/**
* @ejbgen:session
* ejb-name = "Music"
*
* @ejbgen:jndi-name local="ejb.Music"

*
* @ejbgen:file-generation remote-class="false" remote-class-name =
"Music" remote-home="false" remote-home-name = "MusicHome" local-
class="true" local-class-name = "MusicLocal" local-home="true" local-
home-name = "MusicLocalHome"
* @ejbgen:ejb-local-ref
* @ejbgen:ejb-local-ref
* type="Entity"
* name="ejb/bandLink"
* local="examples.ejb20.relationships.bands.Band"
* link="BandEJB"
* home="examples.ejb20.relationships.bands.BandHome"
*/
public class MusicBean
extends GenericSessionBean
implements SessionBean
{
private BandHome bandHome;

public void ejbCreate() {
try {
javax.naming.Context ic = new InitialContext();
bandHome = (BandHome)ic.lookup("java:comp/env/ejb/bandLink");
}
catch (NamingException ne) {
throw new EJBException(ne);
}
}

/**
* @ejbgen:local-method
*/
public Collection getBands()
{
try {
Iterator bands = bandHome.findAll().iterator();
Collection result = new ArrayList();
while (bands.hasNext()) {
Band band = (Band)bands.next();
result.add(band.getName());
}
return result;

}
catch (FinderException fe)
{
throw new EJBException(fe);
}
}

/**
* @ejbgen:local-method
*/
public void addBand(BandInfo bandInfo)
{
try {
bandHome.create(bandInfo.getName(), bandInfo.getFounder(),
bandInfo.getStartDate());
}
catch (CreateException ce) {
throw new EJBException(ce);
}

}
}

Can anyone tell me how to troubleshoot this error?
If you know how to correct the error, I'm greatly appreciate for any
suggestion.

Thanks
Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top