Maven workspace resolution missing jars for local Tomcat testing - m2eclipse

I have a mavenized project with dependencies upon 4 others mavenized projects that my team is currently working on. We have "workspace resolution" enabled.
If I publish to Tomcat, jars are not available for the 4 projects so I see all sorts of NoClassDefFoundError exceptions.
I don't see any problems with JUnit testing or packaging. (I run the package goal and the resulting war file includes the SNAPSHOT jars that I expect.)
I see a lot of people advocating for using workspace resolution, but if we need to test in Tomcat should we disable this? Or what else might I be missing?
We use Eclipse Helios, the m2eclipse plugin, Maven 3.0.3. I even installed m2extras to see if that helped, but I didn't see any difference.
Thanks

You can get this setup to work (we have been working with the same toolchain and setup here) if you can live with some manual refreshes, after you have been using m2eclipse goals to build.
The problem is, that not all external changes via m2eclipse builds to workspace projects are synched correctly to your deployed web application in tomcat.
So if you are experiencing NoClassDefFoundError exceptions after building via m2eclipse the following should help (not all are necessary everytime):
Do a Project/Clean on your maven projects
Do a Refresh (F5) on your maven projects
Clean the deployed web application (Server Context menu)
Yes, it is cumbersome but one can live with it.

Remove the dependency project from the workspace.
Delete .settings directory and .project files.
Import the project again.
Update maven dependencies in all projects.

Related

Why are my gradle dependencies in Android Studio not being cached?

I downloaded Google's Android Sceneform example project, solarsystem, under the samples folder in the hyperlink. I intend to use it as a base for an AR Application I need to create. However, I need to take the project to an offline environment.
While I am connected to the internet, the project builds without issue. However, when I go offline, I end up with a
No cached version of com.android.tools.build:aapt2:3.4.1-5326820 available for offline mode.
I have no problem syncing the project, but I am unable to build anything. I have tried downloading the appt2 dependency from Google's Maven Repository directly and including it in my project's dependencies in the build.gradle folder but I still get the same error. My project MUST be built offline.
I have also searched online for a few solutions, but none have worked for me so far. I found out that Google did remove the version of aapt2 that I am using, but I was still able to download it from their repository. As I understand, Android should be able to build my project so long as the dependencies have been cached. I am just trying to identify the problem at this point. Why has this one dependency not been cached and why despite including it's jar directly have I not been able to run it?

Upgrading Liferay 6.2 maven plugins into Liferay 7 module

There are many sites which provides articles for upgrading liferay 6.2 to dxp but only for ant project. How can we upgrade liferay 6.2 maven project to liferay dxp gradle project ?
The strategy to upgrade your code is exactly the same. Liferay's Plugins SDK defaulted to Ant until 6.2, now you have the choice between liferay-workspace (gradle based), gradle and maven - just choose the build environment you'd like (sounds like you'd like to continue with maven) and add your code to an empty blueprint for the project of your choice.
There's an upgrade tool in Liferay IDE that might help you - even if it doesn't use the build tool of your choice or if eclipse isn't the IDE of your choice: The upgrade tool is a one-off tool to use during upgrade. No matter what the result is on: You can always check (for example) Liferay's blade-sample project to find the proper build descriptors for Maven - and adapt them to your project.
Edit: After the clarification: Your main task is still the upgrade of the code. As of moving from Maven to gradle: Identify the dependencies and translate from pom.xml syntax to gradle's declaration - the contents are similar (e.g. group, name, version), only how you're writing them down is different. If you have made elaborate custom modifications to your pom.xml try to go without them first. You can start with a stock build.gradle (e.g. from blade-samples that most closely match your project) and then fix compile-time dependencies as you go.
I'm not aware of an automated process that does this translation for you (and most likely you'd bump up a few version numbers in the process anyway)

Jhipster does not run in eclipse using run as spring boot application

