RE: [JBoss-user] Auto-increment(revisited) : read on jGuru.

2001-07-26 Thread Frank Villarreal



Assuming the auto-id is your primary key, what would 
you use as the entity bean's primary key?

Frank T. Villarreal, Jr. Email [EMAIL PROTECTED] 

  -Original Message-From: Hermann RANGAMANA 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, July 26, 2001 
  9:32 AMTo: [EMAIL PROTECTED]Subject: 
  [JBoss-user] Auto-increment(revisited) : read on jGuru.
  Hi all,
  
  while we all in this list have debated about the 
  best way to have an Autoincrement-like feature in our EJB (using AutoNumber 
  bean, using a singleton session bean to retrieve the newly created id in the 
  db, etc.), i've just came through a text at jGuru - in FAQ section about EJB - 
  about a fairly simple way to handle auto-incr with CMP. I'd just like want to 
  know if anyone has tested the suggested method, and if it works correctly with 
  jBoss 
  Any comment would be higly 
  appreciated.
  
  --hermann
  
  From jGuru :
  


  Question 
  How does Container 
Managed Persistence work with automatically generated database ID 
fields? Should I map the ID field explicitly or leave it unspecified? 

  
  Answer In the Deployment Descriptor, 
  map the normal fields appropriately, but don't specify the auto-id field as 
  one of the container managed fields. 
  Link : http://www.jguru.com/faq/view.jsp?EID=33146
  



RE: [JBoss-user] ejbLoad not called even when commit-option is C

2001-07-19 Thread Frank Villarreal

Luke,

search the previous posts for the following topic HOW TO DISABLE
ENTITY-BEAN CACHING.  You can read about the steps I had to take in order
to eliminate caching with option-C. I still think setting the container to
option-C alone should have disabled caching...does anyone know if there is
a bug with the LRUCachingPolicy?

Frank T. Villarreal, Jr.
Email [EMAIL PROTECTED]


 -Original Message-
 From: Luke Studley [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 19, 2001 7:35 AM
 To: '[EMAIL PROTECTED]'
 Subject: Re: [JBoss-user] ejbLoad not called even when 
 commit-option is
 C
 
 
 Hello
 
 I think this relates exactly to the same problem I am having, 
 see my post
 from about 18 hours ago below. When I went back to read the 
 ejb1.1. spec it
 seems to suggest that there are 3 different ways a container 
 may behave
 between transactional calls on a bean (see mail below), it 
 appears to me
 that JBoss is taking option A, which is allowable, but not 
 very useful for
 what I want to achieve (i.e. dB access from without the bean).
 
 I am hoping that somebody will rubbish my conclusions and 
 tell me how we can
 make JBoss call ejbLoad at the beginning of each 
 transactional set of calls.
 
 If you find any solution to this please do post it.
 
 Best of luck
 
 Luke
 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] CommunicationException in JSP to EJB communicati on

2001-06-25 Thread Frank Villarreal

Felix,

I believe this is a Tomcat bug. Tomcat seems unable to locate EJBs unless
you put a copy of your application jars and the JBoss client jars in the
$TOMCAT_HOME/lib directory as well as your app's directory.  At least this
is what I found after much digging in various mailing lists. Hope that
helps!

