frankie huang

Greenhorn
+ Follow
since Dec 17, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by frankie huang

I try to use it,I think it's useful sometime. It's lightweight and need not a EJB container. But I am worry about it, because no others to do this.
[ March 23, 2003: Message edited by: frankie huang ]
21 years ago
I place this code in the web.xml


...
<servlet>
<servlet-name>servletAccount</servlet-name>
<servlet-class>test.servlet.ServletAccount</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>servletAccount</servlet-name>
<url-pattern>/servletAccount</url-pattern>
</servlet-mapping>
...


but when I deploy it to JBoss 3.0.4,It tell me


23:35:33,869 WARN [jbossweb] WARNING: ERROR@file:/C:/Documents and Settings/Adm
inistrator/Local Settings/Temp/Jetty_0_0_0_0_8080__myes/webapp/WEB-INF/web.xml l
ine:36 col:-1 : org.xml.sax.SAXParseException: component �web-app� not allow �servle
t-mapping�。
23:35:33,879 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment
.scanner.URLDeploymentScanner$DeployedURL@8f7bacd1{ url=file:/D:/jboss-3.0.4/ser
ver/default/deploy/myes.war, deployedLastModified=1044718424000 }
org.jboss.deployment.DeploymentException: component�web-app� not allow �servlet�。
; - nested throwable: (org.xml.sax.SAXParseException: component�web-app� not allow
�servlet�。


I remember that I use it in Resin and it's J2EE standard. WHY? anyone could tell me?
[ February 08, 2003: Message edited by: frankie huang ]
[ February 08, 2003: Message edited by: frankie huang ]
21 years ago
There are 2 types of LOCK in dbms: table-locked and row-locked. maybe you should consult the db2 documentation.
I don't think these 2 transcation can run concurrently. for example:
the table "table1" like this:
--------------------------
field1 field2
'aa' 12
'bb' 20
'cc' 30
--------------------------
update1 is "update table1 set field2=22 where field1='aa'"
update3 is "update table1 set field1='dd' where field2>=20"
the result of the these 2 transaction is not sure if they run concurrently.
It seem that the implementation of the rsistent Storage is done by the phone provider.
21 years ago
got you,arun. Thank you very much!
[ January 14, 2003: Message edited by: frankie huang ]
21 years ago

Originally posted by Sam Dalton:
when you call create() you are creating a NEW instance of your stateful bean (with default values for the fields) you need to, instead, store the reference to your Stateful bean and reuse that (the HttpSession is a good place to store such a reference)
Cheers
Sam


oh,I must keep it in Session manually? I see,Thank you!
sorry,the url can't open!
21 years ago
Though I remove the "remove" code,the result is not changed and the member's state can't keep. And I found the bean call "setSessionContext()" & "ejbCreate()" & "count()" every time I call it in the client. the STDOUT:
when I deploy a stateful session bean, the state can't keep; while a deploy a stateless session bean,the state keep. why?
my session bean:

the ejb-jar.xml

the client code:

when I code "stateful" in the ejb-jar.xml, I found the result is always "1" even I refresh the browser times. when I code "stateless" in the ejb-jar.xml, I found the result is "1",and then "2" and then "3"...
I feel puzzling, it does not obey the book "Mastering EJB".
when I deploy a stateful session bean, the state can't keep; while a deploy a stateless session bean,the state keep. why?
my session bean:

the ejb-jar.xml

the client code:

when I code "stateful" in the ejb-jar.xml, I found the result is always "1" even I refresh the browser times. when I code "stateless" in the ejb-jar.xml, I found the result is "1",and then "2" and then "3"...
I feel puzzling, it does not obey the book "Mastering EJB".
21 years ago
in English,pls!
21 years ago
Thank you very much! got you.
21 years ago
Thank you very much! I got it.
and I found the template project in the jboss is a very good start point for beginer.

Originally posted by meka toka:
Hi,
You are getting the NameNotFoundException because you are trying to lookup an object(Hello) in the location (comp/env/ejb/myestest) and your ejb object is not present over there.
Where to look for ::
1. Check and make sure that you are using the same JNDI name that you binded your object with.
go through the following links
a. http://www.jboss.org/online-manual/HTML/ch01s15.html
b. http://www.jboss.org/online-manual/HTML/ch05.html
let me know if you have any more questions
Regards
Meka Toka

21 years ago
I got a NameNotFoundException in my EJB's client. "javax.naming.NameNotFoundException: myes not bound" ( "myes" is the name of my war).
I depoly a .jar file(EJBs) and a .war file.
The .war contains:
[index.jsp]
-------------------------------------------------
try {
//Properties props = System.getProperties();
//Context ctx = new InitialContext(props);
Context ctx = new InitialContext();
HelloHome lHome = (HelloHome) ctx.lookup("java:comp/env/ejb/myestest/Hello");
Hello hello = lHome.create();
out.println("return:"+hello.hello());
}catch( Exception e ) {
out.println( "Caugth exception: " + e.getMessage() );
e.printStackTrace();
}
-------------------------------------------------
[WEB-INF/web.xml]
-------------------------------------------------
<ejb-ref>
<ejb-ref-name>ejb/myestest/Hello</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.funyear.myes.test.HelloHome</home>
<remote>com.funyear.myes.test.Hello</remote>
</ejb-ref>
-------------------------------------------------
[WEB-INF/jboss-web.xml]
-------------------------------------------------
<ejb-ref>
<ejb-ref-name>ejb/myestest/Hello</ejb-ref-name>
<jndi-name>ejb/myes/Hello</jndi-name>
</ejb-ref>
-------------------------------------------------
The .jar file contains:
[ejb-jar.xml]
-------------------------------------------------
<session >
<description><![CDATA[stateless session bean]]></description>
<ejb-name>com.funyear.myes.test.Hello</ejb-name>
<home>com.funyear.myes.test.HelloHome</home>
<remote>com.funyear.myes.test.Hello</remote>
<ejb-class>com.funyear.myes.test.HelloBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
-------------------------------------------------
[jboss.xml]
-------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
<jboss>
<enterprise-beans>
<session>
<ejb-name>com.funyear.myes.test.Hello</ejb-name>
<jndi-name>com/funyear/myes/test/Hello</jndi-name>
</session>
</enterprise-beans>
<resource-managers>
</resource-managers>
</jboss>
-----------------------------------------------
and beans.
Is there anyone know why? could you tell me? thank you very much!