When I am using runAs inside eclipse I am always getting this error.
Error: Could not find or load main class com.xx.api.Application
How to fix this ?
It depends on your version of Eclipse, on what you have installed, on how you configured everything...
What you can do:
Install Spring Tool Suite : it's an Eclipse version with everything already set up, so you can get started quickly
Use JHipster's new Vagrant devbox which will give you a virtualized environment with everything pre-configured for you
Thanks for looking into this. I am using Spring Tool Suite. I am trying to use gradle eclipse plugin. This is where i was getting errors.
When i switched to import project as gradle project It started working. However I have generated DTO using the jhipster-uml.
This generate the mapper classes in build folder by default. Now when i run the application, It fails to find mapper classes.
I am able to make is work by generating the mapper classes into my source folder for now.
Thanks for help.

create azure package with build

I was just upgrading my project from sdk 1.3 to 1.7 and I noticed that now when I build the application the package(cspkg) is not created with the build. I have go click on publish to create a package. Is there a way to tell VS to create a package everytime a build is triggered.
Also using msbuild is there a way to do the same thing. I have multiple projects under a solution, Most of which are just libraries and then there is this azure app. Is there a way to specify a single msbuild statement with params to tell the azure app to create the package as well as build the other projects. Also when I specify debug the debug package should be created and when I specify release switch the release package should be created.
How could I do the same thing on my build server as well where I have a .proj file which specifies the sln to build. How could I mention a switch to build the package there.
Thanks,
Kunal
You can configure CSPACK command (Be sure to have CSPACK.exe launched from SDK 1.7 Path otherwise you will get some schema related errors with SDK 1.6 project) as Post Build event in your Windows Azure Application Build settings. This way when you will build, after successful build CSPACK command will run and package your application. Same way you can configure your MSBuild configuration. I just tested and it worked for me.
Visit this MSDN article on packaging a cloud service to learn more.
You can do this using msbuild as well. See the Resolution section of this question.

Problems creating a Java Mobile Application project

I have installed the Netbeans 6.7 IDE with Java ME included, but cannot create a Mobile Application project from the Java ME category. When I select the project type the wizard stops at "Finding Feature" with the message:
Not all requested modules can be enabled:
[StandardModule:org.netbeans.modules.mobility.end2end.kig jarFile:C:\Program Files\NetBeans 6.7\mobility8\modules\org-netbeans-modules-mobility-end2end-kit.jar.
I am attempting to run this on Vista Home Premium. I have tried to run the IDE as Administrator with no luck.
I am at a loss for where to go next as I cannot seem to find any information regarding this issue. Even if you don't have the solution any insight into this error message would be helpful.
I am unable so far to get the project running via the Netbeans IDE install. I have, for the time being, installed the Java ME SDK which includes a very stripped down version of the Netbeans IDE for mobile development.
I originally had some issues starting the SDK as well on Vista. The IDE reported that it could not connect to the device manager on localhost. After some searching I found this link: Java ME SDK Startup Problem which suggests changing the hosts file localhost entry from IPv6 to IPv4. The fix worked perfectly and I can now compile and run code in the emulator.
This is not an optimal solution as the SDK does not include the visual design tools, however I am able to get a basic project going in the mean time.
I have given up on the 6.7 version and have instead located and installed 6.5.1. This previous version has been working just fine and seems to do everything I need.
I ran into the exact same error today while installing NB 6.8 beta. To resolve it we need to install two plugins:
Java Web Applications (as mentioned by Ali above) and
Sun Java System Web Server 7.0
Note that these two are part of the Category called "Java Web and EE" hence the confusion that we need to install Glassfish App Server. But we need these two plugins because they are required for debugging using breakpoints in emulator. Netbeans runs a web server when we do breakpoint based debugging.
Also note that the Java Web applications needs SOAP Web Services and JavaScript Debugger plugins to run and so these plugins are also installed when you try to install it.
You also need to install "Java Web Applications" plugin.
Tools->Plugins->Available Plugins
If the module is present, you should try unzipping it to check its content makes sense.
You should also be able to rebuild it from Netbeans sources.
You can also try to figure out why this happens by debugging the module loader inside Netbeans from its sources, using another IDE, presumably the latest version of Netbeans you can find without the issue.
If the module is missing, you might want to get the missing jar file from an installation of a previous version of Netbeans, see if it is compatible.
6.5.1 isn't missing any module.
back in version 5.5, the mobility module had to be downloaded and installed separately from the main IDE.
If you want to consider using Eclipse for developing your J2ME app...I've written a post related to that some time ago: here.

Resources