Frank T. Villarreal, Jr.


 -Original Message-
 From: Felix Munoz [mailto:[EMAIL PROTECTED]]
 Sent: Monday, June 25, 2001 4:27 PM
 To: '[EMAIL PROTECTED]'
 Subject: RE: [JBoss-user] CommunicationException in JSP to EJB
 communicati on
 
 
 Fred:
 
 Sorry about that. Actually, the JNDI name PersonBean is 
 bound correctly.
 The file breakdown is simplified... Your suggestion is a good 
 one. However,
 I am concerned I will get the same error if I deal with a Session bean
 instead than with an Entity bean. For some reason, if I add the
 ClientJAR.jar to the Tomcat lib directory everything works fine...
 
 Felix
 
 -Original Message-
 From: Fred Loney [mailto:[EMAIL PROTECTED]]
 Sent: Monday, June 25, 2001 4:04 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [JBoss-user] CommunicationException in JSP to EJB
 communication
 
 
 The jndi name PersonBean is bound to a 
 com.munoz.concept.person.PersonHome
 rather than a com.munoz.ejb.person.PersonHome. Perhaps a 
 build problem?
 
 It is preferable to insulate JSP from EJB. Wrap the Entity 
 EJB calls in a
 Session EJB. Wrap the Session EJB in a bean. Call the bean 
 from the JSP.
 Remove the EJB classes from the war. Cf. Sun J2EE blueprints 
 for examples.
 
 --
 Fred Loney
 Enterprise Java Consultant
 Spirited Software, Inc.
 [EMAIL PROTECTED]
 
 Felix Munoz wrote:
 
  Hi:
 
  I have been trying to implement a simple JSP to EJB 
 communication test
 from
  an EAR file deployed on JBoss/Tomcat but I have been unsuccessful.
 
  This is the EAR file breakdown:
 
  TestEAR.ear
  application.xml
  TestWAR.war
  WEB-INF
  lib
  ClientJAR.jar
  com
  munoz
  ejb
  Person.class
  PersonBean.class
  PersonHome.class
  web.xml
  ejbTest.jsp
 
  TestJAR.jar
  META-INF
  ejb-jar.xml
  com
  munoz
  ejb
  Person.class
  PersonBean.class
  PersonHome.class
 
  In the JSP I am making the following call:
 
  Context initialContext = new InitialContext();
  Object personHome = null;
 
  try
  {
  personHome = initialContext.lookup(PersonBean);
  if (personHome == null)
  {
  out.println(PersonHome is null);
  }
  else
  {
  out.println(Success!);
  }
  }
  catch (Exception exception)
  {
  System.out.println(exception);
  out.println(exception);
  exception.printStackTrace(System.out);
  }
 
  The page compiles correctly, but when I call it, I get back 
 the following
  exception:
 
  [EmbeddedTomcat] javax.naming.CommunicationException [Root 
 exception is
  java.lang.ClassNotFoundException: 
 com.munoz.concept.person.PersonHome]
  javax.naming.CommunicationException.  Root exception is 
 [EmbeddedTomcat]
  java.lang.ClassNotFoundException: 
 com.munoz.concept.person.PersonHome
  [EmbeddedTomcat]at
  javax.management.loading.MLet.findClass(MLet.java:800)
  [EmbeddedTomcat]at 
 java.lang.ClassLoader.loadClass(Unknown Source)
  [EmbeddedTomcat]at 
 java.lang.ClassLoader.loadClass(Unknown Source)
  [EmbeddedTomcat]at 
 java.lang.ClassLoader.loadClassInternal(Unknown
  Source)
  [EmbeddedTomcat]at java.lang.Class.forName0(Native Method)
  [EmbeddedTomcat]at java.lang.Class.forName(Unknown Source)
  [EmbeddedTomcat]at
  sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
  [EmbeddedTomcat]at
  java.io.ObjectInputStream.inputProxyClassDescriptor(Unknown Source)
  [EmbeddedTomcat]at 
 java.io.ObjectInputStream.readObject(Unknown
  Source)
  [EmbeddedTomcat]at 
 java.io.ObjectInputStream.readObject(Unknown
  Source)
  [EmbeddedTomcat]at 
 java.io.ObjectInputStream.inputObject(Unknown
  Source)
  [EmbeddedTomcat]at 
 java.io.ObjectInputStream.readObject(Unknown
  Source)
  [EmbeddedTomcat]at 
 java.io.ObjectInputStream.readObject(Unknown
  Source)
  [EmbeddedTomcat]at 
 java.rmi.MarshalledObject.get(Unknown Source)
  [EmbeddedTomcat]at
  org.jnp.interfaces.NamingContext.lookup(NamingContext.java:299)
  [EmbeddedTomcat]at
  org.jnp.interfaces.NamingContext.lookup(NamingContext.java:279)
  [EmbeddedTomcat]at 
 javax.naming.InitialContext.lookup(Unknown
  Source)
  [EmbeddedTomcat]at
 
 

RE: [JBoss-user] HOW TO DISABLE ENTITY-BEAN CACHING?

2001-06-19 Thread Frank Villarreal

Thanks Burkhard!

I changed all every setting in the cache-policy-conf to 1 (except for
cache-load-factor...I left it at 0.75) and my beans are now being refreshed
(close-to-real-time).  I know this will be bad performance, but I get the
desired effect for integrating a J2EE application with a VB application.
What's curious is that simply setting commit-option to 'C' did not work.  By
definition, I thought that would bypass caching for my CMP-entity bean.  The
definition for option 'C' states:

