[Javassist Development] - adding parameter annotations dynamically
by rpslive
rpslive [https://community.jboss.org/people/rpslive] created the discussion
"adding parameter annotations dynamically"
To view the discussion, visit: https://community.jboss.org/message/821810#821810
--------------------------------------------------------------
how can i add parameter annotations to the parameters of a method?
*Assume the scenario*
public class A(){
public int sum(int a,int b){
return a+b;
}
public int totalsum(int a,int b,int c){
return a+b+c;
}
}
now the name of this class is passed to the method which will dynamically generate a new well annotated class, say dynamic(String className). The new class should appear as:
@Start
public class newA(){
@MethodStart
public int sum(
@Param1(value="1st Parameter")
int a,
@Param2(value="2nd Parameter")
int b
){
return a+b;
}
public int totalsum(
@Param1(value="1st Parameter")
int a,
@Param2(value="2nd Parameter")
int b,
@Param3(value="3rd Parameter")
int c
){
return a+b+c;
}
adding annotation to the start of the methods and class is simple but the trickiest part is adding parameter annotations to the variable no of parameters. i found few users on net discussing a solution to this problem but it didn't seems to be working.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/821810#821810]
Start a new discussion in Javassist Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
10 years, 11 months
[Javassist Development] - invoking a method with the help of object instance from a dynamically generated method using javassist
by rpslive
rpslive [https://community.jboss.org/people/rpslive] created the discussion
"invoking a method with the help of object instance from a dynamically generated method using javassist"
To view the discussion, visit: https://community.jboss.org/message/821808#821808
--------------------------------------------------------------
i want to invoke a method with the help of object instance of the same class from within a method which i m generating dynamically with the help of javassist, i m finding it difficult to implement. A similar method is present with javassist called http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/html/javassist/CtNewMe... delegator
for reference : with the help of delegator we can call the same method with super
int f(int p, int q) {
return super.f(p, q);
}
i wish to generate the method f dynamically and call the base class method f with the help of the object instance of base class which is injected to the dynamically generated class.
int f(int p, int q) {
return objectInstance.f(p, q);
}
i m getting this objectInstance before generating this class and use it to set the field which is also being added dynamically to this class.
*assume the scenario below for better understanding:*
public class A(){
public A(Object B,Object C){//A's constructor}
public int f(int p, int q){
return p+q;
}
}
main(){
C c=new C();
B b=new B();
A a=new A(b,c);
dynamic(a);
}
i want to code dynamic(Object objectInstance) i a way such that the dynamically added class looks like...
public class newA(){
private Object objectInstance;
public void setter(Object obj){
this.objectInstance=obj;
}
public Object getter(){
return this.objectInstance;
}
public int f(int p, int q) {
return objectInstance.f(p, q);
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/821808#821808]
Start a new discussion in Javassist Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
10 years, 11 months
[EJB3 Development] - JBoss 7.1.1 MDB with IBM MQ - MessageDriven Annotation not configurable
by Bharadwaja Dasari
Bharadwaja Dasari [https://community.jboss.org/people/bharadwaja.dasari] created the discussion
"JBoss 7.1.1 MDB with IBM MQ - MessageDriven Annotation not configurable"
To view the discussion, visit: https://community.jboss.org/message/821608#821608
--------------------------------------------------------------
I have implemented MDB with Jboss 7.1.1 using IBM MQ Listener. My Listener Code is below
@MessageDriven(
activationConfig = {
@ActivationConfigProperty(propertyName = "hostName", propertyValue = "111.11.11.11"),
@ActivationConfigProperty(propertyName = "port", propertyValue = "1420"),
@ActivationConfigProperty(propertyName = "channel", propertyValue = "Channel Name"),
@ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "false"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "Name of Destination Queue"),
@ActivationConfigProperty(propertyName = "queueManager", propertyValue = "Queue Manager Name"),
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "50")
})
@ResourceAdapter(value="wmq.jmsra.rar")
All this works perfectly(only change here is I have masked the actuals and replaced it with dummies in property values) but the problem is this is all hardcoded. I want it to be configurable, like say if I am in one environment, I want to pick it from properties files for that particular environment
OR if I use the command to start ./standalone -c standalone-full-xyz.xml, and this standalone-full-xyz.xml should have all the config properties for that environment, so atleast that will help make it configurable
How can I acheive this? Any help.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/821608#821608]
Start a new discussion in EJB3 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
10 years, 11 months
[JBoss AS 7 Development] - Problem of configuring SSL for Https in Jboss AS 7
by kishore routhu
kishore routhu [https://community.jboss.org/people/kishorerouthu] created the discussion
"Problem of configuring SSL for Https in Jboss AS 7"
To view the discussion, visit: https://community.jboss.org/message/821464#821464
--------------------------------------------------------------
Actually we are migrating from Jboss-4.2.2GA to Jboss As7 it is good to work
with Jboss As7 but the problem is that in Jboss-4.2.2GA the SSL is enabled
and working fine for HTTPS with port 8443 for given following configuration (1)
in Server.xml.
1. SSL Configuration for Https Secure port in *Jboss-4.2.2 GA*
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="250" scheme="https" secure="true"
clientAuth="false"
strategy="ms"
address="${jboss.bind.address}"
* keystoreFile="${jboss.server.home.dir}/conf/ssl/2013-cert/working/server.keystore"*
keystorePass="123456"
keystoreType="pkcs12"
sslProtocol="TLS"
SSLHonorCipherOrder="On"
ciphers="SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_RC4_128_SHA"
/>
Where as in *Jboss AS7* with given following configuration (2) in Standalone.xml when
start up jboss it throws the following error observed in server.log
2. SSL Configuration for Https Secure port in Jboss As7
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host">
<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" redirect-port="8443" secure="true" max-connections="400">
<ssl name="ssl" password="123456"
* certificate-key-file="/www/jboss7/standalone/configuration/ssl/ssl.domainname.crt"*
cipher-suite="SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_RC4_128_SHA" protocol="TLSv1" verify-client="false"
verify-depth="10"
keystore-type="PKCS12"
truststore-type="PKCS12"/>
</connector>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
<alias name="vela"/>
</virtual-server>
</subsystem>
RROR [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-2) Error initializing endpoint: java.lang.Exception: Unable to configure permitted SSL ciphers (error:1410D0B9:SSL routines:SSL_CTX_set_cipher_list:no cipher match)
at org.apache.tomcat.jni.SSLContext.setCipherSuite(Native Method) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:642) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:121) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.Connector.init(Connector.java:983) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:267) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_13]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_13]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]
07:00:50,361 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.web.connector.https: org.jboss.msc.service.StartException in service jboss.web.connector.https: JBAS018007: Error starting web connector
at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:271)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_13]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_13]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]
Caused by: LifecycleException: Protocol handler initialization failed: java.lang.Exception: Unable to configure permitted SSL ciphers (error:1410D0B9:SSL routines:SSL_CTX_set_cipher_list:no cipher match)
at org.apache.catalina.connector.Connector.init(Connector.java:985)
at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:267)
... 5 more
Following is KeyStore information
====================================
> keytool -v -list -storetype PKCS12 -keystore server.keystore
Enter keystore password:
Keystore type: PKCS12
Keystore provider: SunJSSE
Your keystore contains 1 entry
Alias name: 1
Creation date: Jun 5, 2013
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Do i need any changes in configuration of Jboss AS7 to Successfully enable SSL in as compared to Jboss 4.2.2GA ?
what "keystoreFile" element in Jboss 4.2.2GA configuration represents and
what "certificate-key-file" element in Jboss AS7 configuration represents
These two represents same (i.e keystore) or different ?
Please suggest me for the above so that can move further.
Thank you in advance
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/821464#821464]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
10 years, 11 months
[JBoss AS 7 Development] - BMP entity from jboss5 to jboss7.1
by Ale S
Ale S [https://community.jboss.org/people/a.salina] created the discussion
"BMP entity from jboss5 to jboss7.1"
To view the discussion, visit: https://community.jboss.org/message/734732#734732
--------------------------------------------------------------
Hi,
i'm trying to migrate an application from jboss 5 to version 7.1.
In my application there is a 2.1 version BMP entity...
i've searched throught the documentation but i cannot find how to migrate this portion of configuration...
in my jboss.xml (jboss 5) i have :
...
...
<container-configurations>
<container-configuration extends="Standard BMP EntityBean">
<container-name>Clustered Legacy Locked BMP EntityBean</container-name>
<instance-cache>org.jboss.ejb.plugins.PerTxEntityInstanceCache</instance-cache>
<locking-policy>org.jboss.ejb.plugins.lock.NoLock</locking-policy>
<commit-option>B</commit-option>
</container-configuration>
</container-configurations>
...
...
Any suggestions? how could i configure jboss7.1 so that it behaves as in JBoss 5.
Thanks,
Ale
p.s.: sorry for my english...
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/734732#734732]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
10 years, 11 months