Over a million developers have joined DZone.

Deploying the JEE6 Archetype

· Java Zone

Easily build powerful user management, authentication, and authorization into your web and mobile applications. Download this Forrester report on the new landscape of Customer Identity and Access Management, brought to you in partnership with Stormpath.

Well, the good news is it is possible to get the new Weld archetype to work. The bad news is, the process, at least to me, is a treatise on why the Balkanized Java ‘platform‘ is actually like a schizoid portrait in madness. And it‘s nobody‘s fault. I am deeply impressed by all the great stuff that the Red Hat team has pumped out in the past 5–6 years, but it‘s not enough. Why? Read on. Maybe it is enough for you.



Here‘s the simple recap:

  1. Generated the project.
  2. Tried to deploy on Glassfish and got spurious error, found out the logger classnotfounds were the real problem.
  3. Commented out the solder dependency and was able to get to the Hello World screen.

That was where I was as of the last post.

Then,

  1. Went back and could not believe I got the logger errors again.
  2. Double, triple checked that the solder dep was commented out in the pom.
  3. That there were no imports of the loggers.
  4. Did clean
  5. Removed and readded the app
  6. Restarted eclipse
  7. (Yeah does remind you of Windoze doesn‘t it?)
  8. Gave up on that.

Choices were:

  1. Go back to 3.0 and the original project.
  2. Go make an empty project and add the JEE6 dependencies.
  3. Try JBoss 6.

I opted for #3. Then:

  1. Downloaded JBoss-6.0.0.Final.
  2. Dropped in /usr/local, made a softlink to /usr/local/jboss6.
  3. Installed the JBoss Tools.
  4. Added it in the Servers view.
  5. Generated a new project from the archetype.
  6. Went to deploy.
  7. Got an error: data source was not found (JNDI).
  8. Read the readme a whole bunch of times. Found some disturbing things: a. it is written to have you deploy from the command line and b. it kept mentioning the need to deploy the default-ds.xml file. Who deploys resources files?

Then suddenly, the light came on: I am getting an error because of the heinous m2Eclipse nonsense about adding the filter on the resource files. Sure enough, there they were, then I went to deploy again (inside eclipse) and it didn‘t work, but for a new reason: the logger! Again! It was saying that the injection was ambiguous. OMG.

I gave up on that and went to the command line and got it to deploy. So the redux: gotta use JBoss and from the command line. Is that where I want to be after 15 years? Um, no. Sorry. Go ahead and flame me now for saying so.

 

From http://www.jroller.com/robwilliams/entry/deploying_the_jee6_archetype

The Java Zone is brought to you by Stormpath—a complete, pre-built User Management API. Want to learn how to use JWTs to protect microservices from CSRF and more? Check out this on-demand webinar with our Java Developer Evangelist, Micah Silverman.

Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}