I am trying to convert Google Web Application to EAR application (backends into modules).I have created EAR Project and dynamic Web projects for modules. I have added old front-end code to the default module & back-ends code to the other modules. Facing problem while adding data to the datastore .The old Project which uses front end back-ends working properly,Problem comes when converting backends into module & tx.begin() throws Exception .I have created package.jdo for jdo configuration.
Software configuration:- Eclipse-Juno,Google App Engine SDK:- 1.8.5,JDK:- 1.7.0_65,JDO:-JDO 2.3,DataNucleus Eclipse Plugins :-4.0.0.
PersistenceManager pm = null;
pm = PMF.get().getPersistenceManager();
tx = pm.currentTransaction();
tx.begin();
pm.makePersistent(dataObj);
tx.commit();*
This is DataNucleaus Enhancement issue. Provide correct jdo files to
persistent.xml and Enhance Project. Run the project when all classess
enhanced(You will get message on console, how many classess were
enhanced.)
Related
I have an existing ASP.NET Core application (that uses razor pages) and I am trying to convert it, one component at a time, to React until I can completely make it a SPA. The idea is to create an entry point for each of my razor pages until I can combine them all into one SPA. I have most of this working except for the use of webpack-dev-server to serve my bundles. The problem I am having is the ASP.NET app runs on port 44321 and the dev server runs on port 8080 so the script tags in my .cshtml files cannot see the bundles that are being hosted from webpack.
I can temporarily change them from:
<script src="./dist/[name].bundle.js"></script>
To something like:
<script src="http://localhost:8080/[name].bundle.js"></script>
To get around this, but this is not long term solution.
I have created a sample application to showcase what I am trying to accomplish here: https://github.com/jkruse24/AspNetReact.
Is there any way to either get my ASP.Net application to listen on the port that webpack-dev-server is serving to (without changing my script tags) or to have my webpack-dev-server serve to the port that my ASP.Net app is running on?
I have tried to use the .NET CORE SPA middleware (Microsoft.AspNetCore.SpaProxy) but either I have not configured it correctly or I am misunderstanding what it is used for. Upon adding in the below code (which is commented out in my github sample) my application still looks at the .\dist directory for my bundles (which are still there from running actual builds).
if (env.IsDevelopment())
{
app.UseSpa(spa =>
{
spa.Options.SourcePath = "./ClientApp";
spa.UseReactDevelopmentServer(npmScript: "start");
spa.UseProxyToSpaDevelopmentServer("http://localhost:8080");
});
}
I ended up getting this working using the .NET Core SPA Middleware. When I originally tried to used the middleware, it was working fine, but I didn't have my webpack dev server configured to serve my bundles to the correct location.
As you can see above, I was serving them to
http://localhost:8080/[name].bundle.js
when they needed to be served to
http://localhost:8080/dist/[name].bundle.js
My problem was that my webpack publicPath was not set correctly. I made an update commit on my repository here. More specifically, this was the file diff that solved my problem.
I am trying to deploy my SSR app in Firebase originally forked from, after doing some modification in the app.
Which works fine when I do sudo firebase serve --only functions,hosting but throwing error when I do firebase deploy.
The reproducible repo has a package.json.
I am using the public directory as my function directory as well.
However, even if I am using a different function directory for my cloud functions, I see the same errors.
Function failed on loading user code. Error message:
Code in file index.js can't be loaded. Is there a syntax error in your code?
Detailed stack trace: TypeError: c(...) is not a function
at Object.<anonymous> (/user_code/assets/app.server.js:1:28950)
at Object.module.exports.n (/user_code/assets/app.server.js:1:29283)
...
Functions deploy had errors.
To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
It is possible, but you cannot serve static assets with cloud functions. You need a mix of firebase functions and firebase hosting.
The guys at Firebase already thought on this and you also have an implementation available.
Check the following documentation:
Overview
Dynamic Content
Code Example
Youtube Video
Note: There is a delay that you need to take into consideration when using cloud functions.
When a new instance handles its first request, the response time suffers, which is called a cold start
More info
The problem is that firebase hosting only supports SPAs, which means that SSR is out of the picture, you need to run your SSR server in a different env where you can run nextJS, or if you're using a static page generator you could upload the files directly compromising on the ability to refresh the content, although, I'm sure a solution with cloud functions and gatsby is feasable.
Tl;DR: You won't get SSR out of Firebase Hosting
I'm currently developing, in Android Studio, a Google Endpoints application in java. I therefore have two different modules in the project:
A "backend" module where is all my code for the Google Endpoints backend (including java beans which define my model and data store data model and auto-generated Endpoints)
An "app" module where there is the code for the corresponding Android App which will talk to the back-end.
I get the following error in the "backend" error when I call isEmpty() on a string: "Call requires API level 9 (current min is 1): java.lang.String#isEmpty".
Note that:
It seems that this error only appeared when I started to add code to the Android "app" Module. Before that, during the last year, I didn't have any problem. OR it could be that it started when I upgraded to Android Studio 2.2
I can build and deploy the "backend" module to App Engine without any problem despite the error and the class with the error works correctly.
In the build.gradle fiel of the "app" module I have:
defaultConfig {
applicationId "com.xxxx.yyy"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
In the Android Manifest of the Android app I didn't have any uses-sdk declaration. Adding one with e.g. android:minSdkVersion="14" didn't change anything.
I can build and deploy the "backend" module to App Engine without any problem despite the error and the class with the error works correctly.
I get the error in any class of the "backend" module: a simple bean, a generated Endpoint that I modify, or a "custom made" Servlet.
this is a regression. Earlier (than Jan 2014) versions of Android Studio would successfully generate the Endpoint code from a model.
steps: New Project, Tools > Generate App Engine, select any of the endpoint models (DeviceInfo or Message) or add a class file (with #Entity etc). Tools> Generate Endpoint
gets: No JPA #Entity Class found in MessageData2.java in dialog box Failed to Generate Endpoint Class
expected: code generation as in the past
update: rolled back to 0.4.2 (it used to work) and yikes! still getting Dialog Box (really stuck now).
update [not stuck anymore]: rolled back MAVEN to 3.0.5, built new clean project, app{appname}-endpoints succesfully built, then Generate Endpoint worked (still has the bug where client code is not copied to endpoint directory, look for it in {appname}-AppEngine/target and copy by hand to {appname}-endpoint tree
i logged a bug through App Studio to https://code.google.com/p/android/issues/detail?id=65270 if you want to track
(answer from comment on https://code.google.com/p/android/issues/detail?id=65270 )
Tools>Generate Endpoints will work in 0.4.3 by adding this code to pom.xml
trevorjohns#google.com :"
I ran into this problem recently. Adding:
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
</dependency>
to my backend pom.xml seemed to fix it."
yes, fixed!
on our gae for java app using gwt on loading the app and checking in firebug i see error http://www.sakshum.org/sakshumwebgae/8CB611AC7A0B5B6BE2C4C99A8EA4DEFE.cache.html as a result gwt modules seems to be not getting loaded.
I am assuming this file should be auto generated by gae. so why i m facing it and what can be done to solve it?
Your asumption is wrong. That file is generated by the GWT compilation (at the same time the sakshumwebgae/sakshumwebgae.nocache.js is generated) and should be deployed within your app.