martes, 3 de noviembre de 2015

Trying "Continuous Enterprise Development in Java" using Forge 2

Book: Continuous Enterprise Development in Java - Testable Solutions with Arquillian (1st Edition)

Environment:
  • JBoss Developer Studio 9.0.0.GA (Forge 2.19.2.Final - embedded)
Commands:

Forge 1: set ACCEPT_DEFAULTS true;
Forge 2: ?

Forge 1: new-project --named feedback --topLevelPackage org.x --projectFolder feedback;
Forge 2: project-new --named feedback --topLevelPackage org.x;

Forge 1: persistence setup --provider HIBERNATE --container JBOSS_AS7;
Forge 2: jpa-setup --provider Hibernate --container JBOSS_AS7;

Forge 1: validation setup --provider HIBERNATE_VALIDATOR
Forge 2: (automatically done on first constraint-add?)

Forge 1: entity --named FeedbackEntry;
Forge 2: jpa-new-entity --named X;

Forge 1: field string --named x;
Forge 2: jpa-new-field --type String --named x;

Forge 1: constraint NotNull --onProperty x;
Forge 2: constraint-add --constraint NotNull --onProperty x;

Forge 1: scaffold setup
Forge 2: scaffold-setup

Forge 1: scaffold from-entity org.x.*;
Forge 2: scaffold-generate --targets org.x.*;

Forge 1: forge install-plugin arquillian
Forge 2: addon-install-from-git --url https://github.com/forge/addon-arquillian.git --coordinate org.arquillian.forge:arquillian-addon (from here)

Forge 1: arquillian setup --containerType REMOTE --containerName JBOSS_AS_REMOTE_7.X --testframework
Forge 2: arquillian-setup (the command only accept two parameters: arquillianVersion and testFramework; the rest of information will be prompted in interactive mode) (Forge commands are contextual, so remember to cd to your app root or other convenient place to execute arquillian-setup; otherwise you may get "Command: arquillian-setup was not found")


Forge 1: arquillian create-test --class org.x.X.java
Forge 2: arquillian-create-test --targets org.x.X 

Forge 1: build --notest --profile arq-jboss_as_remote_7.x;
Forge 2: build --notest --profile arquillian-jbossas-remote-7; (build --profile doesn't support tab completions...neither build itself?)

Forge 1: forge install-plugin jboss-as-7
Forge 2: (from here)
  • addon-install-from-git --url https://github.com/forge/as-addon  --coordinate org.jboss.forge.addon:as
  • addon-install-from-git --url https://github.com/forge/jboss-as-addon  --coordinate org.jboss.forge.addon:jboss-as-as7

When I executed the last commands from the JBDS' Forge, I got the following error:

***ERROR*** Addon org.jboss.forge.addon:as,2.0.0-SNAPSHOT could not be installed: zip file closed

I had also a standalone Forge 2 (2.20.0.Final) installation. I ran the commands from there and the installation was succesful; the addons installed through that shell now appear in the addon-list of the JBDS' Forge:
  • org.jboss.forge.addon:as,2.0.0-SNAPSHOT
  • org.jboss.forge.addon:jboss-as-as7,2.0.0-SNAPSHOT
Forge 1: as7 setup
Forge 2: as-setup --server jbossas7

Forge 1: as7 start --jboss-home target/jboss-as-dist/jboss-as-7.1.1.Final/
Forge 2: as-start

JBoss Developer Studio 9.0.0.GA runs on Java 8 but JBoss AS 7 doesn't (needs Java 7). What happened to me was that JBoss AS 7 never started; it just hanged in the boot process, causing Forge to report an error after 90 seconds:

[jbds]$ cd feedback\
[feedback]$ as-start 
08:44:21,383 INFORMACIÓN [org.jboss.modules] JBoss Modules version 1.1.1.GA
08:44:21,586 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
08:44:21,649 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
***ERROR*** JBoss Application Server 7.1.1.Final has failed to start. Error: Managed server was not started within [90] s
[feedback]$ 

What I did was to create a batch script to set JAVA_HOME to a JDK 7 before launching jbdevstudio.exe:


This way, JBDS continues using Java 8:


But AS 7 starts with Java 7:


(Tool: MS Process Explorer)





Tips:

  • If JBDS begins starting without asking for workspace (just using a default workspace), you can use jbdevstudio.exe -clean to force it to start asking for workspace each time.






sábado, 19 de septiembre de 2015

MS wsdl.exe: Cannot find definition for...Parameter name: name

Are you trying to generate a CS proxy for a WSDL which maybe imports another WSDL which in turn maybe imports a XML Schema and so on? (e.g. MyServiceConcrete.wsdl -> MyServiceAbstract.wsdl -> MyServiceSchema.xsd).

I come from the Java world, so the natural way for me would be:

wsdl.exe MyServiceConcrete.wsdl

But...crash

Microsoft (R) Web Services Description Language Utility
Microsoft (R) .NET Framework, Version ...]
Copyright (C) Microsoft Corporation. All rights reserved.
Error: Cannot find definition for ... EndpointInterface.  Service Description with namespace ... is missing.
Parameter name: name
  
If you would like more help, please type "wsdl /?".

And for example, Java's wsimport works like a charm:

wsimport.exe MyServiceConcrete.wsdl

The problem is wsdl.exe doesn't resolve import's (neither xsd.exe)

So just feed wsdl.exe with all the required dependencies (WSDLs, XSDs...).

wsimport.exe MyServiceConcrete.wsdl MyServiceAbstract.wsdl MyServiceSchema.xsd

In the above example, all files have to be in the same directory.

