[Tomcat, HTTPD, Servlets & JSP] - Web application deployment question
by xaeryan
I'd like to be able to separate my classes from my WAR file, since my classes are often recompiled individually (and this is a large scale project). If I omit the class files from the WAR, where should I put them instead?
I'd like to change from something like this (directory structure of WAR file):
-------------------
index.jsp
| +META-INF
| manifest.mf
| +WEB-INF
| web.xml
| +classes
| +package1
| +subpackagename1
| myclass.class
| +package2
| +subpackageame2
| yourclass.class
to instead these (WAR file):
---------------
index.jsp
| +META-INF
| manifest.mf
| +WEB-INF
| web.xml
| +classes
JAR file 1:
----------------
+META-INF
| manifest.mf
| +package1
| +subpackagename1
| myclass.class
JAR file 2:
----------------
+META-INF
| manifest.mf
| +package2
| +subpackageame2
| yourclass.class
When I do this, my index.jsp gives me classdefnotfound on 'myclass' and 'yourclass'. I'm kinda new to this, but I figured the JARs should go inside the 'lib' folder of the JBoss server I am using. This doesn't seem to be the case. Any help would be appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043552#4043552
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043552
19 years
[EJB 3.0] - find throwing EntityNotFoundException?
by mazz@jboss.com
EntityManager.find() is supposed to return null when the entity is not in the DB.
This works except under this condition. I'm seeing this in a unit test of mine, hence the odd use-case (I'm deleting the resource and then immediately trying to find it again), but it does seem like its not behaving properly in that case.
Do this to replicate:
Pojo pojo = new Pojo();
| entityManager.persist(pojo);
| int id = pojo.getId();
| entityManager.remove(pojo);
| assert entityManager.find(Pojo.class, id) == null; // this throws exception
find() should return null in this case, but I get this exception:
javax.persistence.EntityNotFoundException: org.hibernate.ObjectDeletedException: The object with that id was deleted: [Pojo#506554]
| at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:564)
| at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:168)
| ...
I was wondering if anyone else sees this, and if its truly the way its designed to work. Again, it is an odd use case and one I'm only using in a unit test so I'm not worried about it. Wasn't sure if I should JIRA this or not.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043551#4043551
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043551
19 years