Re: [Resin-interest] Recompilation of jsp on every request for the same page

2009-03-31 Thread Prasad Chaudhari
I do not see it as a permissions issue.

I use windows XP and resin can write to that directory as it everytime compiles 
classes(jsps and tags) to the directory (work). I have tried it with Resin 
3.2.1 as well, same result.

Some additional info.
Resin is configured so that document-directory is a different location than 
resin home. Please see below the lines from resin.xml

web-app id=/web 
document-directory=D:/work/branches/web-projects/target/project-name 
startup-mode=automatic    

Best Regards
Prasad

--- Scott Ferguson f...@caucho.com schrieb am Mo, 30.3.2009:
Von: Scott Ferguson f...@caucho.com
Betreff: Re: [Resin-interest] Recompilation of jsp on every request for the 
same page
An: General Discussion for the Resin application server 
resin-interest@caucho.com
Datum: Montag, 30. März 2009, 12:17


On Mar 30, 2009, at 1:18 AM, Prasad Chaudhari wrote:
Hi Scott,

Thanks for the reply.

Level was fine now I have changed it to finer. 

After this change, no additional information was logged except for some tags 
entire source code was printed out in the log file.

Any guess why resin cannot load already compiled tag class? 
Can you double check all the permissions, including all the parent directory 
permissions?
The -1 implies that Resin can't load the class at all.
-- Scott


Best Regards
Prasad




--- Scott Ferguson f...@caucho.com schrieb am Fr, 27.3.2009:
Von: Scott Ferguson f...@caucho.com
Betreff: Re: [Resin-interest] Recompilation of jsp on every request for the 
same page
An: General Discussion for the Resin application server 
resin-interest@caucho.com
Datum: Freitag, 27. März 2009, 18:46


On Mar 27, 2009, at 4:29 AM, Prasad Chaudhari wrote:
Hi All,

Resin compiles the jsp page and its included tags every time that jsp page is 
clicked. Shouldn't Resin compile the JSP page only after first click?

After the changing the log level of resin to fine it shows following stack 
trace.

[11:43:09.445] {hmux-127.0.0.1:6800-16} 
_jsp._web_22dinf._tags._template.b_mainnavigation__tag/b digest is modified 
(bold=-5390068824210296648,new=-1/b)
[11:43:09.445] {hmux-127.0.0.1:6800-16} java.lang.ClassNotFoundException: 
Can you turn on fine or finer logging?
That digest is modified indicates that Resin can't load the tag class for 
some reason (so the calculated digest is -1).
-- Scott
_jsp._web_22dinf._tags._shop._searchbox__tag in 
EnvironmentClassLoader[web-app:http://
localhost:8080/web]
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.loader.DynamicClassLoader.loadClass(DynamicClassLoader.java:1291)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.loader.DynamicClassLoader.loadClass(DynamicClassLoader.java:1269)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
java.lang.Class.forName0(Native Method)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
java.lang.Class.forName(Class.java:247)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.make.ClassDependency.init(ClassDependency.java:83)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
_jsp._web_22dinf._jsp._shop._homepage._homepage__jsp.init(b_homepage__jsp.java:693/b)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.jsp.JspManager.preload(JspManager.java:320)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.jsp.JspManager.compile(JspManager.java:218)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.jsp.JspManager.createPage(JspManager.java:171)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.jsp.JspManager.createPage(JspManager.java:150)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.jsp.PageManager.getPage(PageManager.java:307)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.jsp.PageManager.getPage(PageManager.java:237)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.jsp.PageManager.getPage(PageManager.java:220)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.jsp.QServlet.getSubPage(QServlet.java:295)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.jsp.QServlet.getPage(QServlet.java:210)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.server.dispatch.PageFilterChain.compilePage(PageFilterChain.java:238)
[11:43:09.445] {hmux-127.0.0.1:6800-16} at 
com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:145)

Same error as below can be observed for all included tags.

