[Design of POJO Server] - Re: The DeploymentManager and ProfileService
by scott.stark@jboss.org
I'm running into a few issues with trying to run an embedded AS testcase given just this type of unit test code:
| @Profile(name="ejb3")
| @ProfileDeployment(name="EmbeddedSessionUnitTest", pkg="org.jboss.test.ejb3.basic")
| public class EmbeddedSessionUnitTest
| extends EmbeddedTestCase
| {
|
| public EmbeddedSessionUnitTest(String name)
| {
| super(name);
| }
|
| public void testSession()
| throws Exception
| {
| InitialContext ctx = getInitialContext();
| String jndiName = "ejb3/basic/SimpleSessionBean";
| Object ref = ctx.lookup(jndiName);
| SimpleSession test = (SimpleSession) ref;
| test.ping();
| }
| }
|
| @Profile(name="naming")
| public class EmbeddedTestCase
| extends AbstractTestCaseWithSetup
| {
| ...
| }
|
| |
| | where the notion is that the test classes require "ejb3" and "naming" subprofiles, and has a dynamic deployment that will be made up of the ejbs visible in the "org.jboss.test.ejb3.basic". This is the coarsest description of a subprofile. More generally this would include some criteria expression.
| |
| | Now the issues are:
| | 1. The JBossEmbeddedAS needs to accept richer input to allow metadata such as the inmemory deployment information.
| | https://jira.jboss.org/jira/browse/EMB-19
| |
| | 2. I'm having some class loading problems with CNFEs, CNFs for some of the security and ejb3 classes when using JBossEmbeddedAS to boot the server/embedded profile in jbossas trunk. Still need to drill into that.
| |
| | 3. The ProfileServiceBootstrap needs to call the AbstractBootstrapProfileFactory createProfile(Map profiles, List subProfiles, ProfileKey key, List profileMetaData) method as there may be ProfileMetaData coming in from the bootstrap environment.
| |
| | 4. We need the ability to have multiple ProfileFactorys that are either associated with a ProfileMetaData or tolerant of ProfileMetaData they don't understand so that a mixture of profile implementations can be built up.
| |
| | I'm working on 3-4 today.
| |
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4207124#4207124
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4207124
15 years, 4 months
[Design the new POJO MicroContainer] - Re: Generated Classes not found if they do not match any of
by kabir.khan@jboss.com
"adrian(a)jboss.org" wrote :
| We also haven't discussed your other point about needing to flush the blacklist.
|
False alarm :-)
The domain's blacklist is being cleared by BaseClassLoader via the policy
| public void clearBlackList(String name)
| {
| if (blackList != null)
| {
| boolean trace = log.isTraceEnabled();
| if (trace)
| log.trace(this + " removing from blacklist " + name);
| blackList.remove(name);
| policy.clearBlackList(name);
| }
| }
|
It works fine, as long as the class created is in one of the existing packages.
I did notice however that if I do
| //Blacklist classe
| //Loader A belongs to default domain and exports packageA
| loaderA.load("packageA.NewClassA");
| //Loader B belongs to defaultDomain and exports packageB
| loaderB.load("packageA.NewClassA");
|
| //Create packageA.NewClassA in loaderA
| loaderA.load("packageA.NewClassA"); //Works fine
| loaderB.load("packageA.NewClassA");
|
loaderB has packageA.NewClassA in its blackList, but this is never checked when loading classes. But it does seem to be used in the following method, so ClassLoaderDomain.clearBlackList() should probably be clear all the domain's classloaders?
| public class BaseClassLoader extends SecureClassLoader implements BaseClassLoaderMBean, RealClassLoader
| {
| URL getResourceLocally(final String name, final boolean trace)
| {
| ...
| // Is this resource blacklisted?
| if (blackList != null && blackList.containsKey(name))
| {
| if (trace)
| log.trace(this + " resource is blacklisted " + name);
| return null;
| }
| ...
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4207117#4207117
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4207117
15 years, 4 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: UUIDGenerator broken on Windows...
by clebert.suconic@jboss.com
If anyone out there with windows out there, wants to help us verifying this:
:-)
You just need to download trunk on SVN, build it and run org.jboss.messaging.tests.unit.util.UUIDTest through Eclipse
But before that add a System.out on UUIDGenerator::getHardwareAddress
| public final static byte[] getHardwareAddress()
| {
| Method getHardwareAddressMethod;
| try
| {
| getHardwareAddressMethod = NetworkInterface.class.getMethod("getHardwareAddress");
| }
| catch (Throwable t)
| {
| // not on Java 6 or not enough security permission
| return null;
| }
|
| try
| {
| Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
| while (networkInterfaces.hasMoreElements())
| {
| NetworkInterface networkInterface = (NetworkInterface)networkInterfaces.nextElement();
| Object res = getHardwareAddressMethod.invoke(networkInterface);
| if (res != null && res instanceof byte[])
| {
| byte[] address = (byte[])res;
| byte[] paddedAddress = getZeroPaddedSixBytes(address);
| if (paddedAddress != null)
| {
| System.out.println(networkInterface.getDisplayName() + " " + asString(paddedAddress));
| if (log.isDebugEnabled())
| {
| log.debug("using hardware address " + asString(paddedAddress));
| }
| return paddedAddress;
| }
| }
| }
| }
| catch (Throwable t)
| {
| }
|
| return null;
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4207102#4207102
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4207102
15 years, 4 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: UUIDGenerator broken on Windows...
by jesper.pedersen
Could you do something with the following warnings ?
| [javac] trunk/src/main/org/jboss/messaging/util/UUIDGenerator.java:132: warning: non-varargs call of varargs method with inexact argument type for last parameter;
| [javac] cast to java.lang.Class for a varargs call
| [javac] cast to java.lang.Class[] for a non-varargs call and to suppress this warning
| [javac] getHardwareAddressMethod = NetworkInterface.class.getMethod("getHardwareAddress", null);
| [javac] ^
| [javac] trunk/src/main/org/jboss/messaging/util/UUIDGenerator.java:146: warning: non-varargs call of varargs method with inexact argument type for last parameter;
| [javac] cast to java.lang.Object for a varargs call
| [javac] cast to java.lang.Object[] for a non-varargs call and to suppress this warning
| [javac] Object res = getHardwareAddressMethod.invoke(networkInterface, null);
| [javac] ^
| [javac] Note: Some input files use unchecked or unsafe operations.
| [javac] Note: Recompile with -Xlint:unchecked for details.
| [javac] 2 warnings
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4207078#4207078
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4207078
15 years, 4 months