[Design of JBoss Build System] - Re: JBossRetro cannot replace final reference to StringBuild
by kfinkels
sorry for the late response. I was not able to log into the forum for weeks.
here is the byte code for the following source code:
source code:
button.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
StringBuilder builder = new StringBuilder();
builder.append("Hello");
label = new JLabel(builder.toString());
frame.add(label);
}
});
bytecode after running with jboss-retro:
public void actionPerformed(java.awt.event.ActionEvent e);
0 new org.jboss.lang.[img]JBossStringBuilder [/img][23]
3 dup
4 invokespecial org.jboss.lang.JBossStringBuilder() [25]
7 astore_2 [builder]
8 aload_2 [builder]
9 ldc <String "Hello"> [26]
11 invokevirtual org.jboss.lang.JBossStringBuilder.append(java.lang.String) : org.jboss.lang.JBossStringBuilder [28]
14 pop
15 aload_0 [this]
16 getfield demoAOP.HelloMainFrame$1.this$0 : demoAOP.HelloMainFrame [12]
19 new javax.swing.JLabel [32]
22 dup
23 aload_2 [builder]
24 invokevirtual org.jboss.lang.JBossStringBuilder.toString() : java.lang.String [34]
27 invokespecial javax.swing.JLabel(java.lang.String) [38]
30 invokestatic demoAOP.HelloMainFrame.access$0(demoAOP.HelloMainFrame, javax.swing.JLabel) : void [41]
33 aload_0 [this]
34 getfield demoAOP.HelloMainFrame$1.this$0 : demoAOP.HelloMainFrame [12]
37 invokestatic demoAOP.HelloMainFrame.access$1(demoAOP.HelloMainFrame) : javax.swing.JFrame [47]
40 aload_0 [this]
41 getfield demoAOP.HelloMainFrame$1.this$0 : demoAOP.HelloMainFrame [12]
44 invokestatic demoAOP.HelloMainFrame.access$2(demoAOP.HelloMainFrame) : javax.swing.JLabel [51]
47 invokevirtual javax.swing.JFrame.add(java.awt.Component) : java.awt.Component [55]
50 pop
51 return
Line numbers:
[pc: 0, line: 31]
[pc: 8, line: 32]
[pc: 15, line: 33]
[pc: 33, line: 34]
[pc: 51, line: 35]
Local variable table:
[pc: 0, pc: 52] local: this index: 0 type: new demoAOP.HelloMainFrame(){}
[pc: 0, pc: 52] local: e index: 1 type: java.awt.event.ActionEvent
[pc: 8, pc: 52] local: builder index: 2 type: java.lang.StringBuilder
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230982#4230982
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230982
16 years, 11 months
[Design of Management Features on JBoss] - trying to get ManagedComponent removal/deletion working
by ips
I am trying to re-enable the ManagedComponent deletion code in the AS4 Jopr plugin, calling redeploy() on the parent deployment after
DeploymentManager deploymentManager = getConnection().getDeploymentManager();
| /*if (!deploymentManager.isRedeploySupported())
| throw new UnsupportedOperationException("Deletion of " + getResourceContext().getResourceType().getName()
| + " Resources is not currently supported.");*/
| ManagedComponent managedComponent = getManagedComponent();
| log.debug("Removing " + getResourceDescription() + " with component " + toString(managedComponent) + "...");
| ManagementView managementView = getConnection().getManagementView();
| managementView.removeComponent(managedComponent);
| managementView.load();
| ManagedDeployment parentDeployment = managedComponent.getDeployment();
| log.debug("Redeploying parent deployment '" + parentDeployment.getName()
| + "' in order to complete removal of component " + toString(managedComponent) + "...");
| DeploymentProgress progress = deploymentManager.redeploy(parentDeployment.getName());
| DeploymentUtils.run(progress);
Unfortunately, the redeploy call results in the following exception:
22:23:50,921 DEBUG [ManagedComponentComponent] Removing ResourceType[id=0, category=Service, name=Local Tx Datasource, p
| lugin=JBossAS5] Resource with key [DataSource:LocalTx:MyOracleLocalTxDS] with component TempManagedComponentImpl@2476216
| 9[type=ComponentType{type=DataSource, subtype=LocalTx}, name=MyOracleLocalTxDS, properties=HashMap@5739137]...
| 22:23:51,030 DEBUG [ManagedComponentComponent] Redeploying parent deployment 'vfsfile:/C:/opt/jboss-5.1.0.GA-SNAPSHOT/se
| rver/default/deploy/MyOracleLocalTxDS-ds.xml' in order to complete removal of component TempManagedComponentImpl@2476216
| 9[type=ComponentType{type=DataSource, subtype=LocalTx}, name=MyOracleLocalTxDS, properties=HashMap@5739137]...
| 22:23:51,108 INFO [DeployHandler] Stop, [vfsfile:/C:/opt/jboss-5.1.0.GA-SNAPSHOT/server/default/deploy/MyOracleLocalTxD
| S-ds.xml]
| 22:23:51,155 INFO [ConnectionFactoryBindingService] Unbound ConnectionManager 'jboss.jca:service=DataSourceBinding,name
| =MyOracleLocalTxDS' from JNDI name 'MyOracleLocalTxDS'
| 22:23:51,187 INFO [DeployHandler] End stop, [vfsfile:/C:/opt/jboss-5.1.0.GA-SNAPSHOT/server/default/deploy/MyOracleLoca
| lTxDS-ds.xml]
| 22:23:51,187 INFO [DeployHandler] Begin start, [vfsfile:/C:/opt/jboss-5.1.0.GA-SNAPSHOT/server/default/deploy/MyOracleL
| ocalTxDS-ds.xml]
| 22:23:51,265 ERROR [AbstractKernelController] Error installing to PreReal: name=vfsfile:/C:/opt/jboss-5.1.0.GA-SNAPSHOT/
| server/default/deploy/MyOracleLocalTxDS-ds.xml state=PostClassLoader mode=Manual requiredState=PreReal
| org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/C:/opt/jboss-5.1.0.GA-SNAPSHOT/server/default
| /deploy/MyOracleLocalTxDS-ds.xml
| at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
| at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
| at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.start(AbstractDeployHandler.java:26
| 2)
| at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.redeploy(AbstractDeployHandler.java
| :349)
| at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.invoke(AbstractDeployHandler.java:1
| 94)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
| at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)
| at org.jboss.remoting.Client.invoke(Client.java:1724)
| at org.jboss.remoting.Client.invoke(Client.java:629)
| at org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget.invoke(StreamingDeploymentTarge
| t.java:305)
| at org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget.redeploy(StreamingDeploymentTar
| get.java:146)
| at org.jboss.profileservice.management.upload.DeploymentProgressImpl.redeploy(DeploymentProgressImpl.java:366)
| at org.jboss.profileservice.management.upload.DeploymentProgressImpl.run(DeploymentProgressImpl.java:97)
| at org.rhq.plugins.jbossas5.util.DeploymentUtils.run(DeploymentUtils.java:93)
| at org.rhq.plugins.jbossas5.ManagedComponentComponent.deleteResource(ManagedComponentComponent.java:125)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:480)
| at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
| at java.util.concurrent.FutureTask.run(FutureTask.java:138)
| 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:619)
| Caused by: java.lang.RuntimeException: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to resolve
| schema nsURI= location=root
| at org.jboss.system.server.profileservice.attachments.LazyPredeterminedManagedObjects.loadAttachment(LazyPredete
| rminedManagedObjects.java:198)
| at org.jboss.system.server.profileservice.attachments.LazyPredeterminedManagedObjects.getAttachment(LazyPredeter
| minedManagedObjects.java:131)
| at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.getAttachment(AbstractDeploymentUnit.java:35
| 6)
| at org.jboss.system.server.profileservice.persistence.deployer.ProfileServicePersistenceDeployer.internalDeploy(
| ProfileServicePersistenceDeployer.java:79)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
| ... 36 more
| Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to resolve schema nsURI= location=root
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:183)
| at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:161)
| at org.jboss.system.server.profileservice.repository.JAXBAttachmentSerializer.loadAttachment(JAXBAttachmentSeria
| lizer.java:83)
| at org.jboss.system.server.profileservice.repository.AbstractFileAttachmentsSerializer.loadAttachment(AbstractFi
| leAttachmentsSerializer.java:71)
| at org.jboss.system.server.profileservice.attachments.LazyPredeterminedManagedObjects.loadAttachment(LazyPredete
| rminedManagedObjects.java:194)
| ... 41 more
| Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to resolve schema nsURI= location=root
| at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:281)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:
| 401)
| at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
| at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
| at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
| at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:199)
| ... 46 more
| 22:23:51,296 INFO [DeployHandler] Failed to complete command: [redeploy] for deployment: names=[vfsfile:/C:/opt/jboss-5
| .1.0.GA-SNAPSHOT/server/default/deploy/MyOracleLocalTxDS-ds.xml], copyContent=true
| org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR
| DETAILS):
|
| *** DEPLOYMENTS IN ERROR: Name -> Error
|
| vfsfile:/C:/opt/jboss-5.1.0.GA-SNAPSHOT/server/default/deploy/MyOracleLocalTxDS-ds.xml -> org.jboss.deployers.spi.Deploy
| mentException: Error during deploy: vfsfile:/C:/opt/jboss-5.1.0.GA-SNAPSHOT/server/default/deploy/MyOracleLocalTxDS-ds.x
| ml
|
|
| DEPLOYMENTS IN ERROR:
| Deployment "vfsfile:/C:/opt/jboss-5.1.0.GA-SNAPSHOT/server/default/deploy/MyOracleLocalTxDS-ds.xml" is in error due to
| the following reason(s): org.jboss.xb.binding.JBossXBRuntimeException: Failed to resolve schema nsURI= location=root
|
| at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
| at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:
| 128)
| at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.start(AbstractDeployHandler.java:26
| 4)
| at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.redeploy(AbstractDeployHandler.java
| :349)
| at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.invoke(AbstractDeployHandler.java:1
| 94)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
| at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)
| at org.jboss.remoting.Client.invoke(Client.java:1724)
| at org.jboss.remoting.Client.invoke(Client.java:629)
| at org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget.invoke(StreamingDeploymentTarge
| t.java:305)
| at org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget.redeploy(StreamingDeploymentTar
| get.java:146)
| at org.jboss.profileservice.management.upload.DeploymentProgressImpl.redeploy(DeploymentProgressImpl.java:366)
| at org.jboss.profileservice.management.upload.DeploymentProgressImpl.run(DeploymentProgressImpl.java:97)
| at org.rhq.plugins.jbossas5.util.DeploymentUtils.run(DeploymentUtils.java:93)
| at org.rhq.plugins.jbossas5.ManagedComponentComponent.deleteResource(ManagedComponentComponent.java:125)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:480)
| at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
| at java.util.concurrent.FutureTask.run(FutureTask.java:138)
| 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:619)
Also, I had to comment out the deploymentManager.isRedeploySupported() check, because it was returning false. Shouldn't that be returning true? Or perhaps it is returning false to protect me from the exception above :-)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230970#4230970
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230970
16 years, 11 months
[Design the new POJO MicroContainer] - Re: MC tools
by alesj
"flavia.rainone(a)jboss.com" wrote :
| Should the migration tool generate a beans.xml file that declares every MBean just as a POJO, without injecting the @JMX annotation?
| If yes, how exactly are we dealing with those MBeans? For example, suppose that I use the migration tool to migrate my MBean X to a MC bean. But suppose that another MBean Y, deployed at the MBeanServer, has an attribute that is initialized with the name of old MBean X, and it uses this property internally to look up for X in the MBeanServer. Now that I'm not deploying X as an MBean anymore, Y is hence broken. How do we deal with that?
I would do it like this.
Ask if all beans should get @JMX:
(a) yes, all
(b) none
(c) prompt for every mbean
If (b) is used then the new bean name is previous mbean name.
For (a) and (c) I would make a plugable mechanism.
e.g. -Dname_transformer=org.jboss.mc.tools.naming.UseServiceProperty
Where this naming class would know how to create a new bean name from the old mbean name.
Or it could force a prompt, while already suggesting some name.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230946#4230946
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230946
16 years, 11 months
[Design the new POJO MicroContainer] - Re: MC tools
by flavia.rainone@jboss.com
"alesj" wrote : Just yesterday I was thinking of needing nice MC tool(s)
| to help me with some migration, optimization.
|
| So, the idea is next (all cmd line tools):
| (1) help migrate -service.xml --> -beans.xml
| * single file, ant patterns
| * warn on non portable elements (perhaps being able to type in the fix/change
|
I'm doing some investigation to implement this tool.
"alesj" wrote :
| Both tools should come pretty much in-handy with JBoss6.
| (1) moving all those mbeans to mc pojos
|
Should the migration tool generate a beans.xml file that declares every MBean just as a POJO, without injecting the @JMX annotation?
If yes, how exactly are we dealing with those MBeans? For example, suppose that I use the migration tool to migrate my MBean X to a MC bean. But suppose that another MBean Y, deployed at the MBeanServer, has an attribute that is initialized with the name of old MBean X, and it uses this property internally to look up for X in the MBeanServer. Now that I'm not deploying X as an MBean anymore, Y is hence broken. How do we deal with that?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230944#4230944
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230944
16 years, 11 months