Option C: The container does not cache bean instances and instances memory
state is synchronized on every transaction start (via ejbLoad). For business
methods executing outside a transaction the synchronization is done too, but
as the ejbLoad executes in the same transaction context as the triggering
business method, the state must still be considered invalid and might
already have changed in the persistent storage when the business method
executes.

I'm using the LRUEnterpriseContextCachePolicy and I also set all my
session-bean cache parameters equal to 1.  Just a heads up for anyone else
out there thinking about doing something like this.

-Frank

 -Original Message-
 From: Burkhard Vogel [mailto:[EMAIL PROTECTED]]
 Sent: Monday, June 18, 2001 10:52 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [JBoss-user] HOW TO DISABLE ENTITY-BEAN CACHING?
 
 
 Use 1.
 - Original Message -
 From: Frank Villarreal [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, June 15, 2001 4:52 PM
 Subject: RE: [JBoss-user] HOW TO DISABLE ENTITY-BEAN CACHING?
 
 
  K.V. Vinay Menon [mailto:[EMAIL PROTECTED]] wrote :
   For what its worth did you try changing the following section in
   standardjboss.xml
  
   cache-policy-conf
   min-capacity50/min-capacity
   max-capacity1000/max-capacity
   overager-period300/overager-period
   max-bean-age600/max-bean-age
   resizer-period400/resizer-period
  
  max-cache-miss-period60/max-cache-miss-period
  
  min-cache-miss-period1/min-cache-miss-period
   cache-load-factor0.75/cache-load-factor
   /cache-policy-conf
  
   to set min/max-capacity to 0?
  
   Vinay
 
  Thanks Vinay, but I tried setting the min/max capacity to 0 and it
 resulted
  in the following jboss startup exception...
 
  exception
  [Container factory] org.jboss.ejb.DeploymentException: 
 Can't import policy
  configuration, Cause:org.jboss.ejb.DeploymentException: Min 
 cache capacity
  can't be = 0
  [Container factory] at
 
 org.jboss.ejb.plugins.AbstractInstanceCache.importXml(Abstract
 InstanceCache.
  java:311)
  [Container factory] at
 
 org.jboss.ejb.ContainerFactory.createInstanceCache(ContainerFa
 ctory.java:762
  )
  [Container factory]
  /exception
 
  Any other ideas?
 
  - Frank
 
  ___
  JBoss-user mailing list
  [EMAIL PROTECTED]
  http://lists.sourceforge.net/lists/listinfo/jboss-user
 
 
 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 http://lists.sourceforge.net/lists/listinfo/jboss-user
 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] HOW TO DISABLE ENTITY-BEAN CACHING?

2001-06-15 Thread Frank Villarreal

Hello all.

I was wondering if someone can give me a hand.  I temporarily need to
disable all entity-bean caching in JBoss.  Is this possible?  My problem is
that I have an external application that is updating my entity-bean tables
(I will eventually eliminate that, but for now I have no choice in the
matter) and I want my beans to show the most current data from the
operational store.  So far, I have modified standardjboss.xml and set the
commit-option tags to option C ... which seems like a fit. However, after
making a change to a database record and accessing the corresponding
entity-bean, the bean still contains the old data (apparently it is cached
in memory).  Am I going insane or am I missing some configuration somewhere?
Any help is appreciated!

- Frank Villarreal 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] xalan 'n' stuff

2001-06-15 Thread Frank Villarreal

How about in the WEB-INF/classes or WEB-INF/lib directory of your
web-application?

- Frank Villarreal

 -Original Message-
 From: Timo Kauppinen [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 15, 2001 7:09 AM
 To: [EMAIL PROTECTED]
 Subject: [JBoss-user] xalan 'n' stuff
 
 
 Hello!
 
 I know this may be a common problem (or maybe not). At least I think I
 have seen this thing discussed here.. but I ask it anyway:
 
 If I want to use xalan as the xsl-parser in my servlet (I'm using
 Jboss-2.2.2 with tomcat), where should I put the xalan.jar? Tomcat
 can't find the needed classes if I put it in [inst-dir]/tomcat/lib and
 [inst-dir]/jboss/lib/ext doesnt't work either. I thought that 
 it wouldn't
 do in the starting classpath either (in run_with_tomcat.bat). 
 
 So if those options don't work, I'm a little out of ideas. 
 Can anyone give
 suggestions?
 
 Cheers!
 
 Timo 
 
 
 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 http://lists.sourceforge.net/lists/listinfo/jboss-user
 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] HOW TO DISABLE ENTITY-BEAN CACHING?

