tan kian

Ranch Hand
+ Follow
since Apr 09, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by tan kian

i am printing it out in the jsp page, which is as follows:
<h2> Core Modules </h2>
<table border="1">
<ass2:testtag module="core" />
<tr>
<td>Name</td>
<td>${pageScope.core}</td>
</tr>
</table>
18 years ago
JSP
hi all, my custom tag only prints out the last data from a collection, it never prints out the first few data. i did not code any doAfterBody(), everything is done in doStartTag(). what am i doing wrong?

private Iterator it;
private String module;

public int doStartTag() throws JspException
{
try
{
InitialContext ic = new InitialContext();
Object obj = ic.lookup("java:comp/env/ejb/StuSession");
sesshome = (StuSessionHome)PortableRemoteObject.narrow(obj,StuSessionHome.class);
StuSession tryme = sesshome.create("johnny");
Collection core = tryme.getStuff("wateva");
this.it = core.iterator();
while (this.it.hasNext())
{
//assuming i have a method for setting module and its already set
this.pageContext.setAttribute(this.module,this.it.next());
}
}
catch (Exception ex)
{
throw new JspTagException("LookupTag: " + ex);
}
return SKIP_BODY;
}
18 years ago
JSP
hi all, i got this exception when i deployed and ran my war:
javax.ejb.ObjectNotFoundException: JDO74011: Bean 'SemEJB' method findByPrimaryKey: cannot find bean with key SemPK: semid="s001", pid="p0001", cid="c111"
the error occured at this line:
((SemLocalHome)ctx.getEJBLocalHome()).findByPrimaryKey(key);
SemPK is a class i created to store multiple(3) keys as 1 primary key, and is used by the entity Sem. PointBase is been used, and i am hard coding all information into the servlet. can anyone tell me what i am doing wrong? thanks.
[ October 12, 2005: Message edited by: tan kian ]
thks for the replies, but i solved it already. turned out that i'm supposed to put the name of war(or some other context name, cant remember cause i set everything to the same name) in the address and not the name of the jsp file.
hi all, i cant seem to access a jsp page that i had set as the welcome page. it just keeps on showing a 404 error to me saying that it cant be found. i set the aliases to the same name as the filename(/filename.jsp) and the welcome page to the file(filename.jsp), and i dont know what i am doing wrong. can someone help? thanks!!!
its ok, i found another way to solve my problem. thanks anyway!
so should it be like this?
public EnrolLocal create(String sid,String currentsem,String pid,String cid,MixedKey multipleKey) throws CreateException,RemoteException;
public EnrolLocal findByPrimaryKey(MixedKey multipleKey) throws FinderException;

and multipleKey will be something like this:
public MixedKey(String sid,String pid,String cid)
[ September 10, 2005: Message edited by: tan kian ]
how do i do this in j2ee? for example,i want sid,pid and cid to be the primary keys. do i specify something like this in the localHome?

public EnrolLocal create(String sid,String currentsem,String pid,String cid) throws CreateException,RemoteException;
public EnrolLocal findByPrimaryKey(String sid) throws FinderException;
public EnrolLocal findByPrimaryKey(String pid) throws FinderException;
public EnrolLocal findByPrimaryKey(String cid) throws FinderException;

or like this:

public EnrolLocal findSid(String sid) throws FinderException;
public EnrolLocal findPid(String pid) throws FinderException;
public EnrolLocal findCid(String cid) throws FinderException;
i got these failure messages when i was using the verifier:
tests.ejb.entity.cmp2.CmrFieldsAbstract
tests.ejb.entity.cmp2.CmrFieldAccessor
tests.ejb.entity.cmp2.CmrFieldNameStartLowerCase
tests.ejb.entity.cmp2.CmrFieldAccessorModifiers
tests.ejb.entity.cmp2.CmrUseCorrectCollectionInterface
does anyone know how to solve these errors? thanks for the help!!!
i got this error in DOS when i tried to run my client, can anyone help to identify the problem? i got this problem after i mapped a many-to-1 relationship and depolyed it ignoring some errors i got when verifying.

javax.transaction.TransactionRolledbackException: CORBA TRANSACTION_ROLLEDBACK 9
998 Maybe; nested exception is:
org.omg.CORBA.TRANSACTION_ROLLEDBACK: ----------BEGIN server-side stack
trace----------
org.omg.CORBA.TRANSACTION_ROLLEDBACK: vmcid: 0x2000 minor code: 1806 complete
d: Maybe
at com.sun.enterprise.iiop.POAProtocolMgr.mapException(POAProtocolMgr.ja
va:201)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:79
7)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInv
ocationHandler.java:137)
at $Proxy13.createStudent(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(Reflecti
veTie.java:117)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispa
tchToServant(CorbaServerRequestDispatcherImpl.java:651)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispa
tch(CorbaServerRequestDispatcherImpl.java:190)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest
Request(CorbaMessageMediatorImpl.java:1653)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest
(CorbaMessageMediatorImpl.java:1513)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(C
orbaMessageMediatorImpl.java:895)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.call
back(RequestMessage_1_2.java:172)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest
(CorbaMessageMediatorImpl.java:668)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatc
h(SocketOrChannelConnectionImpl.java:375)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(So
cketOrChannelConnectionImpl.java:284)
at com.sun.corba.ee.impl.transport.ReaderThreadImpl.doWork(ReaderThreadI
mpl.java:73)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.
run(ThreadPoolImpl.java:382)
Caused by: javax.ejb.TransactionRolledbackLocalException: Exception thrown from
bean; nested exception is: com.sun.jdo.api.persistence.support.JDOUserException:
JDO76017: Cannot create SCO instance of class CoursesBean_1316087683_JDOState b
ecause it is not a valid type.
at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseConta
iner.java:2564)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:
2416)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:76
3)
at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalH
omeInvocationHandler.java:197)
at $Proxy6.create(Unknown Source)
at StudentSessionBean.createStudent(StudentSessionBean.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:146)

at java.security.AccessController.doPrivileged(Native Method)
at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivil
eged(EJBSecurityManager.java:930)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:151
)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInv
ocationHandler.java:128)
... 17 more

----------END server-side stack trace---------- vmcid: 0x2000 minor code: 1806
completed: Maybe
Bean is referring to the XXXbean that i'll be coding right? so for the Container, is it referring to the XXXHome or XXXLocal or some other stuff?
whats the difference between the two/how do i diffrenciate them? and how am i supposed to know when which one is the one to be implemented?
yeah i'm supposed to have a client for the sessionbean as well.....damm this is confusing
hmm.....so for my case i'll need a total of 9 files, 3 for the sessionbean and 3 for each entitybean?
hi all, i have a noob question regarding j2ee......i'm supposed to write a sessionbean(ABSession) that provides a client interface to 2 CMP entity beans(a and b) that should have a many to many CMR between them. now, i'm confused about the "sessionbean that provides a client interface" part. is this 1 class file that specifies the interface for the 2 entity beans? or is there more to it? thanks for the help.

something like this?:
public interface ABSession extends EJBLocalHome
{
create(String name, int age) throws CreateException;
findByPrimaryKey(String name);
}

or:
public class ABSession implements SessionBean
{
public void ejbCreate() throws CreateException
{
}

//methods here
}