[Design of POJO Server] - Problem handling absolute directory specs in classpath
by adinn
Hi guys. I've found another small deployer issue to do with class paths in war files. The XTS demo program included a manifest whose classpath referred,inter alia, to /WEB-INF/classes. When this gets deployed it generates the following error display:
| at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
| at org.jboss.deployers.structure.spi.helpers.AbstractStructureBuilder.populateContext(AbstractStructureBuilder.java:144)
| at org.jboss.deployers.structure.spi.helpers.AbstractStructureBuilder.populateContext(AbstractStructureBuilder.java:83)
| at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:89)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.determineStructure(MainDeployerImpl.java:845)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:303)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:260)
| at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:267)
| at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
| at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
| at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
| at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.IllegalArgumentException: A path element is empty: xts-demo.ear//WEB-INF/classes
| at org.jboss.virtual.plugins.vfs.helpers.PathTokenizer.getTokens(PathTokenizer.java:106)
| at org.jboss.virtual.plugins.context.AbstractVirtualFileHandler.structuredFindChild(AbstractVirtualFileHandler.java:475)
| at org.jboss.virtual.plugins.context.file.FileHandler.getChild(FileHandler.java:233)
| at org.jboss.virtual.plugins.context.AbstractVFSContext.getChild(AbstractVFSContext.java:164)
| at org.jboss.virtual.VFS.getChild(VFS.java:228)
| at org.jboss.virtual.VFSUtils.addManifestLocations(VFSUtils.java:200)
| at org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder.applyContextInfo(VFSStructureBuilder.java:217)
| at org.jboss.deployers.structure.spi.helpers.AbstractStructureBuilder.populateContext(AbstractStructureBuilder.java:130)
| ... 16 more
|
After debugging the problem it appears that PathTokenizer.getTokens is being passed a VFS file name of the form
| .../xts-demo.ear//WEB-INF/classes
|
When it conjures up the vfs file name the classpath generator code carefully adds a trailing slash after the .ear file name and then checks for a trailing slash on the manifest class path element. However, it does not check to see if the manifest class path element has a leading slash -- hence the double slash and the claim that a 'path element is empty'.
The problem goes away if either i) the manifest entry is changed to WEB-INF.classes or ii) the manifest entry is removed (I know it's redundant but presumably this problem will affect anyone who employs a different absolute path)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165594#4165594
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165594
17 years, 8 months
[Design of Clustering on JBoss] - Re: JBCLUSTER-206 - Extract HB/JBC integration layer from EJ
by galder.zamarreno@jboss.com
"bstansberry(a)jboss.com" wrote : Re: the tests, there are tests in the Hibernate 3.3 core cache-jboss-cache2 module that avoid using the AS. See the org.hibernate.test.cache.jbc2.functional package. The difficulty is those bring in dependencies on the Hibernate test module, plus I'm sure have JBC 2 ties. So it will require some effort to break those ties and let them run standalone.
I've started looking at the dependencies on the test module. Hibernate 3.2.x never produced any binaries with the test classes required to port the org.hibernate.test.cache.jbc2.functional tests. Since 3.3.x though, such jar has been made available (http://repository.jboss.org/maven2/org/hibernate/hibernate-testing/3.3.0....). I've done a diff between the test classes in 3.2.x and trunk and they're almost identical with a few minor differences such as: use of org.slf4j rather than commons logging, and refactoring of DummyConnectionProvider and DummyTransactionManagerLookup into ConnectionProviderImpl and TransactionManagerLookupImpl. There's also a 2 of extra methods in UnitTestCase (createFailureExpectedSuite() method), FunctionalTestCase (isSerializableIsolationEnforced() method) and removed FunctionalTestClassTestSuite(String) constructor from FunctionalTestClassTestSuite.
Bottom line: I think I can safely add a dependency for HB 3.3 hibernate testing even though we're testing HB 3.2.x. WDYT? This would much easier than having to now come up with testing jars for 3.2.x series. The downside here is that if we pull 3.3 hibernate testing module, we're indirectly pull other jars but I don't see any direct incompatibilities with what we pull right now for 3.2.x:
M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar
| M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar
| M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar
| M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
| M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar
| M2_REPO/javax/transaction/jta/1.1/jta-1.1.jar
| M2_REPO/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2.jar
I think it'd be interesting to get Steve's thoughts on this. Thoughts?
"bstansberry(a)jboss.com" wrote : On the name, how about "hibernate-jbc-cache-provider"? CacheProvider is the legacy API that's replaced in 3.3. Including it in the name is at least a small indication this is a legacy integration.
I like the name, just one little thing. To make the legacy aspect even more obvious, I'd suggest making cache-provider a single word, matching the class CacheProvider class name: i.e. hibernate-jbc-cacheprovider. As an extension of this, I suppose the package name for this classes would be something along: org.jboss.hibernate.jbc.cacheprovider
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165540#4165540
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165540
17 years, 8 months
[Design of POJO Server] - Re: Scoping of war/jar file embedded in sar service archives
by alesj
I've added a fix for this issue - a recursion in case parent classpath is not yet set:
| protected static Set<VirtualFile> determineClassPath(DeploymentUnit unit, Module module)
| {
| ClassPathVisitor visitor = new ClassPathVisitor(unit);
| try
| {
| unit.visit(visitor);
| }
| catch (DeploymentException e)
| {
| throw new RuntimeException("Error visiting deployment: " + e);
| }
| Set<VirtualFile> classPath = visitor.getClassPath();
| // Weed out parent classpaths
| if (module != null && module.getParentDomainName() == null)
| {
| DeploymentUnit parent = unit.getParent();
| while (parent != null)
| {
| Set<VirtualFile> parentClassPath = parent.getAttachment(VFS_CLASS_PATH, Set.class);
| if (parentClassPath == null)
| parentClassPath = determineClassPath(parent, parent.getAttachment(Module.class));
|
| if (parentClassPath != null && parentClassPath.isEmpty() == false)
| {
| if (log.isTraceEnabled())
| {
| for (VirtualFile parentFile : parentClassPath)
| {
| if (classPath.contains(parentFile))
| log.trace(unit + " weeding duplicate entry " + parentFile + " from classpath already in parent " + parent);
| }
| }
| classPath.removeAll(parentClassPath);
| }
| parent = parent.getParent();
| }
| }
| unit.addAttachment(VFS_CLASS_PATH, classPath);
| return classPath;
| }
|
But I'll let you close the JIRA issue if you feel this is a proper fix.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165510#4165510
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165510
17 years, 8 months