Can experts here tell why this is happening and how can it be fixed.

Best Regards
   ___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

   

Re: [Resin-interest] Amber (JPA) Table Indexes

2009-03-31 Thread Daniel López
Isn't that something one would do at the database level?

D.

Scott Hernandez escribió:
 Is there a way to hint to Amber that a column should be indexed?
 
 For example we will be doing a lot of queries like this:
 
 Select u from User where u.isActive == true ...
 
 And it would be nice if the isActive column is indexed.
 
 Thanks in advance,
 Scott


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Amber (JPA) Table Indexes

2009-03-31 Thread Scott Hernandez
Hibernate lets you add a @Index to entities/tables for this.
http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#d0e2305

Since JPA is creating, and maintaining the schema it is nice to keep
that config all in one place.

I would say that for serious tuning you may need to do this at the
database level, but for simple things like indexes, constraints, and
data validation much of this should be provided at the persistence
definition level, and in the application definition (and applied where
possible to the database).


On Mon, Mar 30, 2009 at 11:19 PM, Daniel López d.lo...@uib.es wrote:
 Isn't that something one would do at the database level?


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] Remoting without XML service declarations

2009-03-31 Thread Jeff Schnitzer
Is it possible to expose EJBs (or POJOs) as remote-able objects
without declaring them in XML (ie, resin-web.xml)?  The Resin Remoting
docs (http://caucho.com/resin/doc/resin-remoting.xtp) make it look
like I must declare a servlet-mapping for every bean I wish to
expose.  Is there an annotation I can declare on my beans that will
have the same effect?

Are there any future plans to make J2EE-style InitialContext remote
JNDI lookups work?

Thanks,
Jeff


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] Authentication against LDAP with SSHA-encrypted passwords ?

2009-03-31 Thread Laurent Jaccard
Hi,

I am wondering if Resin Pro 3.1.8 can authenticate natively, ie. without
writing any Java code,
against a LDAP that stores user passwords encrypted  with SSHA ? (Sun
Directory, OpenDS)

I am trying to get that sort of auth working but to no avail, and thought it
might be the reason.

If not, what would you suggest ? Write a custom Authenticator class ?

Thanks in advance for any answer or hint.

Regards,
--
Laurent
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] MBean Registration

2009-03-31 Thread Scott Ferguson

On Mar 30, 2009, at 5:31 PM, Scott Hernandez wrote:

 Is there an annotation based way to register Management Beans?

 I know I can do this in XML, but is there an annotation, or interface
 that will work the same way?

  resource mbean-name=subetha:name=Cleanup
type=org.subethamail.core.admin.CleanupBean
mbean- 
 interface=org.subethamail.core.admin.CleanupManagement/

Not currently.  It's something I've considered off and on, but never  
gave it a priority.  I've added the idea as 
http://bugs.caucho.com/view.php?id=3427

-- Scott



 Thanks in advance,
 Scott


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Remoting without XML service declarations

2009-03-31 Thread Scott Ferguson