2001-06-15 Thread Frank Villarreal

K.V. Vinay Menon [mailto:[EMAIL PROTECTED]] wrote :
 For what its worth did you try changing the following section in
 standardjboss.xml
 
 cache-policy-conf
 min-capacity50/min-capacity
 max-capacity1000/max-capacity
 overager-period300/overager-period
 max-bean-age600/max-bean-age
 resizer-period400/resizer-period

max-cache-miss-period60/max-cache-miss-period

min-cache-miss-period1/min-cache-miss-period
 cache-load-factor0.75/cache-load-factor
 /cache-policy-conf
 
 to set min/max-capacity to 0?
 
 Vinay

Thanks Vinay, but I tried setting the min/max capacity to 0 and it resulted
in the following jboss startup exception...

exception
[Container factory] org.jboss.ejb.DeploymentException: Can't import policy
configuration, Cause:org.jboss.ejb.DeploymentException: Min cache capacity
can't be = 0
[Container factory] at
org.jboss.ejb.plugins.AbstractInstanceCache.importXml(AbstractInstanceCache.
java:311)
[Container factory] at
org.jboss.ejb.ContainerFactory.createInstanceCache(ContainerFactory.java:762
)
[Container factory] 
/exception

Any other ideas?

- Frank 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] HOW TO DISABLE ENTITY-BEAN CACHING ???

2001-06-14 Thread Frank Villarreal

Hello all.

I was wondering if someone can give me a hand.  I temporarily need to
disable all entity-bean caching in JBoss.  Is this possible?  My problem is
that I have an external application that is updating my entity-bean tables
(I will eventually eliminate that, but for now I have no choice in the
matter) and I want my beans to show the most current data from the
operational store.  So far, I have modified standardjboss.xml and set the
commit-option tags to option C ... which seems like a fit. However, after
making a change to a database record and accessing the corresponding
entity-bean, the bean still contains the old data (apparently it is cached
in memory).  Am I going insane or am I missing some configuration somewhere?
Any help is appreciated!

- Frank Villarreal

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] primary key problem

2001-05-16 Thread Frank Villarreal

Check out this discussion thread on the Server Side:
http://theserverside.com/patterns/thread.jsp?thread_id=4228

it contains a boat-load of information/ideas on how to create unique id's
for EJBs. Hope it helps!

- Frank


-Original Message-
From: Cumps Jef [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 1:37 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] primary key problem


Hi all, 

i have a problem and some solutions, but i don't know which one's the best: 

I have some entity beans working with MS SQL Server. When i undeploy my
application the tables are not destoyed and i don't want them to. The
problem is that i want to work with an int as Primary Key for those entity
beans. That int should be auto-increasing if you get what i mean. Every new
row in the database should get the next number. 

I cannot work with a static int in my bean because when i re-deploy it, it
will restart counting from 0 and that row would already exist. 

I could make a database acces in every create method to check which the last
PK in the database was, but i've got the feeling there's a better solution. 

Is there a standard way to work here, or not. What would be the best
solution ?? Any possibility to make SQL Server do the job itself ?? 

any help, tips or examples would be really appreciated. 

thanx in advance, 

jef


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] JBoss newbie needs help with installation!

2001-05-15 Thread Frank Villarreal

I lied. I must have openned the run.sh script when I was trying to debug it
and placed a carriage return or something in there. I made a new copy of
run.sh from the download and now JBoss+tomcat starts up just fine.

-Frank


-Original Message-
From: Frank Villarreal [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 12:20 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] JBoss newbie needs help with installation!


Hello all!

I have installed Jboss 2.0 standalone successfully before, but now I have
installed Jboss2.2.1 w/tomcat and receive the following error when I attempt
startup:

cd /usr/jboss-tomcat/jboss/bin

/bin/sh run_with_tomcat.sh

JBOSS_CLASSPATH=run.jar:../crimson.jar:/usr/jdk1.3.0_02/lib/tools.jar

EXCEPTION in thread main java.io.IOException: jboss.properties missing at
org.jboss.Main.main(Main.java:66)

I know the jboss.properties file is in the right place and present. I have
not modified the package downloaded directly from jboss.org. 

Has anyone seen this before? Can someone please point me in the right
direction?
Thanks in advance!

-Frank

PS: Outstanding work JBOSS coders, the product seems to really be evolving
rapidly!

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user