Profit.





jueves, 17 de septiembre de 2015

IIB: "Unsupported Method: GET" for WSDL even if "Enable support for ?wsdl" is true

Are you trying to get the WSDL for your service using the traditional http://server:port/path/to/service?wsdl, making sure that you checked the "Enable support for ?wsdl" option and get just a plain "Unsupported Method: GET.message?


Look again your "Path suffix for URL" and check if it has the leading slash (/)



:)

viernes, 5 de junio de 2015

Error parsing web-jsptaglib_1_1.dtd deploying Struts 1.3 app to JBoss 6.x

I got the following error trying to deploy a Maven Struts app to JBoss 6.x.

ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Parse: name=vfs:///D:/workspace/xxx/xxx/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_AS_6.x1433531832165/deploy/xxx.ear state=PreParse mode=Manual requiredState=Parse: org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfs:///D:/workspace/tigo/conciliaciones/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_AS_6.x1433531832165/deploy/xxx-ear.ear/xxx-web-1.0.0-SNAPSHOT.war/
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.2.GA]
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:383) [:2.2.2.GA]
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:343) [:2.2.2.GA]
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:315) [:2.2.2.GA]
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:255) [:2.2.2.GA]
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.2.GA]
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.2.GA]
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.2.GA]
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) [:2.2.2.GA]
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.2.GA]
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.2.GA]
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.2.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.2.GA]
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.1.0.Final]
at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]
at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.SP2]
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]
at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]
at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]
at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]
at org.jboss.profileservice.AbstractProfileService.activateProfile(AbstractProfileService.java:154) [:0.2.2]
at org.jboss.system.tools.ProfileServiceToolsFacade.addURI(ProfileServiceToolsFacade.java:233) [:6.1.0.Final]
at org.jboss.system.tools.LegacyDeploymentScannerAdapter.addURL(LegacyDeploymentScannerAdapter.java:140) [:6.1.0.Final]
at org.jboss.system.tools.DeploymentScanner.addURL(DeploymentScanner.java:91) [:6.1.0.Final]
at org.jboss.system.tools.DeploymentScanner.addURL(DeploymentScanner.java:83) [:6.1.0.Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_45]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_45]
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) [:6.0.0.GA]
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) [:6.0.0.GA]
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) [:6.0.0.GA]
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271) [:6.0.0.GA]
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670) [:6.0.0.GA]
at org.jboss.system.server.jmx.MBeanServerWrapper.invoke(MBeanServerWrapper.java:138) [:6.1.0.Final]
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1454) [:1.6.0_45]
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:74) [:1.6.0_45]
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1295) [:1.6.0_45]
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1387) [:1.6.0_45]
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:818) [:1.6.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_45]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_45]
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303) [:1.6.0_45]
at sun.rmi.transport.Transport$1.run(Transport.java:159) [:1.6.0_45]
at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_45]
at sun.rmi.transport.Transport.serviceCall(Transport.java:155) [:1.6.0_45]
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) [:1.6.0_45]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) [:1.6.0_45]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) [:1.6.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [:1.6.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [:1.6.0_45]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_45]
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: http://java.sun.com/j2ee/dtds/web-jsptaglib_1_1.dtd@1,3
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:224) [jbossxb.jar:2.0.3.GA]
at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:178) [jbossxb.jar:2.0.3.GA]
at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:257) [jbossxb.jar:2.0.3.GA]
at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:231) [jbossxb.jar:2.0.3.GA]
at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:137) [:2.2.2.GA]
at org.jboss.deployment.TldParsingDeployer.parse(TldParsingDeployer.java:64) [:6.1.0.Final]
at org.jboss.deployment.TldParsingDeployer.parse(TldParsingDeployer.java:38) [:6.1.0.Final]
at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:121) [:2.2.2.GA]
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.handleMultipleFiles(AbstractVFSParsingDeployer.java:446) [:2.2.2.GA]
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:319) [:2.2.2.GA]
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:376) [:2.2.2.GA]
... 74 more
Caused by: org.xml.sax.SAXException: The markup declarations contained or pointed to by the document type declaration must be well-formed. @ http://java.sun.com/j2ee/dtds/web-jsptaglib_1_1.dtd[1,3]
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.fatalError(SaxJBossXBParser.java:421) [jbossxb.jar:2.0.3.GA]
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.apache.xerces.impl.XMLDTDScannerImpl.scanDecls(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.apache.xerces.impl.XMLDTDScannerImpl.scanDTDExternalSubset(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) [xercesImpl.jar:6.1.0.Final]
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:209) [jbossxb.jar:2.0.3.GA]
... 84 more


I found the reference to http://java.sun.com/j2ee/dtds/web-jsptaglib_1_1.dtd@1,3 in bsf-2.3.0.jar (META-INF/taglib.tld). This jar was ending up in WEB-INF/lib due to a dependency to struts-scripting in the Web module's POM. I was sure the developers wasn't really using struts-scripting so I removed the dependency and the app deployed fine.

As additional information, the taglib reference is http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd, not  http://java.sun.com/j2ee/dtds/web-jsptaglib_1_1.dtd.


lunes, 2 de marzo de 2015

Windows 7 ODBC trace doesn't create log file (IBM Integration Bus 9, IIB)

If you followed the steps in ODBC trace for WebSphere Message Broker or IBM Integration Bus to turn on ODBC Trace in Windows and didn't find a trace file created in the path you specified, look for an sql.log file in C:\Windows\Temp. Windows may be ignoring your path (it was my case).

Source: ODBC Tracing on Windows Creates No File or Empty File