On Mar 31, 2009, at 1:27 AM, Jeff Schnitzer wrote:

 Is it possible to expose EJBs (or POJOs) as remote-able objects
 without declaring them in XML (ie, resin-web.xml)?  The Resin Remoting
 docs (http://caucho.com/resin/doc/resin-remoting.xtp) make it look
 like I must declare a servlet-mapping for every bean I wish to
 expose.  Is there an annotation I can declare on my beans that will
 have the same effect?

Hmm.  It might be possible to use the new Servlet 3.0 annotations for  
that purpose (we haven't implemented it yet.)

The original idea was that exposed URLs shouldn't generally be  
automatic.  In other words, having a class in a jar automatically  
listen to a URL as a servlet or a remote bean might be a security  
risk.  Basically, the same reason why /servlets/* is discouraged.

 Are there any future plans to make J2EE-style InitialContext remote
 JNDI lookups work?

That should already exist with the remote-client tag.  You do need  
to declare the remote services that you're using.

-- Scott



 Thanks,
 Jeff


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Remoting without XML service declarations

2009-03-31 Thread Jeff Schnitzer
On Tue, Mar 31, 2009 at 11:08 AM, Scott Ferguson f...@caucho.com wrote:

 Hmm.  It might be possible to use the new Servlet 3.0 annotations for
 that purpose (we haven't implemented it yet.)

 The original idea was that exposed URLs shouldn't generally be
 automatic.  In other words, having a class in a jar automatically
 listen to a URL as a servlet or a remote bean might be a security
 risk.  Basically, the same reason why /servlets/* is discouraged.

Right... I just want to be able to define those URLs without resorting
to XML.  The @ServletMapping annotation seems useful but you would
still need something to define the protocol.

As long as we're discussing wishes, I'd also like to be able to put
the RMI-type protocols on a different port so that there is no chance
of accidentally exposing anything :-)

For now we will use the XML.

 Are there any future plans to make J2EE-style InitialContext remote
 JNDI lookups work?

 That should already exist with the remote-client tag.  You do need
 to declare the remote services that you're using.

But this is still within a running Resin container, right?  Is there a
way to make this work with a standalone client?

Thanks,
Jeff


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Using Hibernate as EntityManager in Resin 4

2009-03-31 Thread Scott Hernandez
Let me try this again from the beginning...

I want to have services (that start with the application, and runs the
length of the application lifetime) so I define a POJO with a @Service
and a method with a @PostConstruct. Everything is going well so far. I
define a persistenceunit in persistence.xml and corresponding jdbc
info in the (resin-)web.xml config. So my service looks like this:

@Service
public class InitDBService {

@PersistenceContext
protected EntityManager em;

@PersistenceUnit
protected EntityManagerFactory emf;

@PostConstruct
public void postConstruct() {
log.log(Level.INFO, emf= + emf +  em= + em);
if (emptyDB()) insertDefaultData();
}
}

 emf=AmberEntityManagerFactory[amber] em=EntityManagerProxy[amber]

So I load up my webapp and away it goes. If I use amber (the native
JPA impl) everything looks fine and the entity manager, and factory is
injected as expected, and the data is queried (and inserted if empty).

Now, if I switch to a hibernate backed persistenceunit (hbm) I get
some kind of exception no matter how I do it.

 emf=null em=EntityManagerTransactionProxy[hbm,null]

I have tried using @TransactionAttributes, the UserTransaction object,
and various other attempts without any success on the hibernate
persistenceunit.

Now, later in my code, in a servlet, I have the same code and it runs
fine against the @PersistenceContext using the hibernate
persistenceunit.

I hope this makes a bit more sense and maybe someone can point me in
the right direction to get this working :)

Thanks in advance,
Scott


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Using Hibernate as EntityManager in Resin 4

2009-03-31 Thread Scott Hernandez
Let me try this again from the beginning...

I want to have services (that start with the application, and runs the
length of the application lifetime) so I define a POJO with a @Service
and a method with a @PostConstruct. Everything is going well so far. I
define a persistenceunit in persistence.xml and corresponding jdbc
info in the (resin-)web.xml config. So my service looks like this:

@Service
public class InitDBService {

@PersistenceContext
protected EntityManager em;

@PersistenceUnit
protected EntityManagerFactory emf;

@PostConstruct
public void postConstruct() {
log.log(Level.INFO, emf= + emf +  em= + em);
if (emptyDB()) insertDefaultData();
}
}

 emf=AmberEntityManagerFactory[amber] em=EntityManagerProxy[amber]

So I load up my webapp and away it goes. If I use amber (the native
JPA impl) everything looks fine and the entity manager, and factory is
injected as expected, and the data is queried (and inserted if empty).

Now, if I switch to a hibernate backed persistenceunit (hbm) I get
some kind of exception no matter how I do it.

 emf=null em=EntityManagerTransactionProxy[hbm,null]

I have tried using @TransactionAttributes, the UserTransaction object,
and various other attempts without any success on the hibernate
persistenceunit.

Now, later in my code, in a servlet, I have the same code and it runs
fine against the @PersistenceContext using the hibernate
persistenceunit.

I hope this makes a bit more sense and maybe someone can point me in
the right direction to get this working :)

Thanks in advance,
Scott


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Using Hibernate as EntityManager in Resin 4

2009-03-31 Thread Scott Ferguson

On Mar 31, 2009, at 12:51 PM, Scott Hernandez wrote:

 Let me try this again from the beginning...

 I want to have services (that start with the application, and runs the
 length of the application lifetime) so I define a POJO with a @Service
 and a method with a @PostConstruct. Everything is going well so far. I
 define a persistenceunit in persistence.xml and corresponding jdbc
 info in the (resin-)web.xml config. So my service looks like this:

I've added a bug report for this at http://bugs.caucho.com/view.php?id=3429

I didn't quite understand the situation.  The environment might not be  
properly setup at the @PostConstruct time for some reason.

-- Scott



 @Service
 public class InitDBService {

   @PersistenceContext
   protected EntityManager em;
   
   @PersistenceUnit
   protected EntityManagerFactory emf;

   @PostConstruct
   public void postConstruct() {
   log.log(Level.INFO, emf= + emf +  em= + em);
if (emptyDB()) insertDefaultData();
}
 }

 emf=AmberEntityManagerFactory[amber] em=EntityManagerProxy[amber]

 So I load up my webapp and away it goes. If I use amber (the native
 JPA impl) everything looks fine and the entity manager, and factory is
 injected as expected, and the data is queried (and inserted if empty).

 Now, if I switch to a hibernate backed persistenceunit (hbm) I get
 some kind of exception no matter how I do it.

 emf=null em=EntityManagerTransactionProxy[hbm,null]

 I have tried using @TransactionAttributes, the UserTransaction object,
 and various other attempts without any success on the hibernate
 persistenceunit.

 Now, later in my code, in a servlet, I have the same code and it runs
 fine against the @PersistenceContext using the hibernate
 persistenceunit.

 I hope this makes a bit more sense and maybe someone can point me in
 the right direction to get this working :)

 Thanks in advance,
 Scott


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Using Hibernate as EntityManager in Resin 4

2009-03-31 Thread Scott Hernandez
Yeah, I tracked it down the the start method of
EnvironmentClassLoader. When walking through the EnvironmentListener[]
list the webbeans (and @ApplicationScope @Service) are init'd before
the EJB system. The EntityManagerFactory exists in the AmberContainer
but it is still in the _pendingFactory list (and not in the wbManager
it seems) until the startPersistenceUnits method is called for
AmberContainer.

The list of listeners is in this order:
InjectManager
OsgiLoader
InjectManager (osgi)
DBPoolImpl
EjbContainer
AmberContainer
WeakStopListener (@Stateless EJB instance)

Basically the @Service @PostConstruct is called during the first
InjectManager, and the Amber/Ejb Container isn't good till much later
(at the end).

Well, that is what it seems to be. I think I should be able to find a
workaround since it seems that there are events that fire after all
this that I can hook into. Not the most elegant way, but should work
for now (I can take care of re-initialization in case it changes
behavior). I don't know enough about the internals of resin to know if
this a problem, or fixable, but if I can help let me know :)


On Tue, Mar 31, 2009 at 3:25 PM, Scott Ferguson f...@caucho.com wrote:
 On Mar 31, 2009, at 12:51 PM, Scott Hernandez wrote:
 I've added a bug report for this at http://bugs.caucho.com/view.php?id=3429

 I didn't quite understand the situation.  The environment might not be
 properly setup at the @PostConstruct time for some reason.


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest