thanks djiao,
I've actually tried the <resource-env-ref> for both connection factory and the queue and it was not working.
regarding the sun-web.xml, i did not define anything in it in the beginning. since it's not working, i defined corresponding entries for the connection factory and queue. like:
<resource-ref>
<res-ref-name>jms/jwangConnectionFactory</res-ref-name>
<jndi-name>jms/jwangConnectionFactory</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>jms/jwangMsgQueue</res-ref-name>
<jndi-name>jms/jwangMsgQueue</jndi-name>
</resource-ref>
<!-- JMS Connection Factories (java:comp/env/jms/jwangConnectionFactory): not working
<resource-env-ref>
<resource-env-ref-name>jms/jwangConnectionFactory</resource-env-ref-name>
<jndi-name>jms/jwangConnectionFactory</jndi-name>
</resource-env-ref>
-->
however, it's still not working. it kept saying that the object was not bound:
javax.naming.NameNotFoundException: No object bound to name java:comp/env/jms/jwangConnectionFactory
[Message sent by forum member 'classfish' (classfish)]
http://forums.java.net/jive/thread.jspa?messageID=288199