Update php version 7 on server its hows fatal error on symonfy2` - php-7

request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException: "Compile Error: Cannot use Symfony\Component\Validator\Constraints\Null as Null because 'Null' is a special class name" at /vol/vhost/utterprints.com/src/Design/AppBundle/Controller/OrdersController.php line 30 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalErrorException(code: 0): Compile Error: Cannot use Symfony\Component\Validator\Constraints\Null as Null because 'Null' is a special class name at /vol/vhost/utterprints.com/src/Design/AppBundle/Controller/OrdersController.php:30)"} []
IN ordersController on line 30 this validator component is use.
use Symfony\Component\Validator\Constraints\Null;

Starting with PHP 7.0 the "null" keyword becomes a reserved word in a sense that it cannot be used as a name of class, trait, interface nor a part of namespace.
I see that Symfony has support for PHP7 since August 2015, so you may need to update your Symfony installation.

Related

Upgrade to Java 17 throws java.lang.RuntimeException: Error creating extended parser class: Could not determine whether class has already been loaded

I am using jtwig lib and the code was working fine but when we upgraded to Java 17, I am getting the below mention runtime exception.
Below is the method and throws RuntimeException while calling template.render()
String renderDescription(String templatePath,String userId, String caseId) {
JtwigTemplate template =
JtwigTemplate.classpathTemplate(templatePath);
JtwigModel model = JtwigModel.newModel()
.with("userId", userId)
.with("caseId", caseId)
.with("statusPageUrlTemplate",
config.getStatusPageUrlTemplate());
return template.render(model);
}
java.lang.RuntimeException: Error creating extended parser class: Could not determine whether class 'org.jtwig.parser.parboiled.base.BooleanParser$$parboiled' has already been loaded
at org.parboiled.Parboiled.createParser(Parboiled.java:58)
at org.jtwig.parser.parboiled.ParserContext.instance(ParserContext.java:31)
at org.jtwig.parser.parboiled.ParboiledJtwigParser.parse(ParboiledJtwigParser.java:37)
at org.jtwig.parser.cache.InMemoryConcurrentPersistentTemplateCache.get(InMemoryConcurrentPersistentTemplateCache.java:39)
at org.jtwig.parser.CachedJtwigParser.parse(CachedJtwigParser.java:19)
at org.jtwig.JtwigTemplate.render(JtwigTemplate.java:98)
at org.jtwig.JtwigTemplate.render(JtwigTemplate.java:74)
I was facing a similar issue after upgrading JVM version, and I found that adding this environment variable helped:
JDK_JAVA_OPTIONS=--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED
I believe it has something to do with stricter default limits on reflection when trying to inspect built-in classes.

I need help upgrading OroCommerce to 4.1.1

I just upgraded from 3.1.17 to 4.1.1 and I'm finding a problem with my shopping lists.
When I get to /customer/shoppinglist/5064 I see this:
Looking at my log files from production I see:
[2020-06-23 17:42:56] request.CRITICAL: Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\UndefinedMethodError: "Attempted to call an undefined method named "getDigitalAsset" of class "Proxies\__CG__\Oro\Bundle\AttachmentBundle\Entity\File"." at /usr/share/nginx/html/oroapp/vendor/oro/platform/src/Oro/Bundle/DigitalAssetBundle/Provider/FileTitleProvider.php line 47 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Attempted to call an undefined method named \"getDigitalAsset\" of class \"Proxies\\__CG__\\Oro\\Bundle\\AttachmentBundle\\Entity\\File\". at /usr/share/nginx/html/oroapp/vendor/oro/platform/src/Oro/Bundle/DigitalAssetBundle/Provider/FileTitleProvider.php:47)"} []
I went to look at the code and I see that in fact there is no method getDigitalAsset in oro/platform/src/Oro/Bundle/DigitalAssetBundle/Provider/FileTitleProvider.php, nor in the proxy... how can this be?
I checked this on my VM (where the problem is not happening) and I see that there's this definition in the proxy class:
/**
* {#inheritDoc}
*/
public function getDigitalAsset()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getDigitalAsset', []);
return parent::getDigitalAsset();
}
But again, I don't see a method called getDigitalAsset in the parent class.
I had some issues when doing the upgrade (I realized my nodejs wasn't upgraded as I thought it was), could that have anything to do with the issue?
Thanks
Edit:
I went through my platform upgrade again and found that there were some problems that prevented it from finishing completely.
This is what I found:
> loading Oro\Bundle\CMSBundle\Migrations\Data\ORM\LoadImageSlider
In LoadImageSlider.php line 117:
Attempted to call an undefined method named "setMainImage" of class "Oro\Bundle\CMSBundle\Entity\ImageSlide".
I commented out the loop inside the load method and re-run the upgrade. Then I got:
> loading Oro\Bundle\CMSBundle\Migrations\Data\ORM\LoadImageSlider
In QueryException.php line 65:
[Semantical Error] line 0, col 117 near 'digitalAsset': Error: Class Oro\Bundle\AttachmentBundle\Entity\File has no association named digitalAsset
In QueryException.php line 43:
SELECT file, digitalAsset, sourceFile FROM Oro\Bundle\AttachmentBundle\Entity\File file INNER JOIN file.digitalAsset digitalAsset INNER JOIN digitalAsset.sourceFile sourceFile WHERE file.parentEntityClass = :parentEntityClass
AND file.parentEntityId = :parentEntityId AND file.parentEntityFieldName =
:parentEntityFieldName
Finally I was able to complete the upgrade by commenting out the whole body of the load method
I had some issues when doing the upgrade (I realized my nodejs wasn't upgraded as I thought it was), could that have anything to do with the issue?
It looks like you have multiple versions of nodejs installed. To make an application use the right one, you can provide the absolute path to the executable with the AssetBundle configuration, like:
# config/config.yml
oro_asset:
nodejs_path: /usr/local/node
npm_path: /usr/local/npm

org.eclipse.microprofile #ConfigProperty does not work using openJDK13

We just switched from oracle jdk 10 to openJDK 13.
When we now try to start our tomee with
set JAVA_OPTS=-Dconfigfilepath="path/to/config.xml"
we get the following exception:
javax.enterprise.inject.UnsatisfiedResolutionException: Api type [java.lang.String] is not found with the qualifiers
Qualifiers: [#org.eclipse.microprofile.config.inject.ConfigProperty(name="configfilepath", defaultValue="org.eclipse.microprofile.config.configproperty.unconfigureddvalue")]
for injection into Field Injection Point, field name : configPath, Bean Owner : [Configuration, WebBeansType:MANAGED, Name:null, API Types:[de.test.Configuration,java.lang.Object], Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
It works if we use the ConfigProvider directly. I hope someone can help with this problem.

T4MVCVB doesn't work on clean install?

I just installed T4MVCVB and it won't compile:
Error 1 Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration c:\...\T4MVCVB.tt 1 1
Error 2 Compiling transformation: Method must have a return type c:\...\T4MVCVB.tt 1 6
Error 3 Compiling transformation: Type expected c:\...\T4MVCVB.tt 1 12
Note that the line number is 1 for each of these errors, so there's no way at all to see what line it doesn't like.
How can I figure out what the problem is so I can generate typed helpers for VB?
Edit: After some cleanup, now I get the following compiler error, and the line number of the problem:
Error 112 Running transformation: System.NotImplementedException: Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL))
at EnvDTE80.CodeFunction2.get_Attributes()
at {long call stack}
The line it doesn't like is:
// Ignore methods that are marked as not being actions
if (GetAttribute(method.Attributes, "System.Web.Mvc.NonActionAttribute") != null)
continue;
Make sure you are using the latest version made for VB. Here is the T4MVCVB Nuget Package
If it's still breaking before generating the .vb files, I would uncomment these two lines near the top of T4MVCVB.tt and see if you can find the problem location.
//System.Diagnostics.Debugger.Launch();
//System.Diagnostics.Debugger.Break();

getting Developer Notifications about OGNL exceptions after upgrading to struts 2.3.14.2 from 2.3.1.2

I have my web application built using struts 2.3.1.2. I have following pages/actions where I don't get any OGNL exception as a warning/notification.
JSP page - containing 3 text fields name, address, phone
struts.xml file - devMode = true and corresponding action entry using default interceptor stack
action class where I have properties only for two request parameters i.e. for name and address
Above is running fine and I don't get any warning/notification exception.
Now, recently I have upgraded to struts 2.3.14.2 And I have started to get below warning/notification exception on log file:
Developer Notification (set struts.devMode to false to disable this message):
Unexpected Exception caught setting 'start' on 'class com.xyz.DetailsActionSupport:
Error setting expression 'start' with value ['0', ] - Error setting expression 'start' with value ['0', ] - [unknown location] at
com.opensymphony.xwork2.ognl.OgnlValueStack.handleRuntimeException(OgnlValueStack.java:201) at
com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:178) at
com.opensymphony.xwork2.ognl.OgnlValueStack.setParameter(OgnlValueStack.java:152) at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:329) at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:241) at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) and more ...
By google search, found two answers:
to add the exclude parameters in struts.xml for Param interceptor
disable the development mode defined in struts.xml
I can do that, but, don't understand what has changed in struts version so it has started to print the exceptions as notifications/warnings?
Below link will tells us how it shows warning exception:
http://struts.apache.org/release/2.3.x/docs/parameters-interceptor.html
Refer the section Warning on missing parameters from above link