Heroku Couldnt Find that app - heroku

I am working on linux terminal, when i try the command - heroku create
It works
Creating app... done, ⬢ frozen-plateau-26000
https://frozen-plateau-26000.herokuapp.com/ | https://git.heroku.com/frozen-plateau-26000.git
But when i try next to perform heroku open
I get this
(node:23086) Error Plugin: install: files attribute must be specified in /home/user/.local/share/heroku/node_modules/install/package.json
module: #oclif/plugin-legacy#1.1.0
plugin: install
root: /home/user/.local/share/heroku/node_modules/install
See more details with DEBUG=*
(node:23086) [ERR_INVALID_CALLBACK] #oclif/plugin-legacy: Plugin mvn: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
/home/user/.local/share/heroku/node_modules/mvn
▸ Couldn't find that app.
This is a spring boot application and here is part of my pom
<dependency>
<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Use this:
heroku open --app <app-name>
--app (alias: -a) is a required parameter for heroku open. Check heroku open --help for more details on the command usage.

Related

Spring boot generated jar file just work inside root of project

I am new in Spring boot and I think this issue is very basic.
I created an application using Spring Boot and everything is good in dev environment. But when I copy the jar file from target directory to another machine and run "java -jar" it doesn't render jsp pages with following error:
There was an unexpected error (type=Not Found, status=404)
when I copy src folder from project root to same location it works fine.
It seems the jar file just work from project's root.
Here is my configurations:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Spring Boot Section -->
<!-- Web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/webapp</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
and my project structure:
and I run following at command line:
mvn clean package
I have following in my target directory:
I can run the application using
java -jar target/springboot-in-10-steps-0.0.1.jar
Application works as expected and it renders welcome page.
When I go to target directory and run same command:
java -jar springboot-in-10-steps-0.0.1.jar
Application gets launch but it doesn't render the welcome page.
When I copy src to target everything is fine and I can see welcome page. It seems Spring boot doesn't find WEB-INF/jsp directory in the jar file.
Did I miss something in spring boot configuration or application.properties?
I could fix it by changing packaging from jar to war and interestingly this works:
java -jar springboot-in-10-steps-0.0.1.war
I think there are ways to change the structure of files and folders within generated jar file using repackage features.

I cant perform mvn release:prepare

