[Javassist] New message: "Re: problem adding annotations at runtime"
by suresh inala
User development,
A new message was posted in the thread "problem adding annotations at runtime":
http://community.jboss.org/message/527257#527257
Author : suresh inala
Profile : http://community.jboss.org/people/inalasuresh
Message:
--------------------------------------------------------------
Hi Guys the problem is solved,
the mistake was I’m creating a new instance of AnnotationsAttribute and need to use attr.addAnnotation(annotation); instead of attr.setAnnotation(annotation);
Below code is for getting the annotations and add new annotations.
Changes on Code snipped :
AnnotationsAttribute attr = (AnnotationsAttribute) classFile.getAttribute(AnnotationsAttribute.visibleTag);
Annotation annotation = new Annotation("javax.jws.HandlerChain",constantPool);
if (attr != null) {
annotation.addMemberValue("file", new StringMemberValue("HelloWorldClient_handler.xml", constantPool));
}
//attr.setAnnotation(annotation);
attr.addAnnotation(annotation);
classFile.addAttribute(attr);
classFile.setVersionToJava5();
i Succeed, with the above code,
Thanks & Regards
Suresh
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/527257#527257
16 years, 2 months
[Javassist] New message: "Re: javassist.bytecode.BadBytecode: unset variable. Please Help Me!"
by Arvind K
User development,
A new message was posted in the thread "javassist.bytecode.BadBytecode: unset variable. Please Help Me!":
http://community.jboss.org/message/527250#527250
Author : Arvind K
Profile : http://community.jboss.org/people/megalodon
Message:
--------------------------------------------------------------
prefixmethod() in brief:
protected void prefixMethod(CtMethod myCtM, String methodName) {
try {
StringBuffer tempSB = new StringBuffer(100);
CtField teTLCtF = new CtField(TLocCtC,TETLName,CtC);
CtC.addField(teTLCtF);
myCtM.addLocalVariable(localMIName,MICtC);
Log2File.writeSpl("prefix Method ");
// === PRINTING THE VARIABLE USING TOSTRING() METHOD ===
tempSB.append("System.out.println(\"MI is \" + " + localMIName + ");");
// EXCEPTION IS THROWN BY NEXT LINE IN THE INSERTBEFORE() METHOD
Log2File.writeSpl(tempSB.toString());myCtM.insertBefore(tempSB.toString());tempSB.setLength(0);
// === INITIALIZING THE LOCAL VARIABLE ===
// MIFQ is a String containing a full class path
// localMIName is a String representing the local variable name
tempSB.append("{"+localMIName + " = new " + MIFQ + "(\"" + this.key + "\",\"" + myCtM.getReturnType().getName() + "\");}");
Log2File.writeSpl(tempSB.toString());myCtM.insertBefore(tempSB.toString());tempSB.setLength(0);
} catch (CannotCompileException cce) {
System.out.println("prefixMethod for " + className + " method name " + methodName + " . signature " + myCtM.getSignature() + " Modifiers " + Modifier.toString(myCtM.getModifiers()));
cce.printStackTrace();
Log2File.writeErr(cce,"prefixMethod for " + className);
}
catch (NotFoundException ntfnde) {
System.out.println("prefixMethod for " + className + " method name " + methodName + ". Exception: " + ntfnde);
ntfnde.printStackTrace();
Log2File.writeErr(ntfnde,"prefixMethod for " + className);
}
}
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/527250#527250
16 years, 2 months
[JBoss Microcontainer Development] New message: "Re: Profiling the dependency project"
by Kabir Khan
User development,
A new message was posted in the thread "Profiling the dependency project":
http://community.jboss.org/message/527247#527247
Author : Kabir Khan
Profile : http://community.jboss.org/people/kabir.khan@jboss.com
Message:
--------------------------------------------------------------
Since installCallbacks and uninstallCallbacks are ConcurrentHashMaps, I think the read lock is unnecessary here in AbstractController:
===================================================================
--- src/main/java/org/jboss/dependency/plugins/AbstractController.java (revision 100970)
+++ src/main/java/org/jboss/dependency/plugins/AbstractController.java (working copy)
@@ -1833,17 +1833,9 @@
*/
protected Set<CallbackItem<?>> getCallbacks(Object name, boolean isInstallPhase)
{
- lockRead();
- try
- {
- Map<Object, Set<CallbackItem<?>>> map = (isInstallPhase ? installCallbacks : uninstallCallbacks);
- Set<CallbackItem<?>> callbacks = map.get(name);
- return callbacks != null ? callbacks : Collections.<CallbackItem<?>>emptySet();
- }
- finally
- {
- unlockRead();
- }
+ Map<Object, Set<CallbackItem<?>>> map = (isInstallPhase ? installCallbacks : uninstallCallbacks);
+ Set<CallbackItem<?>> callbacks = map.get(name);
+ return callbacks != null ? callbacks : Collections.<CallbackItem<?>>emptySet();
}
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/527247#527247
16 years, 2 months
[Datasource Configuration] New message: "Re: How to configure Oracle with my application in jboss 5.0"
by Anand Kumar
User development,
A new message was posted in the thread "How to configure Oracle with my application in jboss 5.0":
http://community.jboss.org/message/527246#527246
Author : Anand Kumar
Profile : http://community.jboss.org/people/akstifr
Message:
--------------------------------------------------------------
Here is the Code for database Connection
package beans;
import java.sql.*;
import javax.sql.*;
import javax.naming.*;
public class OracleDatasource {
private Connection con;
public Connection getDbConnection() {
try{
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
DataSource ds = (DataSource)envCtx.lookup("jdbc/datanet);
if (ds == null)
System.out.println("datasource not obtained..");
con= ds.getConnection();
if (con == null)
System.out.println("connection not obtained..");
} catch( NamingException ne ) {
throw new RuntimeException( "Unable to aquire data source", ne );
} catch (SQLException se) {
System.out.println("Exception occured while obtaining connection...");
se.printStackTrace();
}
return con;
}//end getDbConnection()
}//end class
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/527246#527246
16 years, 2 months
[jBPM] New message: "different tasks to multiple users for single processDefinition"
by Anand Kumar
User development,
A new message was posted in the thread "different tasks to multiple users for single processDefinition":
http://community.jboss.org/message/527245#527245
Author : Anand Kumar
Profile : http://community.jboss.org/people/akstifr
Message:
--------------------------------------------------------------
Hi..
How to assign different tasks to multiple users for single processDefinition?
Eg: I have two different users called 1.Admin and 2. User
Where Admin can *Cancel* the processdefinition or *Assign* to other person
and User can *Modify* the processdefintion before assigned by admin or *Cancel* the Process definition which was started by him.
How to provide *Synchronization between different Users* based up on there *Tasks*?
Can anyone provide any sort of help pointers in this problem....and to proceed further
Thanks in Advance
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/527245#527245
16 years, 2 months
[JNDI and Naming] New message: "Getting runtime exception while lookup for datasource"
by Maheshkumar P
User development,
A new message was posted in the thread "Getting runtime exception while lookup for datasource":
http://community.jboss.org/message/527238#527238
Author : Maheshkumar P
Profile : http://community.jboss.org/people/maheshrpm
Message:
--------------------------------------------------------------
Hi,
I am using JBoss5.1.0.GA.
I have configured mysql-ds.xml
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/mySqlDbSource</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/mydb</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>maheshkumar</user-name>
<password>manish</password>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
while deploying my war file i got an exception like
java.lang.RuntimeException: mapped-name is required for jdbc/mySqlDbSource of deployment struts2_sample.war
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/527238#527238
16 years, 2 months
[jBPM] New message: "Executing jbpm processes in Job Executor"
by Tony D
User development,
A new message was posted in the thread "Executing jbpm processes in Job Executor":
http://community.jboss.org/message/527229#527229
Author : Tony D
Profile : http://community.jboss.org/people/tony2010
Message:
--------------------------------------------------------------
Hi,
How can i run a jBPM process through job executor. Currently i am running the jBPM processes by executionService.startProcessInstanceByKey("abc"). This method is called in for loop to it is executing the jBPM processes sequentially. Is there any way i can store this process as job and will be later executed by job executor.
I have read to put about async continuations but i think it will be for activities. I want the Entire process should be executed by jBPM job executor.
I am using jbpm 4.3.
Any help would be highly appreciated.
Thanks.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/527229#527229
16 years, 2 months