[JNDI and Naming] - Jboss 7 and the global JNDI
by A I
A I [https://community.jboss.org/people/nullable] created the discussion
"Jboss 7 and the global JNDI"
To view the discussion, visit: https://community.jboss.org/message/818595#818595
--------------------------------------------------------------
Hello,
I use JBoss 7.1 and did NOT understand the support of the global JNDI in "Remote application clients" of the global JNDI in JBOSS 7.1.
When I use the JNDI java:global/my-ear/my-ejb/BMPFacadeBean!my.domain.service.IBMPFacadeRemote
I get the error
testBMPProcessCommit(my.domain.itest.BMPIntegrationIT) Time elapsed: 0.34 sec <<< ERROR!
javax.naming.NameNotFoundException: global/my-ear/my-ejb/BMPFacadeBean!my.domain.service.IBMPFacadeRemote -- service jboss.naming.context.java.jboss.exported.global.my-ear.my-ejb."BMPFacadeBean!my.domain.service.IBMPFacadeRemote"
at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)
at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)
at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
I want also to mention that JNDI ejb:my-ear/my-ejb//BMPFacadeBean!my.domain.service.IBMPFacadeRemote works just fine.
What is the current status of implmenting the global JNDI for remote clients?
I use the following Properties when obtaining the Context (without jndi.properties):
env = new Properties();
env.setProperty( "java.naming.factory.initial", "org.jboss.naming.remote.client.InitialContextFactory");
//env.setProperty( "java.naming.factory.initial", "org.jboss.as.naming.InitialContextFactory");
//env.put("jboss.naming.client.ejb.context", true);
env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
env.setProperty( "java.naming.provider.url", "remote://localhost:4447");
env.put(Context.SECURITY_PRINCIPAL, "user");
env.put(Context.SECURITY_CREDENTIALS, "apassword");
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/818595#818595]
Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years
[Javassist] - Grabbing an existing class's constructors?
by Melissa Dale
Melissa Dale [https://community.jboss.org/people/mdale] created the discussion
"Grabbing an existing class's constructors?"
To view the discussion, visit: https://community.jboss.org/message/818521#818521
--------------------------------------------------------------
I am a graduate student studying software engineering and technical debt. For my research I am using Javassist to create coupling between classes. However there is obviously a problem when I try to create an instance of a class that takes in parameters. I would really like to be able to grab a CtClass's initializers (if they're not an empty constructor), and then pass in the variables it is expecting. for example, consider I am trying to make an instance of class B in class A:
Public class B{public int foo;public char spam;public B(int bar, char eggs){ foo = bar; spam = eggs;}
}
Public class A{ B injected = new B(X,X);}
currently I attempt to use a "isEmpty" check if the class initializer if it is not empty, in which case I have attempted the following two approaches. Both give me a 'no such constructor' error:
if(from.getClassInitializer().isEmpty()){
String toBeAdded = from_class +" injected = new " + from_class+"();";
CtField f = CtField.make(toBeAdded, to);
to.addField(f);
}
//Hopefully this will catch cases where constructors are not empty and insert a dummy instructor
else{
}
I think the method "getClassInitializers" should return a CtClass's constructors as an array, but I'm unsure what to do with this array, which eclipse won't even let me declare. I'd like to loop through an array of expected parameters and make dummy variables of that type so I can do something like: B injected = new B (13, w);
Worse case scenario, I could create a blank class initializer in B so I could do injected B = new B(); I think I should be able to use the makeClassInitializer() method, but that does not work for me, as I still get a no such constructor error. Something like:
else{
from.makeClassInitializer();
String toBeAdded = from_class + "injected = new " + from_class+"();";
CtField f = CtField.make(toBeAdded, to);
to.addField(f);
}
I would really appreciate any help or input you may have to offer. Thanks!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/818521#818521]
Start a new discussion in Javassist at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years
[jBPM] - Service Tasks for Android
by Lenka Šišková
Lenka Šišková [https://community.jboss.org/people/lenka.s] created the discussion
"Service Tasks for Android"
To view the discussion, visit: https://community.jboss.org/message/818446#818446
--------------------------------------------------------------
Hi there,
I am from Slovakia and I am studying in Brno on Faculty of Informatics. This year I was writing my bachelor thesis on topic Business processes demonstration for Android platform. In practical part of my thesis I made three Service Tasks using Android libraries. First one get current location, second one send SMS with latitude and longitude on default number and the last one add scheduled event to calendar. I tested them on real devices and they worked just fine, but those test processes was created using API, not BPMN editor. I hope my work will be an inspiration for at least some of you for creating your own service tasks for Android and maybe one day there will repository full of tasks for Android.
Source code can be find im my Github repository (link below). This repository contains config files and handlers for those task, short html page with informations about each of them and my test apps.ff
Feel free to use them or change them in any way you need :)
Lenka
P.S. promissed link: https://github.com/lenka8d/tasks.git https://github.com/lenka8d/tasks.git
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/818446#818446]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years
[Datasource Configuration] - Problem with configuring jackrabbit data source.
by Petr Šrůtka
Petr Šrůtka [https://community.jboss.org/people/menzi] created the discussion
"Problem with configuring jackrabbit data source."
To view the discussion, visit: https://community.jboss.org/message/818424#818424
--------------------------------------------------------------
've encountered a problem with jackrabbit pool in jboss 5 and jackrabbit 2.0.
I've a jcr datasource configured like this
<tx-connection-factory>
<jndi-name>jcr/local</jndi-name>
<xa-transaction />
<track-connection-by-tx>true</track-connection-by-tx>
<rar-name>jackrabbit-jca.rar</rar-name>
<connection-definition>javax.jcr.Repository</connection-definition>
<config-property name="homeDir" type="java.lang.String">${jackrabbit.homedir}</config-property>
<config-property name="configFile" type="java.lang.String">classpath:repository.xml</config-property>
<config-property name="bindSessionToTransaction" type="java.lang.Boolean">true</config-property>
<no-tx-separate-pools />
<max-pool-size>30</max-pool-size>
</tx-connection-factory>
like this, application works fine, but i'm getting this error really often (it's thrown every time i'm logging into dms session with this code)
Repository repo = (Repository) ctx.lookup(repository.getJndiName());
Credentials cred = new SimpleCredentials(userId, new char[] { 'p', 'w', 'd' });
Session s = repo.login(cred);
Destroying connection that could not be successfully matched: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@8cd0558[state=NORMAL mc=org.apache.jackrabbit.jca.JCAManagedConnection@6eec369a handles=0 lastUse=1366642930773 permit=false trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@8a800c9 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@6f7fc42f xaResource=org.apache.jackrabbit.jca.TransactionBoundXAResource@4c19d8eb txSync=null]
when i add to datasource configuration, error mentioned earlier dissapears, but each connection to jcr creates it's own subpool (which is kinda crazy, becouse after few hours of application running it creates like 700 subpools). I Tryed searching for possible problems with tag and found out that it uses ConnectionRequestInfo to authenticate connections but so far had no success with configuring that.
Any idea what could i try next to get rid of both problems at once?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/818424#818424]
Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years