I am trying to perform mvn release:prepare with tfs and got error:
Command line - cmd.exe /X /C "tf status -login:[domain]\[username],null -workspace:workspace -recursive -format:detailed [pathToTheProject]"
[INFO] err - TF30063: You are not authorized to access [serverName].
I suspect that maven have problem with recognizing password or maybe I set my developerConnection wrong
My Scm:
<scm>
<developerConnection>scm:tfs:[domain]\\[username];[password]http[s]://server_name:workspace:$/TeamProject/Path/To/Project</developerConnection>
<url>[domain]\\[username];[password]http[s]://server_name:workspace:$/TeamProject/Path/To/Project</url>
</scm>
My build tag in maven:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<version>1.5</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-tfs</artifactId>
<version>1.9.5</version>
<scope>compile</scope>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-tfs</artifactId>
<version>1.9.5</version>
<scope>compile</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
I cannot comment on your TFS config. But if you get an authentication failure for the SCM server, then you are probably lacking an entry like this for the server:
<server>
<id>myServer</id>
<username>theUserId</username>
<password>{encryptedPassword}</password>
</server>
This should be set in the settings.xml file used by your build server running your maven builds.
Check out the documentation on how to encrypt your passwords.
Try the SCM URL below:
scm:tfs:[[domain\\]username[;password]#]http[s]://server_name[:port][:isCheckinPoliciesEnabled]:workspace:$/TeamProject/Path/To/Project
You would get an Access Denied error if maven were not able to authenticate. Instead you get a TF30063 which is mostly related to a permission issue: have you checked that the user authenticating with TFS has read permission to the TFS version control?

Intellij + springboot + maven + spring-loaded

I have an issue where debugging stops working in Intellij, when applying Spring-loaded as a dependency to the maven plugin.
Situation 1 (working):
Using a autogenerated spring-boot maven (pom.xml) file with a declared "Spring-boot-maven-plugin" I can debug my my app using the debug-maven command in intellij. The pom file looks like this:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Situation 2 (not working):
Following the guide lines here: spring-boot-hot-swapping one should add a dependency for spring-loaded, to make use of spring-loaded. The pom file now looks like:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.3.RELEASE</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Debugging the same run-configuration as before does not work. The break-points simply never turns into a "checkmark" and the code never suspends. Code is now hotswapping as one would expect... If I remove the plugin-dependency again, debugging starts working again...
Please help me make situation two work!
IntelliJ 14.1.3 Ultimate, Java 7, Spring boot 1.2.4, Spring loaded 1.2.3
Since it seems there is no one with an answer to this (nor in IntelliJ forums) i've created an issue:
https://youtrack.jetbrains.com/issue/IDEA-142078
Did you try with spring-devtools (since 1.2.3) ? Use this dependency :
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
There is already a ticket here, it seams the same issue.

Spring Loaded not picking up changes (Run via Command Line / Edit using IntelliJ)

I have a very basic Spring Boot application that i use to run inside a terminal windows using.
mvn clean spring-boot:run
To use Spring Loaded i have modified my pom.xml to auto attach the reloading agent.
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>${spring-boot.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
In the console window i see that the reloading agent is attached.
But when i open the Maven Project inside IntelliJ and modify some code the reloading does not take place. I tried to manually compile the modified classes but this also seems not to have any effect.
What am i missing??
It seemed that Java 8 Update 40 broke the compatibility. So a downgrade to Java 8 Update 31 solved the issue.

Using Camel-hdfs in a karaf bundle

I am trying to implement an camel route to send files in a HDFS server with an OSGI bundle, using java language with no blue print, but i can't make it work due tu hdfs scheme not being found while creating the route.
The code of the class has been tested as a Jar and works. The issue is in karaf, which seems to not be able to use camel-hdfs for the bundle, even if the camel-hdfs bundle is shown using the list command.
Here's the pom file of the project :
<modelVersion>4.0.0</modelVersion>
<groupId>the.group</groupId>
<artifactId>receiveFile</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>receiveFile</name>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi_R4_core</artifactId>
<version>1.0</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-hdfs</artifactId>
<version>2.10.4</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.10.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>*</Import-Package>
<Export-Package>activation</Export-Package>
<Private-Package>activation</Private-Package>
<Bundle-Activator>activation.Activator</Bundle-Activator>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
I tried also Embed-Dependency with the transitive option, but it still doesn't work and i'm kind of stuck right now.
Karaf prints the following error :
org.osgi.framework.BundleException: Exception in activation.Activator.start() of bundle group.receiveFile.
The log :
org.osgi.framework.BundleException: Exception in activation.Activator.start() of bundle group.receiveFile.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806)[osgi-3.6.2.R36x_v20110210.jar:]
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)[osgi-3.6.2.R36x_v20110210.jar:]
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)[osgi-3.6.2.R36x_v20110210.jar:]
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)[osgi-3.6.2.R36x_v20110210.jar:]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1244)[6:org.apache.felix.fileinstall:3.2.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1216)[6:org.apache.felix.fileinstall:3.2.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1205)[6:org.apache.felix.fileinstall:3.2.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:500)[6:org.apache.felix.fileinstall:3.2.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[6:org.apache.felix.fileinstall:3.2.4]
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1027 at: >>> To[hdfs://hadoopServer/received] <<< in route: Route[[From[file://toSend/]] -> [To[hdfs://hadoopServer/rece... because of Failed to resolve endpoint: hdfs://hadoopServer/received due to: No component found with scheme: hdfs
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:879)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:172)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:722)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1789)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1575)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1444)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1412)
at activation.Activator.start(Activator.java:24)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)[osgi-3.6.2.R36x_v20110210.jar:]
at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_11]
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)[osgi-3.6.2.R36x_v20110210.jar:]
... 8 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: hdfs://hadoopServer/received due to: No component found with scheme: hdfs
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:485)
at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:50)
at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:187)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:114)
at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)
at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)
at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:461)
at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:179)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:876)
... 19 more
Karaf version : 2.2.8
Maven : m2e plugin, 3.0.4
Thanks in advance.
I would suggest to use a blueprint XML file to bootstrap your application. Just to setup a < camelContext >.
Otherwise you would have to do a lot of manual osgi setup and whatnot in your activator to properly setup Camel for OSGi. All that is taken care of when using camel-blueprint.
If you still want to do it from an Activator, then check out camel-core-osgi and see what we do there.

Resources